예제 #1
0
    // Use this for initialization
    void Start()
    {
        this.soundManager = GameObject.Find("GameManager").GetComponent <SoundManager> ();
        anim = GetComponent <Animator> ();
        rb   = GetComponent <Rigidbody2D> ();

        switch (controller)
        {
        case 1:
            controlerID = XboxCtrlrInput.XboxController.First;
            break;

        case 2:
            controlerID = XboxCtrlrInput.XboxController.Second;
            break;

        default:
            controlerID = XboxCtrlrInput.XboxController.First;
            break;
        }
    }
예제 #2
0
    private void Awake()
    {
        if (playerNum == 1)
        {
            if (XboxCtrlrInput.XCI.IsPluggedIn(1))
            {
                controller    = XboxCtrlrInput.XboxController.First;
                hasController = true;
            }
            else
            {
                left  = KeyCode.A;
                right = KeyCode.D;
                up    = KeyCode.W;
                down  = KeyCode.S;

                attack = KeyCode.Space;
            }
        }

        if (playerNum == 2)
        {
            if (XboxCtrlrInput.XCI.IsPluggedIn(2))
            {
                controller    = XboxCtrlrInput.XboxController.Second;
                hasController = true;
            }
            else
            {
                left  = KeyCode.LeftArrow;
                right = KeyCode.RightArrow;
                up    = KeyCode.UpArrow;
                down  = KeyCode.DownArrow;

                attack = KeyCode.RightControl;
            }
        }
    }