| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 | using System.Collections;using System.Collections.Generic;using Common.Combat.FxAILogic;using Core.Utility;using UnityEngine;public class S9062_FxLogic : FxAILogicBasic{    public float speed;    private Vector3 targetPos;    private BesselPath moveBezierPath;    private float _currTime;    private float _addTime;    protected override void ProInit()    {        targetPos = TimeLineEventParticleLogicBasic.customizePos[0];        if (moveBezierPath == null)        {            moveBezierPath = new BesselPath();        }        moveBezierPath.controlPoints.Clear();        Vector3 dir = (targetPos - startPos);        Vector3 zxPoint = startPos + dir * 0.5f + new Vector3(0, 5, 0);        moveBezierPath.controlPoints.Add(startPos);        moveBezierPath.controlPoints.Add(zxPoint);        moveBezierPath.controlPoints.Add(targetPos);        moveBezierPath.SetLengthAtT();        _addTime = 1.0f / (moveBezierPath.allDis / speed);        _currTime = 0;    }    protected override void ProCombatUpdate(float time)    {        _currTime += time * _addTime;        Vector3 pos = moveBezierPath.CalculatePoint(_currTime);        _currPos=pos;        moveTarget.transform.position = pos;        if (_currTime >=1)        {            Dispose();            PlayHit();        }    }}
 |