コード例 #1
0
    public void PlayWinning()
    {
        GameSaveStateController.GetInstance().GeneratePlayWinAudio();
        playerState = PlayerAction.Won;
        //playerDummyState = PlayerDummyAction.Won;
        Animator animation = animator.GetComponent <Animator>();

        Dummy = true;
        animation.Play(CHAR_WINNING);
    }
コード例 #2
0
    protected override void PlayAttack()
    {
        GameSaveStateController.GetInstance().GeneratePlayWeaponMoveAudio();
        Animator animation = animator.GetComponent <Animator>();

        if (FacingRight)
        {
            animation.Play(BOSS_ONE_ATTACK);
        }
        else
        {
            animation.Play(BOSS_ONE_ATTACK_L);
        }
    }
コード例 #3
0
 public void Jump()
 {
     if ((!Dummy || playerDummyState == PlayerDummyAction.Tutorial) && Input.GetKeyDown(GameController.JUMP))
     {
         //Jump
         GameSaveStateController.GetInstance().GeneratePlayJumpAudio();
         //obj.GetComponent<PlaySoundController>().PlayAudioSource();
         playerState = PlayerAction.Jump;
         Animator animation = animator.GetComponent <Animator>();
         if (facingRight)
         {
             animation.Play(JUMP_AN);
         }
         else
         {
             animation.Play(JUMP_AN_L);
         }
     }
 }
コード例 #4
0
 public void Attack()
 {
     if (!Dummy || playerDummyState == PlayerDummyAction.Tutorial)
     {
         if (Weapon.Bare == chosenWeapon)
         {
             if (Input.GetKeyDown(GameController.ATTACK_1))
             {
                 playerState = PlayerAction.Punch;
                 Attack(true);
             }
             else if (Input.GetKeyDown(GameController.ATTACK_2))
             {
                 playerState = PlayerAction.Kick;
                 Attack(false);
                 MoveTransform(facingRight? Vector2.right: Vector2.left, 3);
             }
         }
         else
         {
             if (Input.GetKeyDown(GameController.ATTACK_1) || Input.GetKeyDown(GameController.ATTACK_2))
             {
                 if (Weapon.Pike == chosenWeapon)
                 {
                     playerState = PlayerAction.Pike;
                     AttackWeapon(true);
                     GameSaveStateController.GetInstance().GeneratePlayWeaponMoveAudio();
                 }
                 else
                 {
                     playerState = PlayerAction.Axe;
                     AttackWeapon(false);
                     GameSaveStateController.GetInstance().GeneratePlayWeaponMoveAudio();
                 }
             }
         }
     }
 }