Esempio n. 1
0
    public void OnClickAnimation(string state)
    {
        switch (state)
        {
        case "Idle":
            yasuharasan.ChangeState(CharacterController.State.Idle);
            nayukisan.ChangeState(CharacterController.State.Idle);
            break;

        case "Walk":
            yasuharasan.ChangeState(CharacterController.State.Walk);
            nayukisan.ChangeState(CharacterController.State.Walk);
            break;

        case "Run":
            yasuharasan.ChangeState(CharacterController.State.Run);
            nayukisan.ChangeState(CharacterController.State.Run);
            break;

        case "Dance":
            yasuharasan.ChangeState(CharacterController.State.Dance);
            nayukisan.ChangeState(CharacterController.State.Dance);
            break;

        case "Warp":
            yasuharasan.ChangeState(CharacterController.State.Warp);
            nayukisan.ChangeState(CharacterController.State.Warp);
            break;
        }
    }
Esempio n. 2
0
    public void Execute()
    {
        character.moveDir = character.inputs.walk.ReadValue <float>();
        character.anim.SetFloat("MoveX", character.moveDir * character.direction);

        character.DirectionToBeFacing();
        character.Walk();

        if (character.inputs.walk.ReadValue <float>() == 0)
        {
            character.ChangeState(new IdleState());
        }

        if (character.inputs.jump.ReadValue <float>() != 0)
        {
            //character.anim.SetBool("IsJumping", true);
            character.ChangeState(new JumpState());
            character.Jump();
        }

        if (character.inputs.crouch.ReadValue <float>() != 0)
        {
            character.ChangeState(new CrouchState());
        }

        character.HandleAttackPress();
    }
Esempio n. 3
0
 public void Execute()
 {
     if (character.anim.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1 && character.anim.GetBool("IsThrowing") == true)
     {
         character.ChangeState(new ThrowingState());
     }
     else if (character.anim.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1 && character.anim.GetBool("IsThrowing") == false)
     {
         character.anim.SetBool("IsThrowing", false);
         character.ChangeState(new IdleState());
     }
 }
Esempio n. 4
0
 private void ResetCharacter(CharacterController player)
 {
     player.ChangeState(new RoundStartState());
     player.stats.ResetHp();
     player.stats.ResetSuperMeter();
     player.anim.SetBool("IsKO", false);
 }
Esempio n. 5
0
 public void Execute()
 {
     if (character.anim.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1 && character.IsGrounded() && character.rb.velocity.y <= 0)
     {
         character.ChangeState(new WakeupState());
     }
 }
Esempio n. 6
0
 public void Execute()
 {
     if (character.anim.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1)
     {
         character.ChangeState(new IdleState());
     }
 }
Esempio n. 7
0
 public void Execute()
 {
     if (character.anim.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1 && character.IsLanding() && character.rb.velocity.y <= 0)
     {
         character.ChangeState(new IdleState());
     }
 }
Esempio n. 8
0
 public void RoundStart()
 {
     audio.Play("Fight");
     roundEnded = false;
     camera.EnableWalls();
     p1.ChangeState(new IdleState());
     p2.ChangeState(new IdleState());
 }
Esempio n. 9
0
 public void Execute()
 {
     //Debug.Log("Normalized Time: " + character.anim.GetCurrentAnimatorStateInfo(0).normalizedTime);
     if (character.anim.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1)
     {
         character.ChangeState(new IdleState());
     }
 }
Esempio n. 10
0
    public void Execute()
    {
        character.DirectionToBeFacing();
        character.rb.velocity = new Vector2(0, 0);
        if (character.inputs.crouch.ReadValue <float>() == 0)
        {
            character.ChangeState(new IdleState());
        }

        if (character.inputs.jump.ReadValue <float>() != 0)
        {
            character.Jump();
            character.ChangeState(new JumpState());
        }

        character.HandleAttackPress();
    }
Esempio n. 11
0
 public void Execute()
 {
     //if (character.IsLanding() && character.rb.velocity.y < 0)
     //{
     //    character.ChangeState(new IdleState());
     //    Debug.Log("Landing from atk");
     //}
     Debug.Log("Normalized Time for Jump Attack: " + character.anim.GetCurrentAnimatorStateInfo(0).normalizedTime);
     if (character.IsLanding() && character.rb.velocity.y <= 0)
     {
         character.ChangeState(new IdleState());
     }
     else if (character.anim.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1)
     {
         Debug.Log("Jump attacking is finished");
         character.ChangeState(new JumpState());
     }
 }
Esempio n. 12
0
 public void Execute()
 {
     FollowThrowPos();
     if (character.anim.GetBool("IsThrown") == false)
     {
         character.stats.TakeDamage(atkData.damage);
         character.ChangeState(new LaunchState());
     }
 }
Esempio n. 13
0
 private void HitStunned()
 {
     if (hitDuration > 0)
     {
         hitDuration -= 1.5f * Time.fixedDeltaTime;
         //character.anim.Play("NidStandHit");
     }
     else
     {
         character.anim.SetBool("InHitStun", false);
         if (character.inputs.crouch.ReadValue <float>() != 0)
         {
             Debug.Log("Maintain crouch from hit");
             character.anim.SetBool("IsCrouching", true);
             character.ChangeState(new CrouchState());
         }
         else
         {
             character.ChangeState(new IdleState());
         }
     }
 }
Esempio n. 14
0
 private void BlockStunned()
 {
     if (blockDuration > 0)
     {
         Debug.Log("Still Blocking");
         blockDuration -= 1.5f * Time.fixedDeltaTime;
     }
     else
     {
         //character.ChangeState(new IdleState());
         if (character.inputs.crouch.ReadValue <float>() != 0)
         {
             Debug.Log("Maintain crouch from block");
             character.anim.SetBool("IsCrouching", true);
             character.ChangeState(new CrouchState());
         }
         else
         {
             character.ChangeState(new IdleState());
         }
     }
 }
Esempio n. 15
0
 public void RoundStart()
 {
     audio.Play("Fight");
     roundEnded = false;
     camera.EnableWalls();
     p1.ChangeState(new IdleState());
     p1.stats.GainMeter(100);
     p2.ChangeState(new IdleState());
     if (p2.GetComponent <PlayerInput>())
     {
         Destroy(p2.GetComponent <PlayerInput>());
     }
 }
Esempio n. 16
0
    public void Execute()
    {
        if (character.IsLanding() && character.rb.velocity.y <= 0)
        {
            character.ChangeState(new IdleState());
        }

        if (!character.airAttackPerformed)
        {
            character.HandleAttackPress();
        }

        Debug.Log("Velocity " + character.rb.velocity.normalized);
        Debug.DrawRay(character.transform.position, character.rb.velocity.normalized);
    }