private void Awake()
 {
     componentEditorid = CountComponentEditorid++;
     ContentLabel      = new Rect((componentEditorid * 150) + 30, 0, 150, 60);
     ContentColapse    = new Rect(0, 0, 30, 60);
     ContentGroup      = new Rect(0, 60, Screen.width, Screen.height);
     setting           = ComponentLiveEditorSettings.Load();
     setting.testGUIskin.box.fixedWidth = Screen.width - 15;
 }
Пример #2
0
        /// <summary>
        /// load the Settings ScriptableObject
        /// </summary>
        /// <returns></returns>
        public static ComponentLiveEditorSettings Load()
        {
            if (Instance == null)
            {
                var t = Resources.Load <ComponentLiveEditorSettings>("ComponentLiveEditorSettings");

                if (t == null)
                {
                    Debug.Log("Could not find ComponentLiveEditorSettings asset. Will use default settings instead.");

                    Instance = ScriptableObject.CreateInstance <ComponentLiveEditorSettings>();
                }
                else
                {
                    Instance = t;
                }
            }
            return(Instance);
        }
        override public void OnInspectorGUI()
        {
            serializedObject.Update();

            new_SelectedMonoBehaviorIndex = EditorGUILayout.Popup("MonoBehavior", selectedMonoBehaviorIndex, MonoBehaviorListLabel);
            if (new_SelectedMonoBehaviorIndex != selectedMonoBehaviorIndex)
            {
                onMonoBehaviorChanged(MonoBehaviorsList[new_SelectedMonoBehaviorIndex]);
                selectedMonoBehaviorIndex = new_SelectedMonoBehaviorIndex;
            }

            if (GUILayout.Button(SettingsLabel))
            {
                Selection.activeObject = ComponentLiveEditorSettings.Load();
            }
            ;

            serializedObject.ApplyModifiedProperties();
        }