Beispiel #1
0
 void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
     }
 }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        hAxis = Input.GetAxis("J" + myPlyrNmb.ToString() + "Horizontal");
        vAxis = Input.GetAxis("J" + myPlyrNmb.ToString() + "Vertical");

        aButtonDown = Input.GetButtonDown("J" + myPlyrNmb.ToString() + "A");
        aButtonUp   = Input.GetButtonUp("J" + myPlyrNmb.ToString() + "A");
        bButton     = Input.GetButtonDown("J" + myPlyrNmb.ToString() + "B");
        startButton = Input.GetButtonDown("J" + myPlyrNmb.ToString() + "Start");


        leftTrigger  = Input.GetAxis("J" + myPlyrNmb.ToString() + "LeftTrigger");
        rightTrigger = Input.GetAxis("J" + myPlyrNmb.ToString() + "RightTrigger");

        MoveManager();
        GrabManager();

        if (startButton)
        {
            UIManagerIG.Instance().TogglePause(myPlyrNmb);
        }
    }