Exemple #1
0
        /// <summary>
        /// コントローラーの操作
        /// </summary>
        virtual protected Vector3 ControllerControl(GameController con)
        {
            Vector3 tryMove = Vector3.zero;

            if (con.Move(Direction.Left))
            {
                tryMove   += Vector3Int.left;
                _direction = Direction.Left;
            }
            if (con.Move(Direction.Right))
            {
                tryMove   += Vector3Int.right;
                _direction = Direction.Right;
            }
            if (con.Move(Direction.Front))
            {
                tryMove   += Vector3Int.up;
                _direction = Direction.Front;
            }
            if (con.Move(Direction.Back))
            {
                tryMove   += Vector3Int.down;
                _direction = Direction.Back;
            }

            return(tryMove);
        }
Exemple #2
0
        /// <summary>
        /// コントローラーの操作
        /// </summary>
        private Vector3 ControllerControl(GameController con)
        {
            Vector3 tryMove = Vector3.zero;

            if (con.Move(Direction.Left))
            {
                tryMove += Vector3Int.left;
            }
            if (con.Move(Direction.Right))
            {
                tryMove += Vector3Int.right;
            }
            if (con.Move(Direction.Front))
            {
                tryMove += Vector3Int.up;
            }
            if (con.Move(Direction.Back))
            {
                tryMove += Vector3Int.down;
            }

            return(tryMove);
        }
Exemple #3
0
    // Update is called once per frame
    void Update()
    {
        if (con.GetConnectFlag())
        {
            if (con.ButtonDown(Play.Button.A))
            {
                Debug.Log("A");
            }
            if (con.ButtonDown(Play.Button.B))
            {
                Debug.Log("B");
            }
            if (con.ButtonDown(Play.Button.X))
            {
                Debug.Log("X");
            }
            if (con.ButtonDown(Play.Button.Y))
            {
                Debug.Log("Y");
            }
            if (con.ButtonDown(Play.Button.L1))
            {
                Debug.Log("L1");
            }
            if (con.ButtonDown(Play.Button.R1))
            {
                Debug.Log("R1");
            }
            if (con.ButtonDown(Play.Button.BACK))
            {
                Debug.Log("BACK");
            }
            if (con.ButtonDown(Play.Button.START))
            {
                Debug.Log("START");
            }
            if (con.ButtonDown(Play.Button.L3))
            {
                Debug.Log("L3");
            }
            if (con.ButtonDown(Play.Button.R3))
            {
                Debug.Log("R3");
            }

            // バグになる呼び出し
            if (con.ButtonDown(Play.Button.R3 + 1))
            {
                Debug.Log("R3");
            }

            if (con.Move(Direction.Front))
            {
                Debug.Log("UP");
            }
            if (con.Move(Direction.Back))
            {
                Debug.Log("DOWN");
            }
            if (con.Move(Direction.Left))
            {
                Debug.Log("LEFT");
            }
            if (con.Move(Direction.Right))
            {
                Debug.Log("RIGHT");
            }
        }
        else
        {
            Debug.Log("つっかえ!");
        }
    }