Inheritance: UnityEngine.MonoBehaviour
コード例 #1
0
        void OnEnable()
        {
            if (instance == null)
            {
                instance = this;

                if (dontDestroyOnLoad)
                {
                    DontDestroyOnLoad(this);
                }
            }
            else if (this != instance)
            {
                isBeingDestroyed = true; //If destroying, we don't want to reset the InputManager
                Destroy(gameObject);
            }

            if (logDebugInfo)
            {
                Debug.Log("InControl (version " + InputManager.Version + ")");
                Logger.OnLogMessage += HandleOnLogMessage;
            }

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

            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 OnEnable()
        {
            if (originalInstance != null && originalInstance != this)
            {
                //Remove the duplicate
                Destroy(this.gameObject);
                return;
            }
            originalInstance = this;
            if (logDebugInfo)
            {
                Debug.Log("InControl (version " + InputManager.Version + ")");
                Logger.OnLogMessage += HandleOnLogMessage;
            }

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

            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);
            }
        }
コード例 #3
0
ファイル: InputManager.cs プロジェクト: thexdesk/mist-ridge
 public InputManager(
     Input.Factory inputFactory,
     InControl.InControlManager inControlManager)
 {
     this.inputFactory = inputFactory;
 }
コード例 #4
0
        void OnEnable()
        {
            if (instance == null)
            {
                instance = this;

                if (dontDestroyOnLoad)
                {
                    DontDestroyOnLoad(this);
                }
            }
            else if (this != instance)
            {
                isBeingDestroyed = true; //If destroying, we don't want to reset the InputManager
                Destroy(gameObject);
            }

            if (logDebugInfo)
            {
                Debug.Log( "InControl (version " + InputManager.Version + ")" );
                Logger.OnLogMessage += HandleOnLogMessage;
            }

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

            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 );
            }
        }
コード例 #5
0
 // Use this for initialization
 void Start()
 {
     manager = GetComponent <InControl.InControlManager>();
 }