|
@@ -27,18 +27,40 @@ namespace GameLogic.Combat.CombatTool
|
|
|
|
|
|
public bool isStop;
|
|
public bool isStop;
|
|
|
|
|
|
|
|
+ private bool isUpdateCameraToPath;
|
|
|
|
+ private float currValue;
|
|
|
|
+ private float _cameraSelectValue;
|
|
|
|
+ private float targetValue;
|
|
|
|
+ private float _currTime;
|
|
|
|
+
|
|
public void Init(CombatController combatController, Camera camera)
|
|
public void Init(CombatController combatController, Camera camera)
|
|
{
|
|
{
|
|
|
|
+ CombatEventManager.Instance.AddEventListener(CombatEventType.SencenBesselPathAlter, SencenBesselPathAlter);
|
|
this.combatController = combatController;
|
|
this.combatController = combatController;
|
|
Camera = camera;
|
|
Camera = camera;
|
|
root = Camera.transform.parent;
|
|
root = Camera.transform.parent;
|
|
StressReceiver = camera.transform.GetComponentInParent<StressReceiver>();
|
|
StressReceiver = camera.transform.GetComponentInParent<StressReceiver>();
|
|
TimeLineSingletonEventManager.Instance.AddTimeLineBasic(this);
|
|
TimeLineSingletonEventManager.Instance.AddTimeLineBasic(this);
|
|
EventManager.Instance.AddEventListener(CustomEventType.HeroClick, HeroClick);
|
|
EventManager.Instance.AddEventListener(CustomEventType.HeroClick, HeroClick);
|
|
-
|
|
|
|
|
|
+ CameraSelect_onValueChanged(0.7f);
|
|
// EventManager.Instance.AddEventListener(CustomEventType.HeroClick, HeroClick);
|
|
// EventManager.Instance.AddEventListener(CustomEventType.HeroClick, HeroClick);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void SencenBesselPathAlter(IEventData eventData)
|
|
|
|
+ {
|
|
|
|
+ isUpdateCameraToPath = true;
|
|
|
|
+ currValue = _cameraSelectValue;
|
|
|
|
+ if (CombatController.currActiveCombat.CombatSenceController.currBesselPath.isCentre)
|
|
|
|
+ {
|
|
|
|
+ targetValue = 0.5f;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ targetValue = 0.7f;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ _currTime = 0;
|
|
|
|
+ }
|
|
|
|
|
|
protected void HeroClick(IEventData eventData)
|
|
protected void HeroClick(IEventData eventData)
|
|
{
|
|
{
|
|
@@ -54,6 +76,19 @@ namespace GameLogic.Combat.CombatTool
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void CameraSelect_onValueChanged(float value)
|
|
|
|
+ {
|
|
|
|
+ _cameraSelectValue = value;
|
|
|
|
+ Vector3 pos1 = new Vector3(0, -2, -0.7f);
|
|
|
|
+ Vector3 e1 = new Vector3(20, 0, 0);
|
|
|
|
+ Vector3 pos2 = new Vector3(9, 0.7f, -1.4f);
|
|
|
|
+ Vector3 e2 = new Vector3(17.77f, -28.25f, 1.165f);
|
|
|
|
+ Camera.transform.localPosition =
|
|
|
|
+ Vector3.Lerp(pos1, pos2, value);
|
|
|
|
+ Camera.transform.localEulerAngles =
|
|
|
|
+ Vector3.Lerp(e1, e2, value);
|
|
|
|
+ }
|
|
|
|
+
|
|
private void ShakeFinish()
|
|
private void ShakeFinish()
|
|
{
|
|
{
|
|
isStartShake = false;
|
|
isStartShake = false;
|
|
@@ -61,6 +96,16 @@ namespace GameLogic.Combat.CombatTool
|
|
|
|
|
|
public void Update(float t)
|
|
public void Update(float t)
|
|
{
|
|
{
|
|
|
|
+ if (isUpdateCameraToPath)
|
|
|
|
+ {
|
|
|
|
+ _currTime += t;
|
|
|
|
+ CameraSelect_onValueChanged(Mathf.Lerp(currValue, targetValue, _currTime));
|
|
|
|
+ if (_currTime > 1)
|
|
|
|
+ {
|
|
|
|
+ isUpdateCameraToPath = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if (!isStartShake && !isStop)
|
|
if (!isStartShake && !isStop)
|
|
{
|
|
{
|
|
CombatHeroEntity combatHeroEntities = combatController.CombatHeroController.playerHeroEntity;
|
|
CombatHeroEntity combatHeroEntities = combatController.CombatHeroController.playerHeroEntity;
|
|
@@ -68,7 +113,7 @@ namespace GameLogic.Combat.CombatTool
|
|
{
|
|
{
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
Vector3 p = combatHeroEntities.GameObject.transform.TransformPoint(new Vector3(0, 8, -10));
|
|
Vector3 p = combatHeroEntities.GameObject.transform.TransformPoint(new Vector3(0, 8, -10));
|
|
root.rotation = Quaternion.Lerp(root.rotation, combatHeroEntities.GameObject.transform.rotation,
|
|
root.rotation = Quaternion.Lerp(root.rotation, combatHeroEntities.GameObject.transform.rotation,
|
|
1);
|
|
1);
|
|
@@ -83,7 +128,7 @@ namespace GameLogic.Combat.CombatTool
|
|
1);
|
|
1);
|
|
root.position = Vector3.Lerp(root.position, p, 1);
|
|
root.position = Vector3.Lerp(root.position, p, 1);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public void Dispose()
|
|
public void Dispose()
|
|
{
|
|
{
|
|
EventManager.Instance.RemoveEventListener(CustomEventType.HeroClick, HeroClick);
|
|
EventManager.Instance.RemoveEventListener(CustomEventType.HeroClick, HeroClick);
|