private void OnPlayChanged(PlayModeStateChange state) { if (state == PlayModeStateChange.ExitingEditMode || state == PlayModeStateChange.ExitingPlayMode || state == PlayModeStateChange.EnteredEditMode) { timeline?.Dispose(); timeline = null; CleanEnv(); if (window != null) { window.Dispose(); window.Repaint(); } } }
public override void OnInspectorGUI() { base.get_serializedObject().Update(); EditorGUI.BeginChangeCheck(); if (this.m_HasDrawer) { EditorGUILayout.PropertyField(this.m_ItemProperty, this.m_Label, new GUILayoutOption[0]); } else { EditorGUILayout.PropertyField(this.m_KeyProperty, new GUILayoutOption[0]); EditorGUILayout.PropertyField(this.m_TimeProperty, new GUILayoutOption[0]); } if (EditorGUI.EndChangeCheck()) { base.get_serializedObject().ApplyModifiedProperties(); TimelineWindow instance = TimelineWindow.instance; if (instance != null) { instance.Repaint(); if (instance.state != null) { instance.state.rebuildGraph = true; } } } }
internal override void OnHeaderTitleGUI(Rect titleRect, string header) { this.m_Name = base.get_serializedObject().FindProperty("m_Name"); base.get_serializedObject().Update(); Rect rect = titleRect; rect.set_height(16f); EditorGUI.BeginChangeCheck(); EditorGUI.set_showMixedValue(this.m_Name.get_hasMultipleDifferentValues()); TimelineWindow instance = TimelineWindow.instance; bool flag = instance == null || instance.state == null || instance.state.currentDirector == null; EditorGUI.BeginDisabledGroup(flag); EditorGUI.BeginChangeCheck(); string text = EditorGUI.DelayedTextField(rect, this.m_Name.get_stringValue(), EditorStyles.get_textField()); EditorGUI.set_showMixedValue(false); if (EditorGUI.EndChangeCheck() && !string.IsNullOrEmpty(text)) { for (int i = 0; i < base.get_targets().Count <Object>(); i++) { ObjectNames.SetNameSmart(base.get_targets()[i], text); } if (instance != null) { instance.Repaint(); } } EditorGUI.EndDisabledGroup(); base.get_serializedObject().ApplyModifiedProperties(); }
internal override void OnHeaderTitleGUI(Rect titleRect, string header) { serializedObject.Update(); Rect textFieldRect = titleRect; textFieldRect.height = 16f; EditorGUI.showMixedValue = m_Name.hasMultipleDifferentValues; TimelineWindow seqWindow = TimelineWindow.instance; EditorGUI.BeginChangeCheck(); string newName = EditorGUI.DelayedTextField(textFieldRect, m_Name.stringValue, EditorStyles.textField); EditorGUI.showMixedValue = false; if (EditorGUI.EndChangeCheck() && !string.IsNullOrEmpty(newName)) { for (int c = 0; c < targets.Length; c++) { ObjectNames.SetNameSmart(targets[c], newName); } if (seqWindow != null) { seqWindow.Repaint(); } } serializedObject.ApplyModifiedProperties(); }