|
|
@@ -439,7 +439,25 @@ public class Enemy : MoveCharacter
|
|
|
ChangeState(CharacterState.Fall);
|
|
|
break;
|
|
|
}
|
|
|
- rb.velocity += Vector3.up * extraRiseGravity * Time.deltaTime * moveSpeedScale;
|
|
|
+ velocity.y += extraRiseGravity * Time.deltaTime;
|
|
|
+ if (leftDir.x > 0.3f)
|
|
|
+ {
|
|
|
+ velocity.x = moveSpeed;
|
|
|
+ if (bodyTrans.localScale.x > 0)
|
|
|
+ {
|
|
|
+ Turn();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (leftDir.x < -0.3f)
|
|
|
+ {
|
|
|
+ velocity.x = -moveSpeed;
|
|
|
+ if (bodyTrans.localScale.x < 0)
|
|
|
+ {
|
|
|
+ Turn();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ rb.velocity = velocity * moveSpeedScale;
|
|
|
}
|
|
|
break;
|
|
|
case CharacterState.Fall:
|