当前位置: 首页>>代码示例>>C#>>正文


C# Door类代码示例

本文整理汇总了C#中Door的典型用法代码示例。如果您正苦于以下问题:C# Door类的具体用法?C# Door怎么用?C# Door使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Door类属于命名空间,在下文中一共展示了Door类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Spawn

 private void Spawn(Door.Spawn spawn)
 {
     Vector3 spawnPosition = transform.position;
     switch (spawn) {
         case Door.Spawn.TOP:
             spawnPosition.x = 4.7f;
             spawnPosition.y = 0f;
             break;
         case Door.Spawn.BOTTOM:
             spawnPosition.x = 4.7f;
             spawnPosition.y = 5.5f;
             break;
         case Door.Spawn.LEFT:
             spawnPosition.x = 0f;
             spawnPosition.y = 3.5f;
             break;
         case Door.Spawn.RIGHT:
             spawnPosition.x = 9f;
             spawnPosition.y = 3.5f;
             Flip();
             break;
         case Door.Spawn.CENTER:
             spawnPosition.x = 3.5f;
             spawnPosition.y = 3.5f;
             break;
     }
     transform.position = spawnPosition;
 }
开发者ID:ickybodclay,项目名称:bosses,代码行数:28,代码来源:Player.cs

示例2: paintTerrain

    protected void paintTerrain(MapCell[,] map, Door d)
    {
        terrain = this.gameObject.GetComponent<Terrain>();
        float[,,] splatmapData = new float[terrain.terrainData.alphamapWidth, terrain.terrainData.alphamapHeight, terrain.terrainData.alphamapLayers];

        float[] splatWallWeights = new float[terrain.terrainData.alphamapLayers];
        splatWallWeights[0] = 0f;
        splatWallWeights[1] = 1f;

        float[] splatFloorWeights = new float[terrain.terrainData.alphamapLayers];
        splatFloorWeights[0] = 1f;
        splatFloorWeights[1] = 0f;

        int indexXmap, indexYmap;
        for (int i = 0; i < splatmapData.GetLength(0); i++)
        {
            for (int j = 0; j < splatmapData.GetLength(1); j++)
            {
                indexXmap = Mathf.Clamp(i/factor, 0, map.GetLength(0) - 1);
                indexYmap = Mathf.Clamp(j/factor, 0, map.GetLength(0) - 1);
                if (map[indexXmap, indexYmap].cellKind == MapCell.CellKind.WALL || map[indexXmap, indexYmap].cellKind == MapCell.CellKind.UNUSED)
                {
                    splatmapData = setSplatWeights(i, j, splatWallWeights, splatmapData);
                }
                else
                {
                    splatmapData = setSplatWeights(i, j, splatFloorWeights, splatmapData);
                }
            }
        }
        terrain.terrainData.SetAlphamaps(0, 0, splatmapData);
        terrain.Flush();
    }
开发者ID:Notnasiul,项目名称:PracticasULPGC2015,代码行数:33,代码来源:TerrainPainter.cs

示例3: Update

    // Update is called once per frame
    public void Update()
    {
        if (_lastSelectedCount != WindowCount)
        {
            WindowCountChanged(WindowCount);
            _lastSelectedCount = WindowCount;
        }

        if (_door != Door)
        {
            DoorChanged(Door);
            _door = Door;
        }

        if (_houseMaterial != HouseMaterial)
        {
            HouseMaterialChanged(HouseMaterial);
            _houseMaterial = HouseMaterial;
        }

        if (_doorMaterial != DoorMaterial)
        {
            DoorMaterialChanged(DoorMaterial);
            _doorMaterial = DoorMaterial;
        }

        if (_windowColor != WindowColor)
        {
            WindowColorChanged(WindowColor);
            _windowColor = WindowColor;
        }
    }
开发者ID:Rfaering,项目名称:House3D,代码行数:33,代码来源:Configuration.cs

