public override void OnInspectorGUI() { m_object.Update(); DrawDefaultInspector(); ChangeColor _changeColorScript = (ChangeColor)target; Texture2D icon = Resources.Load("2dxfxinspector") as Texture2D; if (icon) { Rect r; float ih = icon.height; float iw = icon.width; float result = ih / iw; float w = Screen.width; result = result * w; r = GUILayoutUtility.GetRect(ih, result); EditorGUI.DrawTextureTransparent(r, icon); } EditorGUILayout.PropertyField(m_object.FindProperty("ForceMaterial"), new GUIContent("Shared Material", "Use a unique material, reduce drastically the use of draw call")); if (_changeColorScript.ForceMaterial == null) { _changeColorScript.ActiveChange = true; } else { if (GUILayout.Button("Remove Shared Material")) { _changeColorScript.ForceMaterial = null; _changeColorScript.ShaderChange = 1; _changeColorScript.ActiveChange = true; _changeColorScript.CallUpdate(); } EditorGUILayout.PropertyField(m_object.FindProperty("ActiveChange"), new GUIContent("Change Material Property", "Change The Material Property")); } if (_changeColorScript.ActiveChange) { EditorGUILayout.BeginVertical("Box"); //EditorGUILayout.PropertyField (m_object.FindProperty("")); Texture2D icone = Resources.Load("2dxfx-icon-red") as Texture2D; EditorGUILayout.PropertyField(m_object.FindProperty("_TintColor"), new GUIContent("Tint Color Property", icone, "Change the color value")); icone = Resources.Load("2dxfx-icon-red") as Texture2D; EditorGUILayout.PropertyField(m_object.FindProperty("_ColorR"), new GUIContent("Red Property", icone, "Change the red value")); icone = Resources.Load("2dxfx-icon-green") as Texture2D; EditorGUILayout.PropertyField(m_object.FindProperty("_ColorG"), new GUIContent("Green Property", icone, "Change the green value")); icone = Resources.Load("2dxfx-icon-blue") as Texture2D; EditorGUILayout.PropertyField(m_object.FindProperty("_ColorB"), new GUIContent("Blue Property", icone, "Change the blue value")); EditorGUILayout.BeginVertical("Box"); icone = Resources.Load("2dxfx-icon-fade") as Texture2D; EditorGUILayout.PropertyField(m_object.FindProperty("_Alpha"), new GUIContent("Fading", icone, "Fade from nothing to showing")); EditorGUILayout.EndVertical(); EditorGUILayout.EndVertical(); } m_object.ApplyModifiedProperties(); }