public new void OnPlayableCreate(Playable playable)
        {
            if (clip == null)
            {
                return;
            }

            var triggerFactor = SkillTriggerManager.GetInstance().GetFactory(clip.type);

            if (triggerFactor != null)
            {
                _trigger = triggerFactor.CreateTrigger();
                _trigger?.Initialize(null, clip.args);
            }
        }
        public override void OnPlayableDestroy(Playable playable)
        {
            if (clip == null)
            {
                return;
            }

            var triggerFactor = SkillTriggerManager.GetInstance().GetFactory(clip.type);

            if (triggerFactor != null)
            {
                _trigger?.Dispose();
                triggerFactor.RecycleTrigger(_trigger);
                _trigger = null;
            }
        }
        private string[] GetDescList()
        {
            //:貌似不是很友好
            string[] descList = null;
            //根据type实例化一个clip,然后获取相应数据
            var triggerFactor = SkillTriggerManager.GetInstance().GetFactory(m_target.type);

            if (triggerFactor != null)
            {
                var trigger = triggerFactor.CreateTrigger();
                if (trigger != null)
                {
                    descList = trigger.ArgsDesc;
                }
                triggerFactor.RecycleTrigger(trigger);
            }
            return(descList);
        }
Exemple #4
0
        public static AbstractSkillTrigger Create(SkillTimelineAsset asset)
        {
            var triggerFactor = SkillTriggerManager.GetInstance().GetFactory(asset.type);

            if (triggerFactor != null)
            {
                var trigger = triggerFactor.CreateTrigger();
                if (trigger != null)
                {
                    trigger.name = asset.name;
                    trigger.type = asset.type;

                    trigger.startTime    = asset.startTime;
                    trigger.durationTime = asset.durationTime;

                    trigger.Initialize(null, asset.args);
                    return(trigger);
                }
            }
            return(default);