示例4: connectDoor

 public void connectDoor(Door other)
 {
     otherDoor = other;
     other.otherDoor = (this);
     other.used = true;
     used = true;
 }
开发者ID:JonECG,项目名称:Spoopy,代码行数:7,代码来源:Door.cs

示例5: AddOpenInteractions

 private static void AddOpenInteractions(Door door)
 {
     door.RemoveInteractionByType(OpenDoorToOtherSideInteraction.Singleton);
     door.AddInteraction(OpenDoorToOtherSideInteraction.Singleton);
     door.RemoveInteractionByType(OpenDoorInteraction.Singleton);
     door.AddInteraction(OpenDoorInteraction.Singleton);
 }
开发者ID:markmanching,项目名称:virtual-artisan-s3mods,代码行数:7,代码来源:DoorOpener.cs

示例6: DoorCantBeUnlockedWithNotEnoughClues

        public void DoorCantBeUnlockedWithNotEnoughClues()
        {
            var testDoor = new Door(new QuickGraph.TaggedEdge<int, string>(0, 1, "test"), new Connection(0, 1), new Connection(0, 1), "door1", 0, 2);
            var clue0 = new Clue(testDoor, new List<int>());

            Assert.IsFalse(testDoor.CanDoorBeUnlockedWithClues(new List<Clue>(new Clue[] { clue0 })));
        }
开发者ID:Sinellil,项目名称:roguelike-cs,代码行数:7,代码来源:DoorTest.cs

示例7: SubmitDirection

 public void SubmitDirection(Door.Direction directionToSubmit)
 {
     foreach(IOverworldEventListener listener in IterateListeners<IOverworldEventListener>())
     {
         listener.SubmitDirection(directionToSubmit);
     }
 }
开发者ID:Awesome-MQP,项目名称:Storybook,代码行数:7,代码来源:UIEventDispatcher.cs

示例8: UseDoor

 public void UseDoor()
 {
     ToggleForceHide();
     Invoke("ToggleForceHide", 6);
     useableDoor = currentDoor.GetComponent<Door>();
     useableDoor.StartNewTeleport();
 }
开发者ID:redahanb,项目名称:Spectral,代码行数:7,代码来源:DoorButton.cs

示例9: BuildLevel

    public static void BuildLevel()
    {
        Room room00 = new Room("room 00", "It's clearly a room");

        Room room01 = new Room("room 01", "It's clearly a room");
        Room room02 = new Room("room 02", "It's clearly a room");
        Room room10 = new Room("room 10", "It's clearly a room");
        Room room11 = new Room("room 11", "It's clearly a room");
        Room room12 = new Room("room 12", "It's clearly a room");
        //Room room20 = new Room("room 20", "room description");
        //Room room21 = new Room("room 21", "room description");
        Room room22 = new Room("room 22", "It's clearly a room");

        Item key = new Item("Key", "A brass object used to unlock a specific lock. Commonly known as a 'Key'", room11, null, Action.OpenDoor, room11);
        room11.AddItem(key);

        Door door = new Door("Door", "A wooden board with hinges on one side, usually used to block a passage way. Commonly known as a 'Door'", room12, room22, key, null, Action.None);
        door.locked = true;
        room12.doorSouth = door;
        room12.AddObject(door);
        room22.doorNorth = door;
        room22.AddObject(door);

        dungeon[0, 0] = room00;
        dungeon[0, 1] = room01;
        dungeon[0, 2] = room02;
        dungeon[1, 0] = room10;
        dungeon[1, 1] = room11;
        dungeon[1, 2] = room12;
        //dungeon[2, 0] = room20;
        //dungeon[2, 1] = room21;
        dungeon[2, 2] = room22;

        startingRoom = room00;
    }
开发者ID:MedeirosMarcelo,项目名称:MUD,代码行数:35,代码来源:GameManager.cs

