void InitInputProvider() { InputProviderEvent e = new InputProviderEvent(); if (InputSimulatorCore.isSimulating) { e.inputProviderPrefab = inputSimulatorProviderPrefab; } else { if (IsTouchScreenPlatform(Application.platform)) { e.inputProviderPrefab = touchInputProviderPrefab; } else { e.inputProviderPrefab = mouseInputProviderPrefab; //trackpadInputProviderPrefab; } } // let other scripts on the same game object override the e.inputProviderPrefab if they want to install a different one gameObject.SendMessage("OnSelectInputProvider", e, SendMessageOptions.DontRequireReceiver); // install it InstallInputProvider(e.inputProviderPrefab); }
void InitInputProvider() { InputProviderEvent e = new InputProviderEvent(); if (IsTouchScreenPlatform(UnityEngine.Application.platform)) { e.inputPrefab = touchInputPrefab; } else { e.inputPrefab = mouseInputPrefab; } InstallInputProvider(e.inputPrefab); }
void InitInputProvider() { InputProviderEvent e = new InputProviderEvent(); switch (Application.platform) { case RuntimePlatform.Android: case RuntimePlatform.IPhonePlayer: e.inputProviderPrefab = touchInputProviderPrefab; break; default: e.inputProviderPrefab = mouseInputProviderPrefab; break; } // let other scripts on the same game object override the e.inputProviderPrefab if they want to install a different one gameObject.SendMessage("OnSelectInputProvider", e, SendMessageOptions.DontRequireReceiver); // install it InstallInputProvider(e.inputProviderPrefab); }