public override void OnInspectorGUI() { if (SeeInspector.boolValue) // If true Default Inspector is drawn on screen { DrawDefaultInspector(); } serializedObject.Update(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("See Inspector :", GUILayout.Width(85)); EditorGUILayout.PropertyField(SeeInspector, new GUIContent(""), GUILayout.Width(30)); EditorGUILayout.EndHorizontal(); GUIStyle style_Yellow_01 = new GUIStyle(GUI.skin.box); style_Yellow_01.normal.background = Tex_01; GUIStyle style_Blue = new GUIStyle(GUI.skin.box); style_Blue.normal.background = Tex_03; GUIStyle style_Purple = new GUIStyle(GUI.skin.box); style_Purple.normal.background = Tex_04; GUIStyle style_Orange = new GUIStyle(GUI.skin.box); style_Orange.normal.background = Tex_05; GUIStyle style_Yellow_Strong = new GUIStyle(GUI.skin.box); style_Yellow_Strong.normal.background = Tex_02; GUILayout.Label(""); inventoryALLEntry myScript = (inventoryALLEntry)target; // --> Add a new Input in the list /*if (GUILayout.Button ("Add New Input", GUILayout.Width (120))) { * addNewInput(); * }*/ EditorGUILayout.BeginVertical(style_Orange); if (objCanvasInput) { EditorGUILayout.BeginHorizontal(); GUILayout.Label("Diary Button Keyboard : ", GUILayout.Width(150)); inventoryButtonDesktop.intValue = EditorGUILayout.Popup(inventoryButtonDesktop.intValue, s_inputListKeyboardButton.ToArray()); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Label("Diary Button Joystick : ", GUILayout.Width(150)); inventoryButtonJoystick.intValue = EditorGUILayout.Popup(inventoryButtonJoystick.intValue, s_inputListJoystickButton.ToArray()); EditorGUILayout.EndHorizontal(); } else { EditorGUILayout.HelpBox("INFO : The Object InputsManager needs to be activated in the the Hierarchy (Hierarchy : Canvas_MainMenu -> p_Inputs -> inputsManager", MessageType.Warning); } EditorGUILayout.EndVertical(); EditorGUILayout.LabelField(""); serializedObject.ApplyModifiedProperties(); }
//--> Display Inventory public void displayInventory() { if (_inventoryALLEntry == null) { _inventoryALLEntry = GameObject.Find("inventoryAllEntryManager").GetComponent <inventoryALLEntry>(); } _inventoryALLEntry.showInventory(true); }
void OnEnable() { // Setup the SerializedProperties. SeeInspector = serializedObject.FindProperty("SeeInspector"); inventoryButtonDesktop = serializedObject.FindProperty("inventoryButtonDesktop"); inventoryButtonJoystick = serializedObject.FindProperty("inventoryButtonJoystick"); inventoryALLEntry myScript = (inventoryALLEntry)target; GameObject tmp = GameObject.Find("InputsManager"); if (tmp) { objCanvasInput = tmp; for (var i = 0; i < tmp.GetComponent <MM_MenuInputs>().remapButtons[0].buttonsList.Count; i++) { s_inputListJoystickAxis.Add(tmp.GetComponent <MM_MenuInputs> ().remapButtons [0].buttonsList [i].name); } for (var i = 0; i < tmp.GetComponent <MM_MenuInputs>().remapButtons[1].buttonsList.Count; i++) { s_inputListJoystickButton.Add(tmp.GetComponent <MM_MenuInputs> ().remapButtons [1].buttonsList [i].name); } for (var i = 0; i < tmp.GetComponent <MM_MenuInputs>().remapButtons[2].buttonsList.Count; i++) { s_inputListKeyboardAxis.Add(tmp.GetComponent <MM_MenuInputs> ().remapButtons [2].buttonsList [i].name); } for (var i = 0; i < tmp.GetComponent <MM_MenuInputs>().remapButtons[3].buttonsList.Count; i++) { s_inputListKeyboardButton.Add(tmp.GetComponent <MM_MenuInputs> ().remapButtons [3].buttonsList [i].name); } } 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)); }