示例10: Start

    private void Start()
    {
        attachedDoor = gameObject.GetComponent<Door>();

        if (attachedDoor == null)
            Debug.LogError("This script needs to be on a gameObject that has the Door script attached.");
    }
开发者ID:KickAss42,项目名称:Projet-SurvivAll,代码行数:7,代码来源:KeypadUnlock.cs

示例11: MazePrototypeFactory

 public MazePrototypeFactory(Maze maze, Room room, Door door, Wall wall)
 {
     this.prototypeMaze = maze;
     this.prototypeRoom = room;
     this.prototypeDoor = door;
     this.prototypeWall = wall;
 }
开发者ID:TheoAndersen,项目名称:GoF.CreationalPatterns,代码行数:7,代码来源:MazePrototypeFactory.cs

示例12: TextureGet118

 public void TextureGet118()
 {
     using (PexDisposableContext disposables = PexDisposableContext.Create())
     {
       Door door;
       Texture2D texture2D;
       door = new Door
          (1, default(Point), default(Point), 0, default(Point), default(Point),
                                                 Orientation.H, RuneKey.Red, (Texture2D)null);
       door.Opened = false;
       texture2D = this.TextureGet(door);
       disposables.Add((IDisposable)texture2D);
       disposables.Dispose();
       Assert.IsNull((object)texture2D);
       Assert.IsNotNull((object)door);
       Assert.AreEqual<bool>(false, door.Opened);
       Assert.AreEqual<bool>(true, door.IsRuneDoor);
       Assert.AreEqual<RuneKey>(RuneKey.Red, door.KeyColor);
       Assert.AreEqual<Orientation>(Orientation.H, door.Orientation);
       Assert.IsNotNull(door.Areas);
       Assert.AreEqual<int>(2, door.Areas.Length);
       Assert.AreEqual<int>(0, door.Areas[0]);
       Assert.AreEqual<int>(0, door.Areas[1]);
       Assert.IsNull(door.Texture);
     }
 }
开发者ID:nezbo,项目名称:Descent,代码行数:26,代码来源:DoorTest.TextureGet.g.cs

示例13: UnlockDoor

        private void UnlockDoor(Door door)
        {
            if (!Inventory.Contains(door.Key))
            {
                Print("You have nothing to unlock that with.");
                return;
            }

            if (IndirectObject == null)
            {
                if (Inventory.Items.Count == 1 && Inventory.Items[0] == door.Key)
                {
                    Print("(with the {0})", door.Key.Name);
                    Print("You unlock the {0}.", Object.Name);
                    Object.IsLocked = false;
                    return;
                }

                ObjectNotSpecified();
            }
            else if (IndirectObject == door.Key)
            {
                Print("You unlock the {0}.", Object.Name);
                Object.IsLocked = false;
            }

        }
开发者ID:jphamilton,项目名称:Adventure.Net,代码行数:27,代码来源:Unlock.cs

示例14: MazyPrototypeFactory

 public MazyPrototypeFactory(Maze maze, Wall wall, Room room, Door door)
 {
     _maze = maze;
     _wall = wall;
     _room = room;
     _door = door;
 }
开发者ID:trupak,项目名称:DesignPatternsViaC,代码行数:7,代码来源:MazyPrototypeFactory.cs

示例15: apply

 protected void apply(MapCell[,] map,Door door)
 {
     terrain = this.gameObject.GetComponent<Terrain> ();
     //Debug.Log ("Dimensiones del mapa de alturas:" + terrain.terrainData.heightmapWidth + "x" + terrain.terrainData.heightmapHeight);
     float[,] heights = terrain.terrainData.GetHeights (0, 0, terrain.terrainData.heightmapWidth, terrain.terrainData.heightmapWidth);
     applyCellMap (heights,map);
     callPlayerCreator (door);
 }
开发者ID:Notnasiul,项目名称:PracticasULPGC2015,代码行数:8,代码来源:HeightMapApplicator.cs


注:本文中的Door类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。