|
|
@@ -311,20 +311,20 @@ public class Demonic : MoveCharacter
|
|
|
}
|
|
|
velocity.x = velocityAddition;
|
|
|
velocity.y = 0;
|
|
|
+ Quaternion targetQt = Quaternion.Euler(Vector3.zero);
|
|
|
if (!foot.haveGravity)
|
|
|
{
|
|
|
transform.position = new Vector3(transform.position.x, platformPosY, transform.position.z);
|
|
|
- Quaternion targetQt = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, platformRotZ);
|
|
|
- if (RotLerpTime < 1)
|
|
|
- {
|
|
|
- RotLerpTime += RotLerpSpeed * Time.deltaTime;
|
|
|
- transform.rotation = Quaternion.Lerp(transform.rotation, targetQt, RotLerpTime);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- transform.rotation = targetQt;
|
|
|
- }
|
|
|
-
|
|
|
+ targetQt = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, platformRotZ);
|
|
|
+ }
|
|
|
+ if (RotLerpTime < 1)
|
|
|
+ {
|
|
|
+ RotLerpTime += RotLerpSpeed * Time.deltaTime;
|
|
|
+ transform.rotation = Quaternion.Lerp(transform.rotation, targetQt, RotLerpTime);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ transform.rotation = targetQt;
|
|
|
}
|
|
|
rb.velocity = velocity;
|
|
|
|
|
|
@@ -380,21 +380,21 @@ public class Demonic : MoveCharacter
|
|
|
}
|
|
|
}
|
|
|
velocity.y = 0;
|
|
|
+ Quaternion targetQt = Quaternion.Euler(Vector3.zero);
|
|
|
if (!foot.haveGravity)
|
|
|
{
|
|
|
transform.position = new Vector3(transform.position.x, platformPosY, transform.position.z);
|
|
|
- Quaternion targetQt = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, platformRotZ);
|
|
|
- if (RotLerpTime < 1)
|
|
|
- {
|
|
|
- RotLerpTime += RotLerpSpeed * Time.deltaTime;
|
|
|
- transform.rotation = Quaternion.Lerp(transform.rotation, targetQt, RotLerpTime);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- transform.rotation = targetQt;
|
|
|
- }
|
|
|
+ targetQt = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, platformRotZ);
|
|
|
+ }
|
|
|
+ if (RotLerpTime < 1)
|
|
|
+ {
|
|
|
+ RotLerpTime += RotLerpSpeed * Time.deltaTime;
|
|
|
+ transform.rotation = Quaternion.Lerp(transform.rotation, targetQt, RotLerpTime);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ transform.rotation = targetQt;
|
|
|
}
|
|
|
-
|
|
|
rb.velocity = velocity;
|
|
|
AdjustHeight();
|
|
|
}
|
|
|
@@ -632,8 +632,10 @@ public class Demonic : MoveCharacter
|
|
|
switch (state)
|
|
|
{
|
|
|
case CharacterState.Idle:
|
|
|
+ //transform.rotation = Quaternion.Euler(Vector3.zero);
|
|
|
break;
|
|
|
case CharacterState.Run:
|
|
|
+ //transform.rotation = Quaternion.Euler(Vector3.zero);
|
|
|
rb.velocity = Vector3.zero;
|
|
|
break;
|
|
|
case CharacterState.Rush:
|