|
@@ -74,10 +74,10 @@ namespace GameLogic.Combat.CombatTool
|
|
|
}
|
|
|
Vector3 p = besselPath.GetValue(0.99f);
|
|
|
lasetDir = (target - p).normalized;
|
|
|
- // GameObject gameObject = new GameObject("path");
|
|
|
- // gameObject.transform.position = satrtPos;
|
|
|
- // CombatPathMono combatPathMono = gameObject.AddComponent<CombatPathMono>();
|
|
|
- // combatPathMono.BesselPath = besselPath;
|
|
|
+ GameObject gameObject = new GameObject("path");
|
|
|
+ gameObject.transform.position = satrtPos;
|
|
|
+ CombatPathMono combatPathMono = gameObject.AddComponent<CombatPathMono>();
|
|
|
+ combatPathMono.BesselPath = besselPath;
|
|
|
InitZhuangSHi(besselPath);
|
|
|
return besselPath;
|
|
|
}
|
|
@@ -88,6 +88,7 @@ namespace GameLogic.Combat.CombatTool
|
|
|
Vector3 dir = Quaternion.LookRotation(lasetDir) * new Vector3(offx, 0, 1);
|
|
|
Vector3 target = satrtPos + dir.normalized * maxD;
|
|
|
Vector3 dir2 = Quaternion.LookRotation(lasetDir) * new Vector3(offx * -1, 0, 1);
|
|
|
+ dir2 = dir2.normalized;
|
|
|
Vector3 centre = satrtPos + dir2.normalized * maxD;
|
|
|
// if (offx == 0)
|
|
|
{
|
|
@@ -95,10 +96,10 @@ namespace GameLogic.Combat.CombatTool
|
|
|
}
|
|
|
Vector3 p = besselPath.GetValue(0.99f);
|
|
|
lasetDir = (target - p).normalized;
|
|
|
- // GameObject gameObject = new GameObject("path");
|
|
|
- // gameObject.transform.position = satrtPos;
|
|
|
- // CombatPathMono combatPathMono = gameObject.AddComponent<CombatPathMono>();
|
|
|
- // combatPathMono.BesselPath = besselPath;
|
|
|
+ GameObject gameObject = new GameObject("path");
|
|
|
+ gameObject.transform.position = satrtPos;
|
|
|
+ CombatPathMono combatPathMono = gameObject.AddComponent<CombatPathMono>();
|
|
|
+ combatPathMono.BesselPath = besselPath;
|
|
|
InitZhuangSHi(besselPath);
|
|
|
return besselPath;
|
|
|
}
|
|
@@ -246,12 +247,12 @@ namespace GameLogic.Combat.CombatTool
|
|
|
{
|
|
|
if (NextBesselPath == null)
|
|
|
{
|
|
|
- // int odds = Random.Range(0, 100);
|
|
|
- // if (odds < 50)
|
|
|
- // {
|
|
|
- // NextBesselPath = InitBesselPath(currBesselPath.b, Random.Range(0, 100) < 50 ? -1 : 1);
|
|
|
- // }
|
|
|
- // else
|
|
|
+ int odds = Random.Range(0, 100);
|
|
|
+ if (odds < 50)
|
|
|
+ {
|
|
|
+ NextBesselPath = InitBesselPath(currBesselPath.b, Random.Range(0, 100) < 50 ? -1 : 1);
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
NextBesselPath = InitBesselPath(currBesselPath.b);
|
|
|
}
|
|
@@ -260,10 +261,10 @@ namespace GameLogic.Combat.CombatTool
|
|
|
|
|
|
if (currTime > 1)
|
|
|
{
|
|
|
- // if (NextBesselPath == null)
|
|
|
- // {
|
|
|
- // NextBesselPath = InitBesselPath(currBesselPath.b, Random.Range(0, 100) < 50 ? -1 : 1);
|
|
|
- // }
|
|
|
+ if (NextBesselPath == null)
|
|
|
+ {
|
|
|
+ NextBesselPath = InitBesselPath(currBesselPath.b, Random.Range(0, 100) < 50 ? -1 : 1);
|
|
|
+ }
|
|
|
|
|
|
currTime = currTime % 1;
|
|
|
// targetPos = NextBesselPath.GetValue(currTime);
|