private bool IsEnableEvent(OnTrackEvent.EventType eventType, int frame) { switch (eventType) { case OnTrackEvent.EventType.EVENT_TIMELINE_ADDTACK: { foreach (var tackPoint in tackPoints) { if (tackPoint.ContainsFrame(frame)) { if (!tackPoint.IsExistTack) { return(true); } return(false); } } return(true); } case OnTrackEvent.EventType.EVENT_TIMELINE_DELETE: { return(true); } default: { // Debug.LogError("unhandled eventType IsEnableEvent:" + eventType); return(false); } } }
//右クリックメニューの可不可 bool IsEnableEvent(OnTrackEvent.EventType eventType) { int timelineType = 0; //既に存在する種類のタイムラインは作成できないように //各種タイムライン switch (eventType) { case OnTrackEvent.EventType.EVENT_SCORE_ADDTIMELINE_POS: timelineType = (int)TimelineType.TL_POS; break; case OnTrackEvent.EventType.EVENT_SCORE_ADDTIMELINE_TRANSFORM: timelineType = (int)TimelineType.TL_TRANSFORM; break; case OnTrackEvent.EventType.EVENT_SCORE_ADDTIMELINE_MOVE: timelineType = (int)TimelineType.TL_MOVE; break; //case OnTrackEvent.EventType.EVENT_SCORE_ADDTIMELINE_ATARI: // timelineType = (int)TimelineType.TL_ATARI; break; //case OnTrackEvent.EventType.EVENT_SCORE_ADDTIMELINE_HOLD: // timelineType = (int)TimelineType.TL_HOLD; break; //case OnTrackEvent.EventType.EVENT_SCORE_ADDTIMELINE_THROW: // timelineType = (int)TimelineType.TL_THROW; break; case OnTrackEvent.EventType.EVENT_SCORE_ADDTIMELINE_COLOR: timelineType = (int)TimelineType.TL_COLOR; break; case OnTrackEvent.EventType.EVENT_SCORE_ADDTIMELINE_EFFECT: timelineType = (int)TimelineType.TL_EFFECT; break; case OnTrackEvent.EventType.EVENT_SCORE_ADDTIMELINE_PASSIVE: timelineType = (int)TimelineType.TL_PASSIVE; break; } return(!GetActiveScore().timelineTracks_ .Where(t => t.IsExistTimeline_) .Where(t => t.timelineType_ == timelineType) .Any()); }
public OnTrackEvent(OnTrackEvent.EventType eventType, string activeObjectId, int frame = -1) { this.eventType = eventType; this.activeObjectId = activeObjectId; this.frame = frame; }