public DungeonTile(LevelGenerator.Room room, EncounterScriptableObject encounter) { Encounter = encounter; Room = room; Visited = false; Seen = false; }
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); }
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); }