/// <summary> /// Goes through all sections and activates the current section. /// </summary> public void ReactivateTriggers() { Constants.CHAPTER chapter = (Constants.CHAPTER)currentChapter.value; Constants.OverworldArea index = (Constants.OverworldArea)currentScene.value; Constants.ROOMNUMBER roomNumber = (Constants.ROOMNUMBER)currentRoomNumber.value; for (int i = 0; i < sectionList.Length; i++) { sectionList[i].ActivateSection(chapter, index, roomNumber); } }
public CameraValues GetValues(Constants.OverworldArea area, Constants.ROOMNUMBER number) { for (int i = 0; i < values.Length; i++) { if (values[i].area == area && values[i].roomNumber == number) { return(values[i]); } } return(null); }
/// <summary> /// Initializes all the window specific variables. /// </summary> void InitializeWindow() { cheatMenu = (CheatMenu)ScriptableObject.CreateInstance("CheatMenu"); dialogueMenu = (DialogueSceneEditorWindow)ScriptableObject.CreateInstance("DialogueSceneEditorWindow"); battleMenu = (BattleSceneEditorWindow)ScriptableObject.CreateInstance("BattleSceneEditorWindow"); _currentChapter = (Constants.CHAPTER)currentChapter.value; _currentArea = (Constants.SCENE_INDEXES)currentArea.value; _playerArea = (Constants.SCENE_INDEXES)playerArea.value; _currentRoom = (Constants.ROOMNUMBER)currentRoom.value; Debug.Log("Init"); }
void DrawAreaValues() { GUILayout.Label("Area values", EditorStyles.boldLabel); _currentChapter = (Constants.CHAPTER)EditorGUILayout.EnumPopup("Current Chapter", _currentChapter); _currentArea = (Constants.SCENE_INDEXES)EditorGUILayout.EnumPopup("Current Scene Index", _currentArea); _playerArea = (Constants.SCENE_INDEXES)EditorGUILayout.EnumPopup("Current OW Scene Index", _playerArea); _currentRoom = (Constants.ROOMNUMBER)EditorGUILayout.EnumPopup("Current Room", _currentRoom); GUILayout.Label("Player values", EditorStyles.boldLabel); totalExp.value = EditorGUILayout.IntField("Total EXP", totalExp.value); totalMoney.value = EditorGUILayout.IntField("Total Money", totalMoney.value); GUILayout.Label("Player values", EditorStyles.boldLabel); EditorGUILayout.LabelField("Max health", playerMaxHealth.value.ToString()); GUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Android Attack", playerAttack.value.ToString()); EditorGUILayout.LabelField("Soldier Attack", playerSAttack.value.ToString()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Android Defense", playerDefense.value.ToString()); EditorGUILayout.LabelField("Soldier Defense", playerSDefense.value.ToString()); GUILayout.EndHorizontal(); }
public override void OnInspectorGUI() { TriggerController controller = target as TriggerController; DrawDefaultInspector(); if (GUILayout.Button("Update Triggers")) { UpdateTriggers(controller); } GUILayout.Space(20); Constants.CHAPTER cChapter = (Constants.CHAPTER)controller.currentChapter.value; cChapter = (Constants.CHAPTER)EditorGUILayout.EnumPopup("Current Chapter", (Constants.CHAPTER)cChapter); controller.currentChapter.value = (int)cChapter; Constants.SCENE_INDEXES cArea = (Constants.SCENE_INDEXES)controller.currentScene.value; cArea = (Constants.SCENE_INDEXES)EditorGUILayout.EnumPopup("Current Area", (Constants.SCENE_INDEXES)cArea); controller.currentScene.value = (int)cArea; controller.currentPlayerArea.value = controller.currentScene.value; Constants.ROOMNUMBER cRoom = (Constants.ROOMNUMBER)controller.currentRoomNumber.value; cRoom = (Constants.ROOMNUMBER)EditorGUILayout.EnumPopup("Room Number", (Constants.ROOMNUMBER)cRoom); controller.currentRoomNumber.value = (int)cRoom; GUILayout.Space(20); if (GUILayout.Button("Reactivate", GUILayout.Height(50))) { ReactivateTriggers(controller); } if (GUILayout.Button("Verify trigger IDs")) { VerifyTriggers(controller); } }
/// <summary> /// Activates the chapter with the given id and deactivates the rest. /// </summary> /// <param name="chapterID"></param> public void ActivateSection(Constants.CHAPTER chapter, Constants.OverworldArea sceneIndex, Constants.ROOMNUMBER number) { string chapterID = chapter.ToString().ToLower(); if (containers.Count == 0) { Debug.LogWarning("Empty area"); return; } bool state = (sceneIndex == activeArea && roomNumber == number); containers[0].gameObject.SetActive(state); for (int i = 1; i < containers.Count; i++) { // Debug.Log("Checking " + chapterIDs[i] + ", object pos " + i + ", Index: " + activeArea); containers[i].gameObject.SetActive(state && chapterID == chapterIDs[i]); } }