public void Init(string title, IEditorWindow editorWindow, string editorPrefsTag,
                                 Type[] allowedTypes, StateMachineEditorStyle style,
                                 TimelineScrollArea.eTimeFormat timeFormat = TimelineScrollArea.eTimeFormat.Default)
                {
                    _title                    = title;
                    _editorPrefsTag           = editorPrefsTag;
                    _allowedEvents            = allowedTypes;
                    _style                    = style;
                    _timelineEditorTimeFormat = timeFormat;

                    string editorPrefsText = ProjectEditorPrefs.GetString(_editorPrefsTag, "");

                    try
                    {
                        _editorPrefs = Serializer.FromString <StateMachineEditorPrefs>(editorPrefsText);
                    }
                    catch
                    {
                        _editorPrefs = null;
                    }

                    if (_editorPrefs == null)
                    {
                        _editorPrefs = new StateMachineEditorPrefs();
                    }

                    SetEditorWindow(editorWindow);
                    CreateViews();
                }
                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();
                }
Esempio n. 3
0
 public void Init(IEditor parent, TimelineScrollArea.eTimeFormat timeFormat)
 {
     _timelineArea   = new TimelineScrollArea(timeFormat);
     _visiblePadding = timeFormat == TimelineScrollArea.eTimeFormat.Default ? 5.0f : 60.0f * 60.0f;
     SetEditorWindow(parent);
 }