Example #1
0
 /// <summary>
 /// Adds the locked door to dungeon.
 /// </summary>
 public static void AddLockedDoorToDungeon(Dungeon dungeon, GameObject doorPrefab, Doorway doorway)
 {
     dungeon.LockedDoorList.Add(doorPrefab.GetComponent <LockedDoor>());
 }
Example #2
0
        internal TilePlacementData(PreProcessTileData preProcessData, bool isOnMainPath, DungeonArchetype archetype, TileSet tileSet, Dungeon dungeon)
        {
            root = (GameObject)GameObject.Instantiate(preProcessData.Prefab);

            Bounds       = preProcessData.Proxy.GetComponent <Collider>().bounds;
            IsOnMainPath = isOnMainPath;

            tile = Root.GetComponent <Tile>();

            if (tile == null)
            {
                tile = Root.AddComponent <Tile>();
            }

            tile.Placement = this;
            tile.Archetype = archetype;
            tile.TileSet   = tileSet;
            tile.Dungeon   = dungeon;

            foreach (var doorway in Root.GetComponentsInChildren <Doorway>(true))
            {
                doorway.Dungeon = dungeon;
                doorway.Tile    = tile;
                AllDoorways.Add(doorway);
            }

            UnusedDoorways.AddRange(AllDoorways);
        }
Example #3
0
 void Start()
 {
     instance    = this;
     gameManager = GameManager.instance;
     Init();
 }