|
@@ -95,7 +95,7 @@ public class MoveCharacter : Character
|
|
|
|
|
|
|
|
private void RotateSelf()
|
|
private void RotateSelf()
|
|
|
{
|
|
{
|
|
|
- //transform.localEulerAngles += new Vector3(0, 0, 1) * rotateDir * rotateSpeed * Time.deltaTime;
|
|
|
|
|
|
|
+ transform.localEulerAngles += new Vector3(0, 0, 1) * rotateDir * rotateSpeed * Time.deltaTime;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -144,26 +144,17 @@ public class MoveCharacter : Character
|
|
|
else if (foot.TrigGround || curHeight <= origPos.y + 0.05f)
|
|
else if (foot.TrigGround || curHeight <= origPos.y + 0.05f)
|
|
|
{
|
|
{
|
|
|
transform.position = origPos;
|
|
transform.position = origPos;
|
|
|
- floatState = 0;
|
|
|
|
|
ChangeState(CharacterState.Idle);
|
|
ChangeState(CharacterState.Idle);
|
|
|
ChangeMat(1);
|
|
ChangeMat(1);
|
|
|
foreach (Material m in mats)
|
|
foreach (Material m in mats)
|
|
|
{
|
|
{
|
|
|
m.SetInt("_Outline", 0);
|
|
m.SetInt("_Outline", 0);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- if (rotateDir==1)
|
|
|
|
|
- {
|
|
|
|
|
- transform.localEulerAngles = Vector3.SmoothDamp(transform.localEulerAngles, new Vector3(0, 0, 0), ref oneClockwise, 0.1f);
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- transform.localEulerAngles = Vector3.SmoothDamp(transform.localEulerAngles, new Vector3(0, 0, 0), ref oneCounterClockwise, 0.1f);
|
|
|
|
|
- }
|
|
|
|
|
- if (transform.localEulerAngles.z >= -0.02f && transform.localEulerAngles.z <= 0.02f)
|
|
|
|
|
|
|
+ transform.rotation = Quaternion.Lerp(transform.rotation, Quaternion.Euler(0, 0, 0), 0.02f);
|
|
|
|
|
+ if (transform.localEulerAngles.z >= -5f && transform.localEulerAngles.z <= 5f)
|
|
|
{
|
|
{
|
|
|
transform.localEulerAngles = new Vector3(0, 0, 0);
|
|
transform.localEulerAngles = new Vector3(0, 0, 0);
|
|
|
-
|
|
|
|
|
|
|
+ floatState = 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|