本文整理汇总了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;
}
示例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();
}
示例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;
}
}
示例4: connectDoor
public void connectDoor(Door other)
{
otherDoor = other;
other.otherDoor = (this);
other.used = true;
used = true;
}
示例5: AddOpenInteractions
private static void AddOpenInteractions(Door door)
{
door.RemoveInteractionByType(OpenDoorToOtherSideInteraction.Singleton);
door.AddInteraction(OpenDoorToOtherSideInteraction.Singleton);
door.RemoveInteractionByType(OpenDoorInteraction.Singleton);
door.AddInteraction(OpenDoorInteraction.Singleton);
}
示例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 })));
}
示例7: SubmitDirection
public void SubmitDirection(Door.Direction directionToSubmit)
{
foreach(IOverworldEventListener listener in IterateListeners<IOverworldEventListener>())
{
listener.SubmitDirection(directionToSubmit);
}
}
示例8: UseDoor
public void UseDoor()
{
ToggleForceHide();
Invoke("ToggleForceHide", 6);
useableDoor = currentDoor.GetComponent<Door>();
useableDoor.StartNewTeleport();
}
示例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;
}
示例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.");
}
示例11: MazePrototypeFactory
public MazePrototypeFactory(Maze maze, Room room, Door door, Wall wall)
{
this.prototypeMaze = maze;
this.prototypeRoom = room;
this.prototypeDoor = door;
this.prototypeWall = wall;
}
示例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);
}
}
示例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;
}
}
示例14: MazyPrototypeFactory
public MazyPrototypeFactory(Maze maze, Wall wall, Room room, Door door)
{
_maze = maze;
_wall = wall;
_room = room;
_door = door;
}
示例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);
}