|
@@ -8,6 +8,7 @@ using Fort23.UTool;
|
|
|
using GameLogic.Combat.CombatTool.SceneTool;
|
|
|
using GameLogic.CombatScenesTool;
|
|
|
using UnityEngine;
|
|
|
+using Utility.UITool;
|
|
|
using Random = UnityEngine.Random;
|
|
|
|
|
|
namespace GameLogic.Combat.CombatTool
|
|
@@ -46,6 +47,21 @@ namespace GameLogic.Combat.CombatTool
|
|
|
|
|
|
private float shengShiRan;
|
|
|
|
|
|
+
|
|
|
+ public float moveSpeed = 2f;
|
|
|
+ public bool isFlight;
|
|
|
+ private bool _isFlightCameraFinish;
|
|
|
+ private float _flightTime;
|
|
|
+ private float _flightAddTime;
|
|
|
+ private float _flightCurrTime;
|
|
|
+ private Vector3 _flightDir;
|
|
|
+ private Vector3 _flightStartDir;
|
|
|
+ private float _flightStartSpeed;
|
|
|
+ private float _flightSpeed;
|
|
|
+ private ParticleSystemPool _flightFx1;
|
|
|
+ private ParticleSystemPool _flightFx2;
|
|
|
+ public Vector3 moveDir = Vector3.forward;
|
|
|
+
|
|
|
// private List
|
|
|
public async CTask InitScenes(string sceneName)
|
|
|
{
|
|
@@ -103,6 +119,49 @@ namespace GameLogic.Combat.CombatTool
|
|
|
SceneMonoConfig.UpdateScene();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public Vector3 GetTarget(float d)
|
|
|
+ {
|
|
|
+ if (CombatController.currActiveCombat.playerHeroEntity == null)
|
|
|
+ {
|
|
|
+ return new Vector3(0, 20, 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ return CombatController.currActiveCombat.playerHeroEntity.dotPos + moveDir * d;
|
|
|
+ }
|
|
|
+ public async CTask Flight(float time, float jiaoDu, float speed)
|
|
|
+ {
|
|
|
+ _flightCurrTime = 0;
|
|
|
+ _flightTime = time;
|
|
|
+ _flightAddTime = 1.0f / time;
|
|
|
+ isFlight = true;
|
|
|
+ _isFlightCameraFinish = false;
|
|
|
+ Quaternion quaternion = Quaternion.Euler(0, jiaoDu, 0);
|
|
|
+ _flightDir = quaternion * moveDir;
|
|
|
+ _flightStartDir = moveDir;
|
|
|
+ _flightStartSpeed = moveSpeed;
|
|
|
+ _flightSpeed = speed;
|
|
|
+ CombatController.currActiveCombat.playerHeroEntity.PlayAnim("idle2", true, 0, false, 1);
|
|
|
+ CombatController.currActiveCombat.CombatCameraControllder.SetFieldOfView(90, 0.5f);
|
|
|
+ GObjectPool.Instance.Recycle(_flightFx1);
|
|
|
+ GObjectPool.Instance.Recycle(_flightFx2);
|
|
|
+ GObjectPool.Instance.FetchAsync<ParticleSystemPool>("fx fly qi", delegate(ParticleSystemPool pool)
|
|
|
+ {
|
|
|
+ _flightFx1 = pool;
|
|
|
+ SpecialDotInfo specialDotInfo =
|
|
|
+ CombatController.currActiveCombat.playerHeroEntity.GetSpecialDotInfo("hitpos");
|
|
|
+ pool.own.transform.SetParent(specialDotInfo.targetTran);
|
|
|
+ pool.own.transform.localPosition = Vector3.zero;
|
|
|
+ });
|
|
|
+ GObjectPool.Instance.FetchAsync<ParticleSystemPool>("fx zq jian loop", delegate(ParticleSystemPool pool)
|
|
|
+ {
|
|
|
+ _flightFx2 = pool;
|
|
|
+
|
|
|
+ pool.own.transform.SetParent(CombatController.currActiveCombat.playerHeroEntity.GameObject.transform);
|
|
|
+ pool.own.transform.localPosition = Vector3.zero;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
private async CTask<SceneDecoration> GetSceneDecoration(SceneObjectConfig sceneObjectConfig)
|
|
|
{
|
|
|
GameObjectPool gameObjectPool = await sceneObjectConfig.GetNewPrefab();
|
|
@@ -130,7 +189,7 @@ namespace GameLogic.Combat.CombatTool
|
|
|
|
|
|
public void Update(float t)
|
|
|
{
|
|
|
- moveRoot.transform.position = CombatController.currActiveCombat.CombatHeroController.GetTarget(0);
|
|
|
+ moveRoot.transform.position = GetTarget(0);
|
|
|
SceneMonoConfig?.UpdateScene();
|
|
|
|
|
|
|
|
@@ -149,7 +208,30 @@ namespace GameLogic.Combat.CombatTool
|
|
|
_isUpdateShengShi = false;
|
|
|
}
|
|
|
}
|
|
|
+ if (isFlight)
|
|
|
+ {
|
|
|
+ _flightCurrTime += t * _flightAddTime;
|
|
|
+ moveDir = Vector3.Lerp(_flightStartDir, _flightDir, _flightCurrTime);
|
|
|
+ float flightSpeedCur =
|
|
|
+ AnimationCurveManager.Instance.AnimationCurveLibrary.flightSpeedCurve.Evaluate(_flightCurrTime);
|
|
|
+ moveSpeed = Mathf.Lerp(_flightStartSpeed, _flightSpeed, flightSpeedCur);
|
|
|
+ if (_flightCurrTime > 0.95f&&!_isFlightCameraFinish)
|
|
|
+ {
|
|
|
+ _isFlightCameraFinish= true;
|
|
|
+ CombatController.currActiveCombat.CombatCameraControllder.SetFieldOfView(70, 1);
|
|
|
+ }
|
|
|
|
|
|
+ if (_flightCurrTime >= 1)
|
|
|
+ {
|
|
|
+ moveDir = _flightDir;
|
|
|
+ isFlight = false;
|
|
|
+ moveSpeed = 2;
|
|
|
+ GObjectPool.Instance.Recycle(_flightFx1);
|
|
|
+ GObjectPool.Instance.Recycle(_flightFx2);
|
|
|
+
|
|
|
+ CombatController.currActiveCombat.playerHeroEntity.PlayAnim("idle", true, 0, false, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|