/// <summary> /// OnEnable. /// </summary> void OnEnable() { mScript = (MyImageStyleManager)target; mConfig = serializedObject.FindProperty("mConfig"); mIsAutoSaveOnChange = serializedObject.FindProperty("mIsAutoSaveOnChange"); x = serializedObject.FindProperty("x"); mScript.LoadConfig(); }
/// <summary> /// Create a template. /// </summary> public static void CreateTemplate() { GameObject obj = new GameObject(typeof(MyImageStyleManager).Name); MyImageStyleManager script = obj.AddComponent <MyImageStyleManager>(); script.LoadConfig(); EditorGUIUtility.PingObject(obj); Selection.activeGameObject = obj.gameObject; }