void OnGUI()
    {
        int x = 300;

        for (int index = 1; index <= 4; ++index)
        {
            if (GUI.Button(new Rect(x, 60, 50, 30), string.Format("JOY{0}", index)))
            {
                OuyaExampleCommon.Player = (OuyaSDK.OuyaPlayer)index;
                UpdatePlayerButtons();
            }
            x += 52;
        }

        x = 300;
        for (int index = 5; index <= 8; ++index)
        {
            if (GUI.Button(new Rect(x, 100, 50, 30), string.Format("JOY{0}", index)))
            {
                OuyaExampleCommon.Player = (OuyaSDK.OuyaPlayer)index;
                UpdatePlayerButtons();
            }
            x += 52;
        }

        if (GUI.Button(new Rect(300, 140, 200, 20), m_inputToggle ? "[Toggle Unity Input]" : "Toggle Unity Input"))
        {
            m_inputToggle = !m_inputToggle;
            OuyaSDK.enableUnityInput(m_inputToggle);
        }

        /*
         * // prototyping
         * GUILayout.BeginHorizontal();
         * GUILayout.Space(600);
         * m_useSDKForInput = GUILayout.Toggle(m_useSDKForInput, "Use OuyaSDK Mappings and Unity Input", GUILayout.MinHeight(45));
         * GUILayout.EndHorizontal();
         */
    }
Esempio n. 2
0
 void Awake()
 {
     m_instance = this;
     OuyaSDK.enableUnityInput(true);
 }