예제 #1
0
        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);
                }
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
        public virtual void Update(SkillTimelineContext context)
        {
            if (!Enabled)
            {
                return;
            }

            behaviour?.OnUpdate(context);
        }
예제 #4
0
        public virtual void End(SkillTimelineContext context)
        {
            IsExecuting = false;
            if (!Enabled)
            {
                return;
            }

            onEnd?.Invoke();
            behaviour?.OnEnd(context);
        }
예제 #5
0
        public virtual void Start(SkillTimelineContext context)
        {
            IsExecuting = true;
            if (!Enabled)
            {
                return;
            }

            onStart?.Invoke();
            behaviour?.OnStart(context);
        }
예제 #6
0
        public override void OnUpdate(SkillTimelineContext context)
        {
            if (_scheduleSequences == null || _scheduleSequences.Count <= 0)
            {
                return;
            }

            if (context.tick < 0)
            {
                return;
            }

            QuerySequencesUpdate(context);
            ExecuteSequencesUpdate(context);
            PurgeSequencesUpdate(context);
        }
예제 #7
0
        protected void PurgeSequencesUpdate(SkillTimelineContext context)
        {
            //检查是否结束
            if (_scheduledSequences != null)
            {
                while (_scheduledSequences.Count > 0)
                {
                    var sequence = _scheduledSequences.Dequeue();
                    DequeueSequenceInSchedulingList(sequence);
                }
            }

            if (_initSequences != null)
            {
                _initSequences.Clear();
            }
        }
예제 #8
0
        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);
                }
            }
        }
예제 #9
0
 public override void OnStart(SkillTimelineContext context)
 {
     Debug.Log(outStr);
 }