Ejemplo n.º 1
0
 /// <summary>
 /// スティックでY軸の視点移動
 /// </summary>
 static public void StickY(Transform playerTransform)
 {
     rotateStick = SwitchInput.GetHorizontal(0);
     playerTransform.Rotate(0,
                            rotateStick * ViewpointMovementConfig.GetInstance().GetRotationSpeed() * Time.deltaTime,
                            0);
 }
Ejemplo n.º 2
0
    /// <summary>
    /// 移動処理
    /// </summary>
    void Move()
    {
        float vertical   = SwitchInput.GetVertical(0);
        float horizontal = SwitchInput.GetHorizontal(0);

        rigidbody.MovePosition(transform.position +
                               (transform.forward * vertical + transform.right * horizontal) * moveSpeed * Time.deltaTime);
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 移動処理
    /// </summary>
    void Movement()
    {
        float horizontal = SwitchInput.GetHorizontal(m_ThisPlayerNumber);
        float vertical   = SwitchInput.GetVertical(m_ThisPlayerNumber);

        //移動量の加算
        m_MoveValue += new Vector2(horizontal, vertical);
    }
Ejemplo n.º 4
0
 private void FixedUpdate()
 {
     if (!GameOver && GameStart && !FieldManeger.Instance.Pause_Flg)
     {
         if (Mathf.Abs(SwitchInput.GetVertical(playerNumber)) >= 0.4f || Mathf.Abs(SwitchInput.GetHorizontal(playerNumber)) >= 0.4f)
         {
             //=====移動=====
             this.transform.Translate(Vector3.forward * walkSpeed * Time.deltaTime);
             //=====回転=====
             this.transform.rotation = Quaternion.LookRotation(transform.position +
                                                               (Vector3.forward * SwitchInput.GetVertical(playerNumber)) +
                                                               (Vector3.right * SwitchInput.GetHorizontal(playerNumber)) - transform.position);
         }
     }
     //重力
     rb.AddForce(Vector3.down * 60f);
 }