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; } }
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(); }
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()); } }
private void ResetCharacter(CharacterController player) { player.ChangeState(new RoundStartState()); player.stats.ResetHp(); player.stats.ResetSuperMeter(); player.anim.SetBool("IsKO", false); }
public void Execute() { if (character.anim.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1 && character.IsGrounded() && character.rb.velocity.y <= 0) { character.ChangeState(new WakeupState()); } }
public void Execute() { if (character.anim.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1) { character.ChangeState(new IdleState()); } }
public void Execute() { if (character.anim.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1 && character.IsLanding() && character.rb.velocity.y <= 0) { character.ChangeState(new IdleState()); } }
public void RoundStart() { audio.Play("Fight"); roundEnded = false; camera.EnableWalls(); p1.ChangeState(new IdleState()); p2.ChangeState(new IdleState()); }
public void Execute() { //Debug.Log("Normalized Time: " + character.anim.GetCurrentAnimatorStateInfo(0).normalizedTime); if (character.anim.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1) { character.ChangeState(new IdleState()); } }
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(); }
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()); } }
public void Execute() { FollowThrowPos(); if (character.anim.GetBool("IsThrown") == false) { character.stats.TakeDamage(atkData.damage); character.ChangeState(new LaunchState()); } }
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()); } } }
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()); } } }
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>()); } }
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); }