コード例 #1
0
        //[MenuItem("Window/TimeFlowShiki")]
        public static ARIMotionScoreWindow ShowEditor(ARIMotionMainWindow parent)
        {
            ARIMotionScoreWindow window = EditorWindow.GetWindow <ARIMotionScoreWindow>();

            window.parent_ = parent;
            window.scores_ = parent.scores_;
            window.Show();
            return(window);
        }
コード例 #2
0
ファイル: ScoreComponent.cs プロジェクト: ishidafuu/ecs_nkkd
 public void SelectPreviousTackOfTimelines(string currentActiveObjectId)
 {
     if (ARIMotionScoreWindow.IsTackId(currentActiveObjectId))
     {
         foreach (var timelineTrack in timelineTracks_)
         {
             timelineTrack.SelectPreviousTackOf(currentActiveObjectId);
         }
     }
 }
コード例 #3
0
 //エディタウインドウ開く
 void OpenEditorWindow()
 {
     if (scoreWindow_ == null)
     {
         scoreWindow_ = ARIMotionScoreWindow.ShowEditor(this);
         ARIMotionScoreWindow.ParentEmit = Emit;
     }
     else
     {
         scoreWindow_.Focus();
     }
 }
コード例 #4
0
ファイル: ScoreComponent.cs プロジェクト: ishidafuu/ecs_nkkd
 public void DeleteObjectById(string deletedObjectId, bool isCancel)
 {
     foreach (var timelineTrack in timelineTracks_)
     {
         if (ARIMotionScoreWindow.IsTimelineId(deletedObjectId))
         {
             if (timelineTrack.timelineId_ == deletedObjectId)
             {
                 timelineTrack.Deleted(isCancel);
             }
         }
         if (ARIMotionScoreWindow.IsTackId(deletedObjectId))
         {
             timelineTrack.DeleteTackById(deletedObjectId, isCancel);
         }
     }
 }
コード例 #5
0
ファイル: ScoreComponent.cs プロジェクト: ishidafuu/ecs_nkkd
        public void SelectAboveObjectById(string currentActiveObjectId)
        {
            if (ARIMotionScoreWindow.IsTimelineId(currentActiveObjectId))
            {
                var candidateTimelines   = timelineTracks_.Where(timeline => timeline.IsExistTimeline_).OrderBy(timeline => timeline.GetIndex()).ToList();
                var currentTimelineIndex = candidateTimelines.FindIndex(timeline => timeline.timelineId_ == currentActiveObjectId);

                if (0 < currentTimelineIndex)
                {
                    var targetTimeline = timelineTracks_[currentTimelineIndex - 1];
                    Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, targetTimeline.timelineId_));
                    return;
                }

                return;
            }

            if (ARIMotionScoreWindow.IsTackId(currentActiveObjectId))
            {
                /*
                 *      select another timeline's same position tack.
                 */
                var currentActiveTack = TackById(currentActiveObjectId);

                var currentActiveTackStart = currentActiveTack.start_;
                var currentTimelineId      = currentActiveTack.parentTimelineId_;

                var aboveTimeline = AboveTimeline(currentTimelineId);
                if (aboveTimeline != null)
                {
                    var nextActiveTacks = aboveTimeline.TacksByStart(currentActiveTackStart);
                    if (nextActiveTacks.Any())
                    {
                        var targetTack = nextActiveTacks[0];
                        Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, targetTack.tackId_));
                    }
                    else
                    {
                        // no tack found, select timeline itself.
                        Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, aboveTimeline.timelineId_));
                    }
                }
                return;
            }
        }
コード例 #6
0
ファイル: ScoreComponent.cs プロジェクト: ishidafuu/ecs_nkkd
        public TackPoint GetTackById(string selectObjectId)
        {
            TackPoint res = null;

            foreach (var timelineTrack in timelineTracks_)
            {
                if (ARIMotionScoreWindow.IsTackId(selectObjectId))
                {
                    res = timelineTrack.GetTackById(selectObjectId);
                    //見つかったら抜けないとNULLで上書きしてしまう
                    if (res != null)
                    {
                        break;
                    }
                }
            }

            return(res);
        }
コード例 #7
0
ファイル: ScoreComponent.cs プロジェクト: ishidafuu/ecs_nkkd
        public void SelectBelowObjectById(string currentActiveObjectId)
        {
            if (ARIMotionScoreWindow.IsTimelineId(currentActiveObjectId))
            {
                var cursoredTimelineIndex = timelineTracks_.FindIndex(timeline => timeline.timelineId_ == currentActiveObjectId);
                if (cursoredTimelineIndex < timelineTracks_.Count - 1)
                {
                    var targetTimelineIndex = cursoredTimelineIndex + 1;
                    var targetTimeline      = timelineTracks_[targetTimelineIndex];
                    Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, targetTimeline.timelineId_));
                }
                return;
            }

            if (ARIMotionScoreWindow.IsTackId(currentActiveObjectId))
            {
                /*
                 *      select another timeline's same position tack.
                 */
                var currentActiveTack = TackById(currentActiveObjectId);

                var currentActiveTackStart = currentActiveTack.start_;
                var currentTimelineId      = currentActiveTack.parentTimelineId_;

                var belowTimeline = BelowTimeline(currentTimelineId);
                if (belowTimeline != null)
                {
                    var nextActiveTacks = belowTimeline.TacksByStart(currentActiveTackStart);
                    if (nextActiveTacks.Any())
                    {
                        var targetTack = nextActiveTacks[0];
                        Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, targetTack.tackId_));
                    }
                    else
                    {
                        // no tack found, select timeline itself.
                        Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, belowTimeline.timelineId_));
                    }
                }
                return;
            }
        }
コード例 #8
0
ファイル: ScoreComponent.cs プロジェクト: ishidafuu/ecs_nkkd
        public int GetStartFrameById(string objectId)
        {
            if (ARIMotionScoreWindow.IsTimelineId(objectId))
            {
                return(-1);
            }

            if (ARIMotionScoreWindow.IsTackId(objectId))
            {
                var targetContainedTimelineIndex = GetTackContainedTimelineIndex(objectId);
                if (0 <= targetContainedTimelineIndex)
                {
                    var foundStartFrame = timelineTracks_[targetContainedTimelineIndex].GetStartFrameById(objectId);
                    if (0 <= foundStartFrame)
                    {
                        return(foundStartFrame);
                    }
                }
            }

            return(-1);
        }
コード例 #9
0
ファイル: ScoreComponent.cs プロジェクト: ishidafuu/ecs_nkkd
        public void SelectNextTackOfTimelines(string currentActiveObjectId)
        {
            if (ARIMotionScoreWindow.IsTimelineId(currentActiveObjectId))
            {
                foreach (var timelineTrack in timelineTracks_)
                {
                    if (timelineTrack.timelineId_ == currentActiveObjectId)
                    {
                        timelineTrack.SelectDefaultTackOrSelectTimeline();
                    }
                }
                return;
            }

            if (ARIMotionScoreWindow.IsTackId(currentActiveObjectId))
            {
                foreach (var timelineTrack in timelineTracks_)
                {
                    timelineTrack.SelectNextTackOf(currentActiveObjectId);
                }
            }
        }