Beispiel #1
0
    private void Start()
    {
        playerController = GetComponent <PlayerController>();
        property         = GetComponent <PlayerStatus>();
        bubbleShooting   = GetComponent <PlayerBubbleShooting>();
        playerNum        = property.Num;

        attackButtonState = AttackButtonState.NoInput;
    }
Beispiel #2
0
    public void update(bool pushed)
    {
        changeColor(pushed);

        if (pushed)
        {
            state = AttackButtonState.ATTACK;
        }
        else
        {
            state = AttackButtonState.NONE;
        }
    }
Beispiel #3
0
 public void SetAttackAnimation(AttackButtonState _attackButtonState)
 {
     if (_attackButtonState == AttackButtonState.ButtonDown)
     {
         animator.SetBool("Attacking", true);
     }
     if (_attackButtonState == AttackButtonState.ButtonKeep)
     {
         animator.speed = 0.5f;
     }
     if (_attackButtonState == AttackButtonState.ButtonUp)
     {
         animator.speed = 1;
         animator.SetBool("Attacking", false);
     }
 }
Beispiel #4
0
    private void Update()
    {
        //左スティック
        leftXAsisInput = GamePad.GetAxis(GamePad.Axis.LeftStick, (GamePad.Index)playerNum).x;
        leftYAsisInput = GamePad.GetAxis(GamePad.Axis.LeftStick, (GamePad.Index)playerNum).y;

        //右スティック
        rightXAsisInput = GamePad.GetAxis(GamePad.Axis.RightStick, (GamePad.Index)playerNum).x;
        //y軸を反転させる
        rightYAsisInput = -GamePad.GetAxis(GamePad.Axis.RightStick, (GamePad.Index)playerNum).y;

        //攻撃ボタン
        if (GamePad.GetButtonDown(GamePad.Button.RightShoulder, (GamePad.Index)playerNum))
        {
            bubbleShooting.CreateTheBubbleSet();
            attackButtonState = AttackButtonState.ButtonDown;
            bubbleShooting.SetAttackAnimation(attackButtonState);
        }
        if (GamePad.GetButton(GamePad.Button.RightShoulder, (GamePad.Index)playerNum))
        {
            //長押しの時かつ泡が一定の大きさ以上の時は、移動を禁止させる
            isOverMoveableSize = bubbleShooting.CheckIsBubbleOverMoveableSize();
            bubbleShooting.ChangeTheBubbleScale();
            attackButtonState = AttackButtonState.ButtonKeep;

            bubbleShooting.SetAttackAnimation(attackButtonState);
        }
        if (GamePad.GetButtonUp(GamePad.Button.RightShoulder, (GamePad.Index)playerNum))
        {
            bubbleShooting.TurnOnThePushFlag();
            //ボタンを離したとき、移動を回復させる
            isOverMoveableSize = false;

            attackButtonState = AttackButtonState.ButtonUp;
            bubbleShooting.SetAttackAnimation(attackButtonState);
        }
        if (GamePad.GetButtonUp(GamePad.Button.A, (GamePad.Index)playerNum))
        {
            playerController.Jump();
        }
    }