示例#1
0
        public override void Awake(object initData)
        {
            base.Awake(initData);

            SkillExecutionAsset = Resources.Load <GameObject>($"Skill_{this.SkillAbility.SkillConfig.Id}_Execution");

            if (SkillExecutionAsset == null)
            {
                return;
            }
            var timelineAsset = SkillExecutionAsset.GetComponent <PlayableDirector>().playableAsset as TimelineAsset;

            if (timelineAsset == null)
            {
                return;
            }

            var markers = timelineAsset.markerTrack.GetMarkers();

            foreach (var item in markers)
            {
                if (item is ColliderSpawnEmitter colliderSpawnEmitter)
                {
                    ColliderSpawnDatas.Add(new ColliderSpawnData()
                    {
                        ColliderSpawnEmitter = colliderSpawnEmitter
                    });
                }
            }

            var rootTracks = timelineAsset.GetRootTracks();

            foreach (var item in rootTracks)
            {
                if (item.hasClips)
                {
                    var clips = item.GetClips();
                    foreach (var clip in clips)
                    {
                        if (clip.animationClip != null)
                        {
                            var animationData = new AnimationData();
                            animationData.StartTime     = (float)clip.clipIn;
                            animationData.Duration      = (float)clip.duration;
                            animationData.EndTime       = animationData.StartTime + animationData.Duration;
                            animationData.AnimationClip = clip.animationClip;
                            AnimationDatas.Add(animationData);
                        }
                    }
                }
            }

            OriginTime = ET.TimeHelper.Now();
        }
示例#2
0
        public override void BeginExecute()
        {
            GetParent <CombatEntity>().CurrentSkillExecution = this;
            SkillAbility.Spelling = true;

            if (SkillExecutionAsset == null)
            {
                return;
            }
            var timelineAsset = SkillExecutionAsset.GetComponent <PlayableDirector>().playableAsset as TimelineAsset;

            if (timelineAsset == null)
            {
                return;
            }
            var skillExecutionObj = GameObject.Instantiate(SkillExecutionAsset, Hero.Instance.transform.position, Hero.Instance.transform.GetChild(0).rotation);

            GameObject.Destroy(skillExecutionObj, (float)timelineAsset.duration);
            base.BeginExecute();
        }
示例#3
0
        public override void BeginExecute()
        {
            GetParent <CombatEntity>().CurrentSkillExecution = this;
            SkillAbility.Spelling = true;

            if (SkillExecutionAsset == null)
            {
                return;
            }
            var timelineAsset = SkillExecutionAsset.GetComponent <PlayableDirector>().playableAsset as TimelineAsset;

            if (timelineAsset == null)
            {
                return;
            }
            var skillExecutionObj = GameObject.Instantiate(SkillExecutionAsset, OwnerEntity.Position, Quaternion.Euler(0, OwnerEntity.Direction, 0));

            GameObject.Destroy(skillExecutionObj, (float)timelineAsset.duration);
            base.BeginExecute();
        }