Exemplo n.º 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);
                }
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        public virtual void Update(SkillTimelineContext context)
        {
            if (!Enabled)
            {
                return;
            }

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

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

            onStart?.Invoke();
            behaviour?.OnStart(context);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 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);
                }
            }
        }
Exemplo n.º 9
0
 public override void OnStart(SkillTimelineContext context)
 {
     Debug.Log(outStr);
 }