|
@@ -16,12 +16,19 @@ public class Catninja_Far : Enemy
|
|
|
switch (state)
|
|
switch (state)
|
|
|
{
|
|
{
|
|
|
case CharacterState.Idle:
|
|
case CharacterState.Idle:
|
|
|
- ChangeMoveDir(true);
|
|
|
|
|
- Debug.Log(moveDir);
|
|
|
|
|
- ChangeState(CharacterState.Rise);
|
|
|
|
|
- Vector3 velocity = rb.velocity;
|
|
|
|
|
- velocity.y = jumpForce;
|
|
|
|
|
- rb.velocity = velocity;
|
|
|
|
|
|
|
+ if (foot.TrigGround)
|
|
|
|
|
+ {
|
|
|
|
|
+ ChangeMoveDir(true);
|
|
|
|
|
+ Debug.Log(moveDir);
|
|
|
|
|
+ ChangeState(CharacterState.Rise);
|
|
|
|
|
+ Vector3 velocity = rb.velocity;
|
|
|
|
|
+ velocity.y = jumpForce;
|
|
|
|
|
+ rb.velocity = velocity;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ ChangeState(CharacterState.Fall);
|
|
|
|
|
+ }
|
|
|
return;
|
|
return;
|
|
|
case CharacterState.Rise:
|
|
case CharacterState.Rise:
|
|
|
if(rb.velocity.y <= 0 && isAttack && pastAttackTime >= attackController.attackInterval)
|
|
if(rb.velocity.y <= 0 && isAttack && pastAttackTime >= attackController.attackInterval)
|