protected virtual void OnEnable() { SplineUser user = (SplineUser)target; settingsFoldout = EditorPrefs.GetBool("Dreamteck.Splines.Editor.SplineUserEditor.settingsFoldout", false); rotationModifierEditor = new RotationModifierEditor(user, this, user.rotationModifier); offsetModifierEditor = new OffsetModifierEditor(user, this, user.offsetModifier); colorModifierEditor = new ColorModifierEditor(user, this, user.colorModifier); sizeModifierEditor = new SizeModifierEditor(user, this, user.sizeModifier); updateMethodProperty = serializedObject.FindProperty("updateMethod"); buildOnAwakeProperty = serializedObject.FindProperty("buildOnAwake"); buildOnEnableProperty = serializedObject.FindProperty("buildOnEnable"); multithreadedProperty = serializedObject.FindProperty("multithreaded"); autoUpdateProperty = serializedObject.FindProperty("_autoUpdate"); loopSamplesProperty = serializedObject.FindProperty("_loopSamples"); clipFromProperty = serializedObject.FindProperty("_clipFrom"); clipToProperty = serializedObject.FindProperty("_clipTo"); spline = serializedObject.FindProperty("_spline"); users = new SplineUser[targets.Length]; for (int i = 0; i < users.Length; i++) { users[i] = (SplineUser)targets[i]; if (users[i].isActiveAndEnabled) { user.EditorAwake(); } } Undo.undoRedoPerformed += OnUndoRedo; }
protected virtual void OnEnable() { SplineUser user = (SplineUser)target; user.EditorAwake(); rotationModifierEditor = new RotationModifierEditor(user, this, user.rotationModifier); offsetModifierEditor = new OffsetModifierEditor(user, this, user.offsetModifier); colorModifierEditor = new ColorModifierEditor(user, this, user.colorModifier); sizeModifierEditor = new SizeModifierEditor(user, this, user.sizeModifier); users = new SplineUser[targets.Length]; for (int i = 0; i < users.Length; i++) { users[i] = (SplineUser)targets[i]; } Undo.undoRedoPerformed += OnUndoRedo; }
protected virtual void OnEnable() { SplineUser user = (SplineUser)target; user.EditorAwake(); settingsFoldout = EditorPrefs.GetBool("Dreamteck.Splines.Editor.SplineUserEditor.settingsFoldout", false); rotationModifierEditor = new RotationModifierEditor(user, this, user.rotationModifier); offsetModifierEditor = new OffsetModifierEditor(user, this, user.offsetModifier); colorModifierEditor = new ColorModifierEditor(user, this, user.colorModifier); sizeModifierEditor = new SizeModifierEditor(user, this, user.sizeModifier); users = new SplineUser[targets.Length]; for (int i = 0; i < users.Length; i++) { users[i] = (SplineUser)targets[i]; } Undo.undoRedoPerformed += OnUndoRedo; }