コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: AbstractSkillTrigger.cs プロジェクト: cnscj/THSTG
        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);