123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- 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);
- moveTarget.transform.position = pos;
- if (_currTime >=1)
- {
- Dispose();
- PlayHit();
- }
- }
- }
|