|
@@ -25,6 +25,8 @@ public class Demonic : MoveCharacter
|
|
|
public Collider soulCollector;
|
|
public Collider soulCollector;
|
|
|
public bool isBack = false; //Íù·´·½Ïò×ß
|
|
public bool isBack = false; //Íù·´·½Ïò×ß
|
|
|
|
|
|
|
|
|
|
+ public float runSpeed;
|
|
|
|
|
+
|
|
|
private void Awake()
|
|
private void Awake()
|
|
|
{
|
|
{
|
|
|
}
|
|
}
|
|
@@ -330,6 +332,58 @@ public class Demonic : MoveCharacter
|
|
|
}
|
|
}
|
|
|
AdjustHeight();
|
|
AdjustHeight();
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case CharacterState.Rush:
|
|
|
|
|
+ if (isAttack)
|
|
|
|
|
+ {
|
|
|
|
|
+ Attack2();
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!foot.TrigGround && !canFly)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (rb.velocity.y > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ ChangeState(CharacterState.Rise);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ ChangeState(CharacterState.Fall);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (leftDir.x < 0.3f && leftDir.x > -0.3f)
|
|
|
|
|
+ {
|
|
|
|
|
+ ChangeState(CharacterState.Idle);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (leftDir.x > 0.3f)
|
|
|
|
|
+ {
|
|
|
|
|
+ //rb.velocity += Vector3.right * moveAcc * Time.deltaTime;
|
|
|
|
|
+ rb.velocity = Vector3.right * runSpeed;
|
|
|
|
|
+ //if (rb.velocity.x > maxMoveSpeed)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // rb.velocity = new Vector3(maxMoveSpeed, rb.velocity.y, rb.velocity.z);
|
|
|
|
|
+ //}
|
|
|
|
|
+ if (bodyTrans.localScale.x > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ Turn();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (leftDir.x < -0.3f)
|
|
|
|
|
+ {
|
|
|
|
|
+ //rb.velocity -= Vector3.right * moveAcc * Time.deltaTime;
|
|
|
|
|
+ rb.velocity = Vector3.left * runSpeed;
|
|
|
|
|
+ //if (rb.velocity.x < -maxMoveSpeed)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // rb.velocity = new Vector3(-maxMoveSpeed, rb.velocity.y, rb.velocity.z);
|
|
|
|
|
+ //}
|
|
|
|
|
+ if (bodyTrans.localScale.x < 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ Turn();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ AdjustHeight();
|
|
|
|
|
+ break;
|
|
|
case CharacterState.Rise:
|
|
case CharacterState.Rise:
|
|
|
if (rb.velocity.y <= 0)
|
|
if (rb.velocity.y <= 0)
|
|
|
{
|
|
{
|
|
@@ -454,6 +508,9 @@ public class Demonic : MoveCharacter
|
|
|
case CharacterState.Run:
|
|
case CharacterState.Run:
|
|
|
rb.velocity = Vector3.zero;
|
|
rb.velocity = Vector3.zero;
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case CharacterState.Rush:
|
|
|
|
|
+ rb.velocity = Vector3.zero;
|
|
|
|
|
+ break;
|
|
|
case CharacterState.Rise:
|
|
case CharacterState.Rise:
|
|
|
break;
|
|
break;
|
|
|
case CharacterState.Fall:
|
|
case CharacterState.Fall:
|
|
@@ -501,6 +558,10 @@ public class Demonic : MoveCharacter
|
|
|
aniCollider.Play("Walk", 0, 0);
|
|
aniCollider.Play("Walk", 0, 0);
|
|
|
//animalAni.SetInteger("state", (int)PlayerState.Walk);
|
|
//animalAni.SetInteger("state", (int)PlayerState.Walk);
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case CharacterState.Rush:
|
|
|
|
|
+ ani.Play("rush", 0, 0);
|
|
|
|
|
+ aniCollider.Play("Rush", 0, 0);
|
|
|
|
|
+ break;
|
|
|
case CharacterState.Rise:
|
|
case CharacterState.Rise:
|
|
|
aniCollider.Play("Rise", 0, 0);
|
|
aniCollider.Play("Rise", 0, 0);
|
|
|
break;
|
|
break;
|