private void UpdateUnfoldedEventData(SerializedProperty currentSEvent) { SetEventProps(currentSEvent); /* Draw a line */ GUILayout.Box("", new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.Height(1) }); EditorGUILayout.PropertyField(eventType_Prop); EditorGUILayout.Space(); CustomEventDetails.CustomEventType ty = (CustomEventDetails.CustomEventType)eventType_Prop.enumValueIndex; switch (ty) { case CustomEventDetails.CustomEventType.Dialog: strings_Prop.arraySize = EditorGUILayout.IntField(new GUIContent("Lines"), strings_Prop.arraySize); EditorGUILayout.Space(); for (int i = 0; i < strings_Prop.arraySize; i++) { strings_Prop.GetArrayElementAtIndex(i).stringValue = EditorGUILayout.TextField(new GUIContent("Dialog " + (i + 1)), strings_Prop.GetArrayElementAtIndex(i).stringValue); } break; case CustomEventDetails.CustomEventType.Choice: strings_Prop.arraySize = EditorGUILayout.IntField(new GUIContent("Choices"), strings_Prop.arraySize); ints_Prop.arraySize = strings_Prop.arraySize; EditorGUILayout.Space(); for (int i = 0; i < strings_Prop.arraySize; i++) { strings_Prop.GetArrayElementAtIndex(i).stringValue = EditorGUILayout.TextField(new GUIContent("Choice " + (i + 1)), strings_Prop.GetArrayElementAtIndex(i).stringValue); ints_Prop.GetArrayElementAtIndex(i).intValue = EditorGUILayout.IntField(new GUIContent("Jump to Tree:"), ints_Prop.GetArrayElementAtIndex(i).intValue); } break; case CustomEventDetails.CustomEventType.Walk: EditorGUILayout.PropertyField(runSimul_Prop, new GUIContent("Run Simultaneously")); EditorGUILayout.Space(); EditorGUILayout.PropertyField(object0_Prop, new GUIContent("Character")); EditorGUILayout.PropertyField(dir_Prop, new GUIContent("Direction")); EditorGUILayout.PropertyField(int0_Prop, new GUIContent("Steps")); EditorGUILayout.PropertyField(bool0_Prop, new GUIContent("Lock Direction")); EditorGUILayout.PropertyField(float0_Prop, new GUIContent("Speed Multiplier")); break; case CustomEventDetails.CustomEventType.TurnTo: EditorGUILayout.PropertyField(object0_Prop, new GUIContent("Character")); EditorGUILayout.PropertyField(object1_Prop, new GUIContent("Turn Towards")); int0_Prop.intValue = EditorGUILayout.IntField(new GUIContent("Direction Mod"), int0_Prop.intValue); break; case CustomEventDetails.CustomEventType.Wait: EditorGUILayout.PropertyField(float0_Prop, new GUIContent("Seconds")); break; case CustomEventDetails.CustomEventType.LogicCheck: CustomEventDetails.Logic lo = (CustomEventDetails.Logic)logic_Prop.enumValueIndex; //Boolean Logic Checks if (lo == CustomEventDetails.Logic.SpaceInParty) { EditorGUILayout.PropertyField(bool0_Prop, new GUIContent("NOT")); } else { EditorGUILayout.PropertyField(float0_Prop, new GUIContent("Check Value:")); } EditorGUILayout.PropertyField(logic_Prop, new GUIContent("Computation")); //CVariable Logic Checks if (lo == CustomEventDetails.Logic.CVariableEquals || lo == CustomEventDetails.Logic.CVariableGreaterThan || lo == CustomEventDetails.Logic.CVariableLessThan) { EditorGUILayout.PropertyField(string0_Prop, new GUIContent("C Variable")); } EditorGUILayout.Space(); EditorGUILayout.PropertyField(int0_Prop, new GUIContent("Jump to Tree:")); break; case CustomEventDetails.CustomEventType.SetCVariable: EditorGUILayout.PropertyField(string0_Prop, new GUIContent("Set Variable:")); EditorGUILayout.PropertyField(float0_Prop, new GUIContent("To Value:")); break; case CustomEventDetails.CustomEventType.Sound: EditorGUILayout.PropertyField(sound_Prop, new GUIContent("Sound")); break; case CustomEventDetails.CustomEventType.SetActive: EditorGUILayout.PropertyField(object0_Prop, new GUIContent("Game Object")); EditorGUILayout.PropertyField(bool0_Prop, new GUIContent("Set Active")); break; case CustomEventDetails.CustomEventType.ReceiveItem: EditorGUILayout.PropertyField(bool0_Prop, new GUIContent("Is TM")); string0_Prop.stringValue = EditorGUILayout.TextField(new GUIContent("Item"), string0_Prop.stringValue); if (!bool0_Prop.boolValue) { int0_Prop.intValue = EditorGUILayout.IntField(new GUIContent("Quantity"), int0_Prop.intValue); } break; case CustomEventDetails.CustomEventType.ReceivePokemon: ints_Prop.arraySize = 11; strings_Prop.arraySize = 8; int0_Prop.intValue = EditorGUILayout.IntField(new GUIContent("Jump To on Fail"), int0_Prop.intValue); EditorGUILayout.Space(); ints_Prop.GetArrayElementAtIndex(0).intValue = EditorGUILayout.IntField(new GUIContent("Pokemon ID"), ints_Prop.GetArrayElementAtIndex(0).intValue); // ToDO: change ints_Prop. var pkmn = GameController.Instance.PokemonDb.GetPokemonSpeciesByGameId(ints_Prop.GetArrayElementAtIndex(0).intValue.ToString()); string pokemonName = (pkmn != null) ? pkmn.Name : "null"; EditorGUILayout.LabelField(new GUIContent(" "), new GUIContent(pokemonName)); EditorGUILayout.Space(); strings_Prop.GetArrayElementAtIndex(0).stringValue = EditorGUILayout.TextField(new GUIContent("Nickname"), strings_Prop.GetArrayElementAtIndex(0).stringValue); ints_Prop.GetArrayElementAtIndex(1).intValue = EditorGUILayout.IntSlider(new GUIContent("Level"), ints_Prop.GetArrayElementAtIndex(1).intValue, 1, 100); //Gender if (pkmn != null) { if (pkmn.MaleRatio < 0) { EditorGUILayout.LabelField(new GUIContent("Gender"), new GUIContent("Genderless")); } else if (pkmn.MaleRatio == 0) { EditorGUILayout.LabelField(new GUIContent("Gender"), new GUIContent("Female")); } else if (pkmn.MaleRatio == 100) { EditorGUILayout.LabelField(new GUIContent("Gender"), new GUIContent("Male")); } else { //if not a set gender ints_Prop.GetArrayElementAtIndex(2).intValue = EditorGUILayout.Popup(new GUIContent("Gender"), ints_Prop.GetArrayElementAtIndex(2).intValue, new GUIContent[] { new GUIContent("Male"), new GUIContent("Female"), new GUIContent("Calculate") }); } } else { EditorGUILayout.LabelField(new GUIContent("Gender")); } EditorGUILayout.PropertyField(bool0_Prop, new GUIContent("Is Shiny")); var stringsArrayElementAt1 = strings_Prop.GetArrayElementAtIndex(1); stringsArrayElementAt1.stringValue = EditorGUILayout.TextField(new GUIContent("Original Trainer"), stringsArrayElementAt1.stringValue); var stringsArrayElementAt2 = strings_Prop.GetArrayElementAtIndex(2); stringsArrayElementAt2.stringValue = EditorGUILayout.TextField(new GUIContent("Poké Ball"), stringsArrayElementAt2.stringValue); var stringsArrayElementAt3 = strings_Prop.GetArrayElementAtIndex(3); stringsArrayElementAt3.stringValue = EditorGUILayout.TextField(new GUIContent("Held Item"), stringsArrayElementAt3.stringValue); //Nature string[] natureNames = PokemonNatureHelper.GetAllNatureNames(); GUIContent[] natures = new GUIContent[natureNames.Length + 1]; natures[0] = new GUIContent("Random"); for (int i = 0, iMax = natures.Length - 1; i != iMax; ++i) { string text = string.Format("{0}{1}\t | {2}+ | {3}-", natureNames[i][0], natureNames[i].Substring(1, natureNames[i].Length - 1).ToLower(), PokemonNatureHelper.GetUpgradedStat(i), PokemonNatureHelper.GetDowngradedStat(i)); natures[i + 1] = new GUIContent(text); } var intsArrayElementAt3 = ints_Prop.GetArrayElementAtIndex(3); intsArrayElementAt3.intValue = EditorGUILayout.Popup( new GUIContent("Nature"), ints_Prop.GetArrayElementAtIndex(3).intValue, natures); //Ability //if (pkmn != null) //{ // var intsArrayElementAt4 = ints_Prop.GetArrayElementAtIndex(4); // intsArrayElementAt4.intValue = EditorGUILayout.Popup(new GUIContent("Ability"), // intsArrayElementAt4.intValue, new GUIContent[] // { // new GUIContent("1: " + pkmn.getAbility(0)), new GUIContent("2: " + pkd.getAbility(1)), // new GUIContent("(HA) " + pkmn.getAbility(2)) // }); //} //else //{ // EditorGUILayout.LabelField(new GUIContent("Ability")); //} EditorGUILayout.Space(); EditorGUILayout.LabelField(new GUIContent("Custom Moveset"), new GUIContent("(Blanks will be default)")); EditorGUILayout.BeginHorizontal(); strings_Prop.GetArrayElementAtIndex(4).stringValue = EditorGUILayout.TextField(strings_Prop.GetArrayElementAtIndex(4).stringValue); strings_Prop.GetArrayElementAtIndex(5).stringValue = EditorGUILayout.TextField(strings_Prop.GetArrayElementAtIndex(5).stringValue); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); strings_Prop.GetArrayElementAtIndex(6).stringValue = EditorGUILayout.TextField(strings_Prop.GetArrayElementAtIndex(6).stringValue); strings_Prop.GetArrayElementAtIndex(7).stringValue = EditorGUILayout.TextField(strings_Prop.GetArrayElementAtIndex(7).stringValue); EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); string IVstring = (bool1_Prop.boolValue) ? "Using Custom IVs" : "Using Random IVs"; bool1_Prop.boolValue = EditorGUILayout.Foldout(bool1_Prop.boolValue, new GUIContent(IVstring)); if (bool1_Prop.boolValue) { ints_Prop.GetArrayElementAtIndex(5).intValue = EditorGUILayout.IntSlider(new GUIContent("HP"), ints_Prop.GetArrayElementAtIndex(5).intValue, 0, 31); ints_Prop.GetArrayElementAtIndex(6).intValue = EditorGUILayout.IntSlider(new GUIContent("ATK"), ints_Prop.GetArrayElementAtIndex(6).intValue, 0, 31); ints_Prop.GetArrayElementAtIndex(7).intValue = EditorGUILayout.IntSlider(new GUIContent("DEF"), ints_Prop.GetArrayElementAtIndex(7).intValue, 0, 31); ints_Prop.GetArrayElementAtIndex(8).intValue = EditorGUILayout.IntSlider(new GUIContent("SPA"), ints_Prop.GetArrayElementAtIndex(8).intValue, 0, 31); ints_Prop.GetArrayElementAtIndex(9).intValue = EditorGUILayout.IntSlider(new GUIContent("SPD"), ints_Prop.GetArrayElementAtIndex(9).intValue, 0, 31); ints_Prop.GetArrayElementAtIndex(10).intValue = EditorGUILayout.IntSlider(new GUIContent("SPE"), ints_Prop.GetArrayElementAtIndex(10).intValue, 0, 31); } break; case CustomEventDetails.CustomEventType.TrainerBattle: EditorGUILayout.PropertyField(object0_Prop, new GUIContent("Trainer Script")); EditorGUILayout.PropertyField(bool0_Prop, new GUIContent("Loss Allowed?")); if (bool0_Prop.boolValue) { int0_Prop.intValue = EditorGUILayout.IntField(new GUIContent("Jump To on Loss"), int0_Prop.intValue); } break; } /* Draw a line */ GUILayout.Box("", new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.Height(1) }); EditorGUILayout.Space(); }