private void CreateEditor() { if (_stateMachineEditor == null || _stateMachineEditor.GetEditorWindow() == null) { TimelineStateMachineEditorStyle style = new TimelineStateMachineEditorStyle(); style._defaultStateColor = new Color(61f / 255f, 154f / 255f, 92f / 255f); style._linkColor = Color.white; _stateMachineEditor = TimelineStateMachineEditor.CreateInstance <TimelineStateMachineEditor>(); _stateMachineEditor.Init(kWindowTitle, this, kWindowTag, SystemUtils.GetAllSubTypes(typeof(IStateMachineEvent)), style); } }
public void Init(string title, IEditorWindow editorWindow, string editorPrefsTag, Type[] allowedTypes, TimelineStateMachineEditorStyle style, TimelineScrollArea.eTimeFormat timeFormat = TimelineScrollArea.eTimeFormat.Seconds) { _title = title; _editorPrefsTag = editorPrefsTag; _allowedEvents = allowedTypes; _style = style; _timeFormat = timeFormat; string editorPrefsText = EditorPrefs.GetString(_editorPrefsTag, ""); _editorPrefs = SerializeConverter.FromString <TimelineStateMachineEditorPrefs>(editorPrefsText); if (_editorPrefs == null) { _editorPrefs = new TimelineStateMachineEditorPrefs(); } SetEditorWindow(editorWindow); CreateViews(); }