|
@@ -129,10 +129,9 @@ namespace GameLogic.Combat.CombatTool
|
|
Vector3 cross = Vector3.Cross(dir, Vector3.up);
|
|
Vector3 cross = Vector3.Cross(dir, Vector3.up);
|
|
cross = cross.normalized;
|
|
cross = cross.normalized;
|
|
int odds = Random.Range(0, 100);
|
|
int odds = Random.Range(0, 100);
|
|
- p += cross * Random.Range(8, 25) * (odds < 50 ? 1 : -1);
|
|
|
|
- GameObjectPool gameObjectPool = await sceneObjectConfig.GetNewPrefab();
|
|
|
|
- GameObject g = gameObjectPool.own;
|
|
|
|
- g.SetActive(true);
|
|
|
|
|
|
+ p += cross * Random.Range(12, 25) * (odds < 50 ? 1 : -1);
|
|
|
|
+ SceneDecoration gameObjectPool = await GetSceneDecoration(sceneObjectConfig);
|
|
|
|
+ GameObject g = gameObjectPool.pool.own;
|
|
besselPath.allPool.Add(gameObjectPool);
|
|
besselPath.allPool.Add(gameObjectPool);
|
|
float y = Random.Range(sceneObjectConfig.minY, sceneObjectConfig.maxY);
|
|
float y = Random.Range(sceneObjectConfig.minY, sceneObjectConfig.maxY);
|
|
g.transform.position = new Vector3(p.x, y, p.z);
|
|
g.transform.position = new Vector3(p.x, y, p.z);
|
|
@@ -159,10 +158,9 @@ namespace GameLogic.Combat.CombatTool
|
|
Vector3 cross = Vector3.Cross(dir, Vector3.up);
|
|
Vector3 cross = Vector3.Cross(dir, Vector3.up);
|
|
cross = cross.normalized;
|
|
cross = cross.normalized;
|
|
int odds = Random.Range(0, 100);
|
|
int odds = Random.Range(0, 100);
|
|
- p += cross * Random.Range(25, 40) * (odds < 50 ? 1 : -1);
|
|
|
|
- GameObjectPool gameObjectPool = await sceneObjectConfig.GetNewPrefab();
|
|
|
|
- GameObject g = gameObjectPool.own;
|
|
|
|
- g.SetActive(true);
|
|
|
|
|
|
+ p += cross * Random.Range(40, 60) * (odds < 50 ? 1 : -1);
|
|
|
|
+ SceneDecoration gameObjectPool = await GetSceneDecoration(sceneObjectConfig);
|
|
|
|
+ GameObject g = gameObjectPool.pool.own;
|
|
besselPath.allPool.Add(gameObjectPool);
|
|
besselPath.allPool.Add(gameObjectPool);
|
|
float y = Random.Range(sceneObjectConfig.minY, sceneObjectConfig.maxY);
|
|
float y = Random.Range(sceneObjectConfig.minY, sceneObjectConfig.maxY);
|
|
g.transform.position = new Vector3(p.x, y, p.z);
|
|
g.transform.position = new Vector3(p.x, y, p.z);
|
|
@@ -190,9 +188,8 @@ namespace GameLogic.Combat.CombatTool
|
|
cross = cross.normalized;
|
|
cross = cross.normalized;
|
|
// int odds = Random.Range(0, 100);
|
|
// int odds = Random.Range(0, 100);
|
|
p += cross * Random.Range(-20, 20);
|
|
p += cross * Random.Range(-20, 20);
|
|
- GameObjectPool gameObjectPool = await sceneObjectConfig.GetNewPrefab();
|
|
|
|
- GameObject g = gameObjectPool.own;
|
|
|
|
- g.SetActive(true);
|
|
|
|
|
|
+ SceneDecoration gameObjectPool = await GetSceneDecoration(sceneObjectConfig);
|
|
|
|
+ GameObject g = gameObjectPool.pool.own;
|
|
besselPath.allPool.Add(gameObjectPool);
|
|
besselPath.allPool.Add(gameObjectPool);
|
|
float y = Random.Range(sceneObjectConfig.minY, sceneObjectConfig.maxY);
|
|
float y = Random.Range(sceneObjectConfig.minY, sceneObjectConfig.maxY);
|
|
g.transform.position = new Vector3(p.x, y, p.z);
|
|
g.transform.position = new Vector3(p.x, y, p.z);
|
|
@@ -200,6 +197,16 @@ namespace GameLogic.Combat.CombatTool
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private async CTask<SceneDecoration> GetSceneDecoration(SceneObjectConfig sceneObjectConfig)
|
|
|
|
+ {
|
|
|
|
+ GameObjectPool gameObjectPool = await sceneObjectConfig.GetNewPrefab();
|
|
|
|
+ SceneDecoration sceneDecoration = CObjectPool.Instance.Fetch<SceneDecoration>();
|
|
|
|
+ sceneDecoration.Init(gameObjectPool);
|
|
|
|
+ GameObject g = gameObjectPool.own;
|
|
|
|
+ g.SetActive(true);
|
|
|
|
+ return sceneDecoration;
|
|
|
|
+ }
|
|
|
|
+
|
|
public Vector3 GetTarget(float time)
|
|
public Vector3 GetTarget(float time)
|
|
{
|
|
{
|
|
if (time > 1)
|
|
if (time > 1)
|
|
@@ -288,6 +295,16 @@ namespace GameLogic.Combat.CombatTool
|
|
public void Update(float t)
|
|
public void Update(float t)
|
|
{
|
|
{
|
|
SceneMonoConfig?.Update();
|
|
SceneMonoConfig?.Update();
|
|
|
|
+ if (currBesselPath != null)
|
|
|
|
+ {
|
|
|
|
+ currBesselPath.Update(t);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (NextBesselPath != null)
|
|
|
|
+ {
|
|
|
|
+ NextBesselPath.Update(t);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (_isUpdateShengShi)
|
|
if (_isUpdateShengShi)
|
|
{
|
|
{
|
|
_shengShiAddTime += t * 1f;
|
|
_shengShiAddTime += t * 1f;
|