Пример #1
0
 public DungeonTile(LevelGenerator.Room room, EncounterScriptableObject encounter)
 {
     Encounter = encounter;
     Room      = room;
     Visited   = false;
     Seen      = false;
 }
Пример #2
0
    public GameObject SpawnPlayerInRoomCenter(LevelGenerator.Room room)
    {
        string room_prefix = "PlayerData/";

        string pickedFile = playerName;

        GameObject loadedPlayer = Resources.Load <GameObject>(room_prefix +
                                                              pickedFile.Substring(0,
                                                                                   pickedFile.LastIndexOf(".")));

        loadedPlayer.transform.position = new Vector3(room.roomGameObject.transform
                                                      .Find("Floor").GetComponent <Tilemap>().localBounds.center.x, room.roomGameObject.transform
                                                      .Find("Floor").GetComponent <Tilemap>().localBounds.center.y, 0);

        var spawnedPlayer = Instantiate(loadedPlayer);

        return(spawnedPlayer);
    }
Пример #3
0
 public static void MoveObjectToRoomCenter(GameObject player, LevelGenerator.Room room)
 {
     player.transform.position = new Vector3(room.roomGameObject.transform
                                             .Find("Floor").GetComponent <Tilemap>().localBounds.center.x, room.roomGameObject.transform
                                             .Find("Floor").GetComponent <Tilemap>().localBounds.center.y, 0);
 }