Setup() public static method

public static Setup ( ) : void
return void
コード例 #1
0
        void OnEnable()
        {
            if (logDebugInfo)
            {
                Debug.Log("InControl (version " + InputManager.Version + ")");
                Logger.OnLogMessage += LogMessage;
            }

            InputManager.InvertYAxis  = invertYAxis;
            InputManager.EnableXInput = enableXInput;
            InputManager.Setup();

            foreach (var className in customProfiles)
            {
                var classType = Type.GetType(className);
                if (classType == null)
                {
                    Debug.LogError("Cannot find class for custom profile: " + className);
                }
                else
                {
                    var customProfileInstance = Activator.CreateInstance(classType) as UnityInputDeviceProfile;
                    InputManager.AttachDevice(new UnityInputDevice(customProfileInstance));
                }
            }

            if (dontDestroyOnLoad)
            {
                DontDestroyOnLoad(this);
            }
        }
コード例 #2
0
        void Start()
        {
            isPaused       = false;
            Time.timeScale = 1.0f;

            Logger.OnLogMessage += logMessage => logMessages.Add(logMessage);

//			InputManager.HideDevicesWithProfile( typeof( Xbox360MacProfile ) );
//			InputManager.InvertYAxis = true;
//			InputManager.EnableXInput = true;
            InputManager.Setup();

            InputManager.OnDeviceAttached      += inputDevice => Debug.Log("Attached: " + inputDevice.Name);
            InputManager.OnDeviceDetached      += inputDevice => Debug.Log("Detached: " + inputDevice.Name);
            InputManager.OnActiveDeviceChanged += inputDevice => Debug.Log("Active device changed to: " + inputDevice.Name);

            TestInputMappings();

            Debug.Log("InControl (version " + InputManager.Version + ")");
        }
コード例 #3
0
        void OnEnable()
        {
            InputManager.Setup();

            foreach (var className in customProfiles)
            {
                var classType = Type.GetType(className);
                if (classType == null)
                {
                    Debug.LogError("Cannot find class for custom profile: " + className);
                }
                else
                {
                    var customProfileInstance = Activator.CreateInstance(classType) as UnityInputDeviceProfile;
                    InputManager.AttachDevice(new UnityInputDevice(customProfileInstance));
                }
            }

            Debug.Log("InControl (version " + InputManager.Version + ")");
        }