Esempio n. 1
0
        private void OnAddTrackItem(object arg)
        {
            Type type = (Type)arg;

            EditorFactory.GetTrackByDataType(type, state.seqence, null, (track, data, param) =>
            {
                if (track != null && data != null)
                {
                    tree.AddTrack(track, param);
                    state.seqence.AddRootTrack(track);
                }
            });
        }
Esempio n. 2
0
        private void Add(XTrack track, IList <EditorTrack> list)
        {
            EditorTrack etrack = EditorFactory.GetTrack(track);
            float       y      = _y + WindowConstants.RawHeight * track_idx + WindowConstants.rowGap * track_idx;
            int         offset = track.parent ? 10 : 0;
            var         rect   = new Rect(x, y, width, WindowConstants.RawHeight);
            var         head   = new Rect(offset, y, WindowConstants.sliderWidth - offset, WindowConstants.RawHeight);

            etrack.SetRect(head, rect);
            track_idx++;
            list.Add(etrack);
            if (track.childs != null)
            {
                for (int i = 0; i < track.childs.Length; i++)
                {
                    Add(track.childs[i], list);
                }
            }
        }
Esempio n. 3
0
        private void OnAddTrackItem(object arg)
        {
            Type type  = (Type)arg;
            var  state = SeqenceWindow.inst.state;

            EditorFactory.GetTrackByDataType(type, state.seqence, track, (tr, data, param) =>
            {
                if (tr != null && data != null)
                {
                    var tmp = track;
                    if (track.childs?.Length > 0)
                    {
                        tmp = track.childs.Last();
                    }
                    tr.parent.AddSub(tr);
                    tr.parent.AddTrackChildData(data);
                    int idx = SeqenceWindow.inst.tree.IndexOfTrack(tmp);
                    SeqenceWindow.inst.tree.AddTrack(tr, idx + 1, param);
                }
            });
        }