void AddTrackMenu(object param) { KeyValuePair <Type, FEventAttribute> kvp = (KeyValuePair <Type, FEventAttribute>)param; Undo.RecordObjects(new UnityEngine.Object[] { Container, this }, "add Track"); FTrack track = (FTrack)typeof(FContainer).GetMethod("Add", new Type[] { typeof(FrameRange) }).MakeGenericMethod(kvp.Key).Invoke(Container, new object[] { SequenceEditor.ViewRange }); string evtName = track.gameObject.name; int nameStart = 0; int nameEnd = evtName.Length; if (nameEnd > 2 && evtName[0] == 'F' && char.IsUpper(evtName[1])) { nameStart = 1; } if (evtName.EndsWith("Event")) { nameEnd = evtName.Length - "Event".Length; } evtName = evtName.Substring(nameStart, nameEnd - nameStart); track.gameObject.name = ObjectNames.NicifyVariableName(evtName); SequenceEditor.Refresh(); Undo.RegisterCreatedObjectUndo(track.gameObject, string.Empty); SequenceEditor.SelectExclusive(SequenceEditor.GetEditor <FEventEditor>(track.GetEvent(0))); }
protected override void Init(FObject obj) { _track = (FTrack)obj; _eventEditors.Clear(); List <FEvent> events = _track.GetEvents(); for (int i = 0; i < events.Count; ++i) { FEvent evt = events[i]; FEventEditor evtEditor = SequenceEditor.GetEditor <FEventEditor>(evt); evtEditor.Init(evt, this); _eventEditors.Add(evtEditor); } }
public override void Init(FObject obj, FEditor owner) { base.Init(obj, owner); _eventEditors.Clear(); List <FEvent> events = Track.Events; for (int i = 0; i < events.Count; ++i) { FEvent evt = events[i]; FEventEditor evtEditor = SequenceEditor.GetEditor <FEventEditor>(evt); evtEditor.Init(evt, this); _eventEditors.Add(evtEditor); } }
public override void Init(FObject obj, FEditor owner) { base.Init(obj, owner); Editors.Clear(); List <FTrack> tracks = Container.Tracks; for (int i = 0; i < tracks.Count; ++i) { FTrack track = tracks[i]; FTrackEditor trackEditor = SequenceEditor.GetEditor <FTrackEditor>(track); trackEditor.Init(track, this); Editors.Add(trackEditor); } _icon = new GUIContent(FUtility.GetFluxTexture("Plus.png")); }
public override void Init(FObject obj, FEditor owner) { base.Init(obj, owner); Editors.Clear(); List <FTimeline> timelines = Container.Timelines; for (int i = 0; i < timelines.Count; ++i) { FTimeline timeline = timelines[i]; FTimelineEditor timelineEditor = SequenceEditor.GetEditor <FTimelineEditor>(timeline); timelineEditor.Init(timeline, this); Editors.Add(timelineEditor); } _icon = new GUIContent(FUtility.GetFluxTexture("Folder.png")); // _contentOffset = new Vector2(8, HeaderHeight); }
void AddTrackMenu(object param) { KeyValuePair <Type, FEventAttribute> kvp = (KeyValuePair <Type, FEventAttribute>)param; Undo.RecordObjects(new UnityEngine.Object[] { Container, this }, "add Track"); FTrack track = (FTrack)typeof(FContainer).GetMethod("Add", new Type[] { typeof(FrameRange) }).MakeGenericMethod(kvp.Key).Invoke(Container, new object[] { SequenceEditor.ViewRange }); //string evtName = track.gameObject.name; //int nameStart = 0; //int nameEnd = evtName.Length; //if (nameEnd > 2 && evtName[0] == 'F' && char.IsUpper(evtName[1])) // nameStart = 1; //if (evtName.EndsWith("Event")) // nameEnd = evtName.Length - "Event".Length; //evtName = evtName.Substring(nameStart, nameEnd - nameStart); string evtName = kvp.Value.menu; if (!string.IsNullOrEmpty(kvp.Value.menu)) { string[] nodes = kvp.Value.menu.Split("/".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); evtName = nodes[nodes.Length - 1]; } track.gameObject.name = ObjectNames.NicifyVariableName(evtName); if (!Container.Sequence.IsStopped) { track.Init(); } SequenceEditor.Refresh(); Undo.RegisterCreatedObjectUndo(track.gameObject, string.Empty); SequenceEditor.SelectExclusive(SequenceEditor.GetEditor <FEventEditor>(track.GetEvent(0))); }
public override void Init(FObject obj, FEditor owner) { bool initForFirstTime = Track == null; base.Init(obj, owner); _eventEditors.Clear(); List <FEvent> events = Track.Events; for (int i = 0; i < events.Count; ++i) { FEvent evt = events[i]; FEventEditor evtEditor = SequenceEditor.GetEditor <FEventEditor>(evt); evtEditor.Init(evt, this); _eventEditors.Add(evtEditor); } if (initForFirstTime && Track.PreviewDirtiesScene) { Track.CanPreview = false; } }