Ejemplo n.º 1
0
    void Start()
    {
        if (Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsEditor)
        {
            ControllerInputManager.UseWindows();
        }
        else if (Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.OSXEditor)
        {
            ControllerInputManager.UseMac();
        }
        else if (Application.platform == RuntimePlatform.WebGLPlayer)
        {
            if (isSafari())
            {
                ControllerInputManager.UseWebMac();
                Debug.Log("Safari detected");
            }
            else
            {
                ControllerInputManager.UseWindows();
                Debug.Log("No Safari detected");
            }
        }
        if (isOneGamepadConnected())
        {
            InputManager.UseController();
            ui.SetGamepadUI();
            isController = true;
        }
        else
        {
            InputManager.UseKeyboard();
            ui.SetKeyboardUI();
            isController = false;
        }

        InvokeRepeating("CheckPlattform", 0.2f, 3f);
    }