public override void OnInspectorGUI() { base.OnInspectorGUI(); EditorGUILayout.BeginVertical("box"); GUILayout.Label("'Save your created item types upon editing the ItemTypes list in the Inventory System'"); EditorGUILayout.Space(); filePath = EditorGUILayout.TextField("Path", filePath); fileItemTypesName = EditorGUILayout.TextField("Name", fileItemTypesName); fileEquipmentTypesName = EditorGUILayout.TextField("Name", fileEquipmentTypesName); EditorGUILayout.Space(); if (GUILayout.Button("Save Item Types")) { EditorMethods.WriteToEnum(filePath, fileItemTypesName, inventorySystem.itemTypes); } if (GUILayout.Button("Save Equipment Types")) { EditorMethods.WriteToEnum(filePath, fileEquipmentTypesName, inventorySystem.equipmentTypes); } EditorGUILayout.EndVertical(); }
private bool b_addMethods = false; // use when you press button + // Display a list of custom method in the custom editor public void displayMethodList(string _Title, EditorMethods editorMethods, SerializedProperty _methods, List <EditorMethodsList.MethodsList> myScriptMethods, GUIStyle style_Color01, GUIStyle style_Color02, string helpBoxText) { #region //-> Custom methods EditorGUILayout.BeginVertical(style_Color01); EditorGUILayout.BeginHorizontal(); GUILayout.Label(_Title, EditorStyles.boldLabel); EditorGUILayout.EndHorizontal(); EditorGUILayout.HelpBox(helpBoxText, MessageType.Info); if (GUILayout.Button("+", GUILayout.Width(30))) { b_addMethods = true; } editorMethods.DisplayMethodsOnEditor(myScriptMethods, _methods, style_Color02); if (b_addMethods) { editorMethods.AddMethodsToList(_methods); b_addMethods = false; } EditorGUILayout.EndVertical(); #endregion }
void OnEnable() { // Setup the SerializedProperties. //SeeInspector = serializedObject.FindProperty ("SeeInspector"); /* feedbackIDList = serializedObject.FindProperty("feedbackIDList"); * b_feedbackActivated = serializedObject.FindProperty("b_feedbackActivated"); * * * b_VoiceOverActivated = serializedObject.FindProperty("b_VoiceOverActivated"); * diaryIDList = serializedObject.FindProperty("diaryIDList"); */ methodsList = serializedObject.FindProperty("methodsList"); methodsListObjDeactivated = serializedObject.FindProperty("methodsListObjDeactivated"); methodsListSaveExtend = serializedObject.FindProperty("methodsListSaveExtend"); methodsListSaveExtendLoadProcess = serializedObject.FindProperty("methodsListSaveExtendLoadProcess"); editorMethods = new EditorMethods(); methodModule = new AP_MethodModule(); Tex_01 = MakeTex(2, 2, new Color(1, .8f, 0.2F, .4f)); Tex_02 = MakeTex(2, 2, new Color(1, .8f, 0.2F, .4f)); Tex_03 = MakeTex(2, 2, new Color(.3F, .9f, 1, .5f)); Tex_04 = MakeTex(2, 2, new Color(.88F, .88f, .88f, 1f)); Tex_05 = MakeTex(2, 2, new Color(1, .5f, 0.3F, .4f)); }
void OnEnable() { // Setup the SerializedProperties. SeeInspector = serializedObject.FindProperty("SeeInspector"); TriggerType = serializedObject.FindProperty("TriggerType"); playOnce = serializedObject.FindProperty("playOnce"); playOnlyIfNoOtherVoiceOverIsPlayed = serializedObject.FindProperty("playOnlyIfNoOtherVoiceOverIsPlayed"); b_DisabledPlayerMovement = serializedObject.FindProperty("b_DisabledPlayerMovement"); DisabledMovementTimer = serializedObject.FindProperty("DisabledMovementTimer"); BuildInSceneIndex = serializedObject.FindProperty("BuildInSceneIndex"); spawnPointName = serializedObject.FindProperty("spawnPointName"); TriggerManager myScript = (TriggerManager)target; editorMethods = new EditorMethods(); methodsList = serializedObject.FindProperty("methodsList"); Tex_01 = MakeTex(2, 2, new Color(1, .8f, 0.2F, .4f)); Tex_02 = MakeTex(2, 2, new Color(1, .8f, 0.2F, .4f)); Tex_03 = MakeTex(2, 2, new Color(.3F, .9f, 1, .5f)); Tex_04 = MakeTex(2, 2, new Color(1, .3f, 1, .3f)); Tex_05 = MakeTex(2, 2, new Color(1, .5f, 0.3F, .4f)); }
//private Texture2D Tex_05; void OnEnable() { // Setup the SerializedProperties. SeeInspector = serializedObject.FindProperty("SeeInspector"); onlyFocusMode = serializedObject.FindProperty("onlyFocusMode"); b_feedbackActivated = serializedObject.FindProperty("b_feedbackActivated"); feedbackIDList = serializedObject.FindProperty("feedbackIDList"); conditionsToAccessThePuzzle myScript = (conditionsToAccessThePuzzle)target; editorMethods = new EditorMethods(); methodsList = serializedObject.FindProperty("methodsList"); inventoryIDList = serializedObject.FindProperty("inventoryIDList"); Tex_01 = MakeTex(2, 2, new Color(1, .8f, 0.2F, .4f)); Tex_02 = MakeTex(2, 2, new Color(1, .8f, 0.2F, .4f)); Tex_04 = MakeTex(2, 2, new Color(1, .8f, 0.2F, .2f)); }
void OnEnable() { // Setup the SerializedProperties. SeeInspector = serializedObject.FindProperty("SeeInspector"); remapButtons = serializedObject.FindProperty("remapButtons"); b_PC = serializedObject.FindProperty("b_PC"); boolValues = serializedObject.FindProperty("boolValues"); floatValues = serializedObject.FindProperty("floatValues"); editorMethods = new EditorMethods(); Tex_01 = MakeTex(2, 2, new Color(1, .8f, 0.2F, .4f)); Tex_02 = MakeTex(2, 2, new Color(1, .8f, 0.2F, .4f)); Tex_03 = MakeTex(2, 2, new Color(.3F, .9f, 1, .5f)); Tex_04 = MakeTex(2, 2, new Color(1, .3f, 1, .3f)); Tex_05 = MakeTex(2, 2, new Color(1, .5f, 0.3F, .4f)); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); if (GUILayout.Button("Save")) { EditorMethods.WriteToEnum(filePath, fileName, _myScrip.eventEnums); } if (GUILayout.Button("Update")) { var narrativeEnums = new List <string>(); foreach (var beat in Enum.GetNames(typeof(MainNarrativeBeats))) { narrativeEnums.Add(beat); } _myScrip.eventEnums = narrativeEnums; } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); if (GUILayout.Button("Save")) { EditorMethods.WriteToEnum(filePath, fileName, npcStatsGenerator.stats); } int max = npcStatsGenerator.GetStatPoints(); int i = 0; foreach (string stat in npcStatsGenerator.stats) { if (npcStatsGenerator.statMinConstraints.ElementAtOrDefault(i).Name != null) { StatConstraint scMin = npcStatsGenerator.statMinConstraints[i]; scMin.Value = EditorGUILayout.IntField(stat + " Min", scMin.Value); npcStatsGenerator.statMinConstraints[i] = scMin; } else { StatConstraint statConstraint = new StatConstraint(stat + "Min", 0); npcStatsGenerator.statMinConstraints.Add(statConstraint); } if (npcStatsGenerator.statMaxConstraints.ElementAtOrDefault(i).Name != null) { StatConstraint scMax = npcStatsGenerator.statMaxConstraints[i]; scMax.Value = EditorGUILayout.IntField(stat + " Max", scMax.Value); npcStatsGenerator.statMaxConstraints[i] = scMax; } else { StatConstraint statConstraint = new StatConstraint(stat + "Max", max); npcStatsGenerator.statMaxConstraints.Add(statConstraint); } ++i; } }
void OnEnable() { // Setup the SerializedProperties. SeeInspector = serializedObject.FindProperty("SeeInspector"); onlyFocusMode = serializedObject.FindProperty("onlyFocusMode"); actionsWhenPuzzleIsSolved myScript = (actionsWhenPuzzleIsSolved)target; editorMethods = new EditorMethods(); methodsList = serializedObject.FindProperty("methodsList"); listOfEvent = serializedObject.FindProperty("listOfEvent"); a_puzzleSolved = serializedObject.FindProperty("a_puzzleSolved"); a_puzzleSolvedVolume = serializedObject.FindProperty("a_puzzleSolvedVolume"); objectActivatedWhenPuzzleIsSolved = serializedObject.FindProperty("objectActivatedWhenPuzzleIsSolved"); Tex_01 = MakeTex(2, 2, new Color(1, .8f, 0.2F, .4f)); Tex_02 = MakeTex(2, 2, new Color(1, .8f, 0.2F, .4f)); Tex_03 = MakeTex(2, 2, new Color(.3F, .9f, 1, .6f)); Tex_04 = MakeTex(2, 2, new Color(1, .3f, 1, .3f)); Tex_05 = MakeTex(2, 2, new Color(.3F, .9f, 1, .3f)); }
void OnEnable() { // Setup the SerializedProperties. SeeInspector = serializedObject.FindProperty("SeeInspector"); methodsList = serializedObject.FindProperty("methodsList"); moreOptions = serializedObject.FindProperty("moreOptions"); //b_isObjectActivated = serializedObject.FindProperty ("moreOptions"); //isObjectActivatedIndex = serializedObject.FindProperty ("isObjectActivatedIndex"); editorMethods = new EditorMethods(); callMethods = new CallMethods(); _manipulateSave = new manipulateSave(); Tex_01 = MakeTex(2, 2, new Color(.9f, .9f, 0.9F, 1f)); Tex_02 = MakeTex(2, 2, new Color(1, .8f, 0.2F, .4f)); Tex_03 = MakeTex(2, 2, new Color(.3F, .9f, 1, .5f)); Tex_04 = MakeTex(2, 2, new Color(1, .3f, 1, .3f)); Tex_05 = MakeTex(2, 2, new Color(1, .5f, 0.3F, .4f)); SaveData myScript = (SaveData)target; if (methodsList.arraySize == 0) { serializedObject.Update(); editorMethods.AddMethodsToList(methodsList); methodsList.GetArrayElementAtIndex(0).FindPropertyRelative("obj").objectReferenceValue = myScript.gameObject; methodsList.GetArrayElementAtIndex(0).FindPropertyRelative("methodInfoName").stringValue = "ReturnSaveData"; serializedObject.ApplyModifiedProperties(); myScript.methodsList[0].indexScript = myScript.methodsList[0].obj.GetComponents <MonoBehaviour> ().Length; } }