protected void ExecuteSequencesUpdate(SkillTimelineContext context) { //持续执行 if (_schedulingSequences == null || _schedulingSequences.Count <= 0) { return; } foreach (var sequence in _schedulingSequences) { var tickFrame = context.tick - StartFrame;; if (_initSequences != null && _initSequences.Contains(sequence)) { sequence.Start(context); } if (tickFrame <= sequence.EndFrame) { sequence.Update(context);//每帧执行 } //检查结束 if (tickFrame >= sequence.EndFrame) { GetScheduledSequenceList().Enqueue(sequence); sequence.End(context); } } }
public override void OnStart(SkillTimelineContext context) { var go = context.owner as GameObject; // string resPath = string.Format("Assets/ZCustom_Test/Res/Effects/Prefabs/{0}.prefab", effectId); // var prefab = AssetDatabase.LoadAssetAtPath<GameObject>(resPath); // Object.Instantiate(prefab, go.transform); }
public virtual void Update(SkillTimelineContext context) { if (!Enabled) { return; } behaviour?.OnUpdate(context); }
public virtual void End(SkillTimelineContext context) { IsExecuting = false; if (!Enabled) { return; } onEnd?.Invoke(); behaviour?.OnEnd(context); }
public virtual void Start(SkillTimelineContext context) { IsExecuting = true; if (!Enabled) { return; } onStart?.Invoke(); behaviour?.OnStart(context); }
public override void OnUpdate(SkillTimelineContext context) { if (_scheduleSequences == null || _scheduleSequences.Count <= 0) { return; } if (context.tick < 0) { return; } QuerySequencesUpdate(context); ExecuteSequencesUpdate(context); PurgeSequencesUpdate(context); }
protected void PurgeSequencesUpdate(SkillTimelineContext context) { //检查是否结束 if (_scheduledSequences != null) { while (_scheduledSequences.Count > 0) { var sequence = _scheduledSequences.Dequeue(); DequeueSequenceInSchedulingList(sequence); } } if (_initSequences != null) { _initSequences.Clear(); } }
protected void QuerySequencesUpdate(SkillTimelineContext context) { //帧列表 if (_scheduleSequences == null || _scheduleSequences.Count <= 0) { return; } var tickFrame = context.tick - StartFrame; if (_scheduleSequences.TryGetValue(tickFrame, out var sequenceList)) { //扔进执行表执行 foreach (var sequence in sequenceList) { GetInitSequenceList().Add(sequence); PushSequenceInSchedulingList(sequence); } } }
public override void OnStart(SkillTimelineContext context) { Debug.Log(outStr); }