private void Teleport(string[] args) { if (args.Length != 2) { DebugMessage("Invalid parameters"); } if (args[1].ToLower() == "entrance") { var player = GameObject.Find("Player"); var position = DungeonData.GetEntrancePosition(DungeonData.currentLevel); player.transform.position = position + new Vector3(0f, 2.5f, 0f); DebugMessage("Teleporting to entrance"); } else if (args[1].ToLower() == "exit") { var player = GameObject.Find("Player"); var position = DungeonData.GetExitPosition(DungeonData.currentLevel); player.transform.position = position + new Vector3(0f, 2.5f, 0f); DebugMessage("Teleporting to exit"); } else { DebugMessage("Unknown location"); } }
private void NextLevel(string[] args) { var player = GameObject.Find("Player"); var position = DungeonData.GetExitPosition(DungeonData.currentLevel); player.transform.position = position + new Vector3(0f, 2.5f, 0f); DebugMessage("Teleporting to next level"); }