public void OnGUI() { if (dungeonManager.IsBusy()) { return; } int size = Mathf.Max(Screen.width, Screen.height) / 10; if (GUI.Button(new Rect(10, 10, size, size), "New")) { dungeonManager.BuildDungeon(true); } if (GUI.Button(new Rect(10 + size + 10, 10, size, size), "New Nice")) { dungeonManager.BuildDungeonNiceAnimation(); } if (GUI.Button(new Rect(Screen.width - size - 10, Screen.height - size - 10, size, size), "Camera")) { if (dungeonManager.cameraFollowEntity.gameObject.activeSelf && !dungeonManager.cameraFollowEntity.firstPerson) { dungeonManager.cameraFollowEntity.firstPerson = true; dungeonManager.dungeonUnity.avatar.model.SetActive(false); } else if (dungeonManager.cameraFollowEntity.gameObject.activeSelf && dungeonManager.cameraFollowEntity.firstPerson) { dungeonManager.cameraFollowEntity.gameObject.SetActive(false); dungeonManager.cameraMap.gameObject.SetActive(true); dungeonManager.dungeonUnity.avatar.model.SetActive(true); } else { dungeonManager.cameraFollowEntity.gameObject.SetActive(true); dungeonManager.cameraFollowEntity.firstPerson = false; dungeonManager.cameraMap.gameObject.SetActive(false); dungeonManager.dungeonUnity.avatar.model.SetActive(true); } } if (GUI.Button(new Rect(Screen.width - size - 10, 10, size, size), "Light")) { if (RenderSettings.ambientLight == Color.white) { RenderSettings.ambientLight = new Color32(67, 67, 67, 255); } else { RenderSettings.ambientLight = Color.white; } } DrawPlayerController(); }
// When the Player object enters a door in the world space this method will handle the transition. public void EnterDungeon() { // Make the world space invisible worldScript.worldBoard.gameObject.SetActive(false); ClearEnemies(); // Build a dungeon map (the Player object will place the Player in the new dungeon). dungeonScript.BuildDungeon(); }
public override void OnInspectorGUI() { DrawDefaultInspector(); DungeonManager dungeonManager = (DungeonManager)target; if (GUILayout.Button("Create and Build Dungeon")) { dungeonManager.CreateAndBuild(); } if (GUILayout.Button("Create Dungeon")) { dungeonManager.CreateDungeon(); } if (GUILayout.Button("Build Dungeon")) { dungeonManager.BuildDungeon(); } }