12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using System;
- using System.Collections.Generic;
- using Fort23.Core;
- using Fort23.UTool;
- using UnityEngine;
- namespace GameLogic.Combat.CombatTool
- {
- [Serializable]
- public class CombatSencePath: CObject
- {
- public Vector3 a;
- public Vector3 b;
- private Vector3 Centre;
- private bool isCentre;
- public float reclaimTime;
- public List<GameObjectPool>allPool = new List<GameObjectPool>();
- public void SetPos(Vector3 startPos, Vector3 target)
- {
- a = startPos;
- b = target;
- isCentre = false;
- }
- public void SetPos(Vector3 startPos, Vector3 centre, Vector3 target)
- {
- a = startPos;
- Centre = centre;
- b = target;
- isCentre = true;
- }
-
- public Vector3 GetValue(float t)
- {
- float t1 = t;
- if (t1 > 1)
- {
- t1 = 1;
- }
- if (t1 < 0)
- {
- t1 = 0;
- }
- if (isCentre)
- {
- Vector3 p1 = Vector3.Lerp(a, Centre, t1);
- Vector3 p2 = Vector3.Lerp(p1, b, t1);
- return p2;
- }
- else
- {
- return Vector3.Lerp(a, b, t1);
- }
- }
- public override void ActiveObj()
- {
-
- }
- public override void DormancyObj()
- {
- for (int i = 0; i < allPool.Count; i++)
- {
- GObjectPool.Instance.Recycle(allPool[i]);
- }
- allPool.Clear();
- }
- }
- }
|