| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 | using Common.Utility.CombatEvent;using Core.Audio;using Core.Utility;using Fort23.Core;using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical;using UnityEngine;using Utility.CTween;namespace GameLogic.Combat.Skill.MagicSkill{    public class StraightLineShow : MagicAttShowBasic    {        private BesselPath _besselPath;        private float allTime;        // private float speed = 15;        private float addTime;        protected override void ProSetInfo()        {            _besselPath = CObjectPool.Instance.Fetch<BesselPath>();            _skillBasic.CombatHeroEntity.GameObject.transform.eulerAngles = Vector3.zero;            Vector3 p1 =                _skillBasic.CombatHeroEntity.GameObject.transform.TransformPoint(new Vector3(-5f, 5f, 5f));            Vector3 p2 = SetTargetPos2();            _besselPath.controlPoints.Add(_skillBasic.CombatHeroEntity.GameObject.transform.position);            _besselPath.controlPoints.Add(p1);            _besselPath.controlPoints.Add(p2);            _besselPath.controlPoints.Add(target.GetSpecialDotInfo("hitpos").GetWorlPos());            float d = _besselPath.GetLengthAtT(allTime);            AudioManager.Instance.PlayAudio("fbfeixing.wav");            addTime = 1.0f / (d /  CustomTweenManager.AnimationCurveLibrary.fabaoMoveTopEnemySpeed);            allTime = 0;        }        protected Vector3 SetTargetPos2()        {            Vector3 p2 = target.GameObject.transform.TransformPoint(new Vector3(-5f, 1f, 5f));            return p2;        }        protected override void ProUpdate(float t)        {            Vector3 p2 = SetTargetPos2();            _besselPath.controlPoints[2] = p2;            _besselPath.controlPoints[3] = target.dotPos;            allTime += t * addTime;            float v = CustomTweenManager.AnimationCurveLibrary.fabaoAtt.Evaluate(allTime);            Vector3 lasetPos = _besselPath.CalculatePoint(v - 0.01f);            Vector3 p = _besselPath.CalculatePoint(v);            _skillBasic.CombatHeroEntity.combatHeroGameObject.SetPosition(p);            Quaternion quaternion = Quaternion.LookRotation((p - lasetPos).normalized);            _skillBasic.CombatHeroEntity.GameObject.transform.rotation =                Quaternion.Lerp(_skillBasic.CombatHeroEntity.GameObject.transform.rotation, quaternion, 0.5f);            if (allTime >= 1)            {                isUpdate = false;                callBack?.Invoke();            }        }    }}
 |