Exemple #1
0
 /// <summary>
 /// Static constructor is called at most one time, before any 
 /// instance constructor is invoked or member is accessed. 
 /// </summary>
 static InputManager()
 {
     // Check to see if an input manager stub exists. If so, associate it.
     // if not, we'll need to create one.
     Core = Component.FindObjectOfType<InputManagerCore>();
     if (Core == null)
     {
     #pragma warning disable 0414
         Core = (new GameObject("InputManagerCore")).AddComponent<InputManagerCore>();
         mIsXboxControllerEnabled = Core.IsXboxControllerEnabled;
     #pragma warning restore 0414
     }
 }
    /// <summary>
    /// Called when the script object is loaded
    /// </summary>
    void OnEnable()
    {
        // Grab the serialized objects
        mInputManagerCore = (InputManagerCore)target;
        mInputManagerCoreSO = new SerializedObject(target);

        // Start up the input manager and set the stub
        InputManager.Core = mInputManagerCore;
    }