Beispiel #1
0
 /// <summary>
 /// 回転処理
 /// </summary>
 void ArmRotation()
 {
     //Rなら開く
     if (SwitchInput.GetButton(m_PlayerNumber, SwitchButton.SR))
     {
         m_RotationValue += m_RotationSpeed * Time.deltaTime;
     }
     //Lなら閉じる
     if (SwitchInput.GetButton(m_PlayerNumber, SwitchButton.SL))
     {
         m_RotationValue -= m_RotationSpeed * Time.deltaTime;
     }
 }
Beispiel #2
0
 public override void LateUpdate()
 {
     if (SwitchInput.GetButton(ballBehaviour.playerIndex, SwitchButton.Brake))
     {
         var velocity = ballBehaviour.thisRigidbody.velocity;
         velocity /= 1 + Time.deltaTime * ballBehaviour.brakePower;
         ballBehaviour.thisRigidbody.velocity = velocity;
         if (SwitchInput.GetButtonDown(ballBehaviour.playerIndex, SwitchButton.Brake) &&
             velocity.magnitude > 1.0f)
         {
             ballBehaviour.brakeSound.Play();
         }
     }
     AdjustNumberUI();
 }
Beispiel #3
0
    //===プレイヤーが持つ爆弾関連===
    void PlayerBomb()
    {
        //体を縮める
        transform.GetChild(1).transform.localScale = new Vector3(Body_Scale, 1.0f, 1.0f);

        //爆弾を生成
        if (SwitchInput.GetButton(playerNumber, SwitchButton.Left) && !Namecheck() && !Hold)
        {
            Hold = true;
        }

        if (Hold)
        {
            //投げる力
            if (Shootpow <= 15.0f)
            {
                Shootpow += 10.0f * Time.deltaTime;
            }
            if (Body_Scale >= 0.5f)
            {
                Body_Scale -= 0.5f * Time.deltaTime;
            }

            Charge.Play();
        }

        //大きくするのを止めて投げる
        if (SwitchInput.GetButtonUp(playerNumber, SwitchButton.Left) && Hold)
        {
            SoundManager.Instance.BombThrow();
            Charge.Stop();
            ShootObject = Instantiate(Bomb, HoldPosition, Quaternion.Euler(0, 0, 0));
            bombObject  = ShootObject;
            //ターゲットの位置
            Target = transform.Find("Circle").transform.position;
            //投げるよ (投げる場所)入ってるよ
            Shoot(Target);
            //持っている物はなし
            ShootObject = null;
            //数値を元に戻す
            Shootpow   = 5.0f;
            Body_Scale = 1;
            Hold       = false;
        }
    }
    /// <summary>
    /// 横の移動
    /// </summary>
    void SideMove()
    {
        bool l = SwitchInput.GetButton(playerNumber, SwitchButton.SL);
        bool r = SwitchInput.GetButton(playerNumber, SwitchButton.SR);

        if (l == r)
        {
            return;
        }
        //減速
        if (l)
        {
            localVelocityX = -sideMoveSpeed;
        }
        //加速
        else //if(r)
        {
            localVelocityX = sideMoveSpeed;
        }
    }