|
@@ -1,6 +1,5 @@
|
|
using System;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
-using Core.Utility;
|
|
|
|
using Fort23.Core;
|
|
using Fort23.Core;
|
|
using Fort23.UTool;
|
|
using Fort23.UTool;
|
|
using GameLogic.Combat.CombatTool.SceneTool;
|
|
using GameLogic.Combat.CombatTool.SceneTool;
|
|
@@ -11,44 +10,30 @@ namespace GameLogic.Combat.CombatTool
|
|
[Serializable]
|
|
[Serializable]
|
|
public class CombatSencePath : CObject
|
|
public class CombatSencePath : CObject
|
|
{
|
|
{
|
|
- public BesselPath BesselPath;
|
|
|
|
-
|
|
|
|
- // public Vector3 a;
|
|
|
|
- public Vector3 b
|
|
|
|
- {
|
|
|
|
- get { return BesselPath.controlPoints[3]; }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // public Vector3 Centre;
|
|
|
|
|
|
+ public Vector3 a;
|
|
|
|
+ public Vector3 b;
|
|
|
|
+ public Vector3 Centre;
|
|
public bool isCentre;
|
|
public bool isCentre;
|
|
|
|
|
|
public float reclaimTime;
|
|
public float reclaimTime;
|
|
|
|
|
|
public List<SceneDecoration> allPool = new List<SceneDecoration>();
|
|
public List<SceneDecoration> allPool = new List<SceneDecoration>();
|
|
|
|
|
|
- public float len
|
|
|
|
- {
|
|
|
|
- get { return BesselPath.allDis; }
|
|
|
|
- }
|
|
|
|
|
|
+ public float len;
|
|
|
|
|
|
public void SetPos(Vector3 startPos, Vector3 target)
|
|
public void SetPos(Vector3 startPos, Vector3 target)
|
|
{
|
|
{
|
|
- BesselPath = new BesselPath();
|
|
|
|
- BesselPath.controlPoints.Add(startPos);
|
|
|
|
- BesselPath.controlPoints.Add(startPos);
|
|
|
|
- BesselPath.controlPoints.Add(target);
|
|
|
|
- BesselPath.controlPoints.Add(target);
|
|
|
|
|
|
+ a = startPos;
|
|
|
|
+ b = target;
|
|
isCentre = false;
|
|
isCentre = false;
|
|
SetLen();
|
|
SetLen();
|
|
}
|
|
}
|
|
|
|
|
|
public void SetPos(Vector3 startPos, Vector3 centre, Vector3 target)
|
|
public void SetPos(Vector3 startPos, Vector3 centre, Vector3 target)
|
|
{
|
|
{
|
|
- BesselPath = new BesselPath();
|
|
|
|
- BesselPath.controlPoints.Add(startPos);
|
|
|
|
- BesselPath.controlPoints.Add(startPos);
|
|
|
|
- BesselPath.controlPoints.Add(centre);
|
|
|
|
- BesselPath.controlPoints.Add(target);
|
|
|
|
|
|
+ a = startPos;
|
|
|
|
+ Centre = centre;
|
|
|
|
+ b = target;
|
|
isCentre = true;
|
|
isCentre = true;
|
|
SetLen();
|
|
SetLen();
|
|
}
|
|
}
|
|
@@ -56,12 +41,40 @@ namespace GameLogic.Combat.CombatTool
|
|
|
|
|
|
private void SetLen()
|
|
private void SetLen()
|
|
{
|
|
{
|
|
- BesselPath.SetLengthAtT();
|
|
|
|
|
|
+ float a = 1 / 100f;
|
|
|
|
+ len = 0;
|
|
|
|
+ for (int i = 0; i < 100; i++)
|
|
|
|
+ {
|
|
|
|
+ Vector3 p = GetValue(i * a);
|
|
|
|
+ Vector3 p2 = GetValue((i + 1) * a);
|
|
|
|
+ len += Vector3.Distance(p, p2);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public Vector3 GetValue(float t)
|
|
public Vector3 GetValue(float t)
|
|
{
|
|
{
|
|
- return BesselPath.CalculatePoint(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 void Update(float t)
|
|
public void Update(float t)
|