// For testing, we want the ability to push/pop system state even in the player. // However, we don't want it in release players. #if DEVELOPMENT_BUILD || UNITY_EDITOR internal static void Reset() { #if UNITY_EDITOR if (s_SystemObject != null) { UnityEngine.Object.DestroyImmediate(s_SystemObject); } s_SystemObject = ScriptableObject.CreateInstance <InputSystemObject>(); s_Manager = s_SystemObject.manager; s_Remote = s_SystemObject.remote; #else if (s_Manager != null) { s_Manager.Destroy(); } ////TODO: reset remote InitializeInPlayer(); #endif }
private static void InitializeInEditor() { var existingSystemObjects = Resources.FindObjectsOfTypeAll <InputSystemObject>(); if (existingSystemObjects != null && existingSystemObjects.Length > 0) { s_SystemObject = existingSystemObjects[0]; s_SystemObject.ReviveAfterDomainReload(); s_Manager = s_SystemObject.manager; s_Remote = s_SystemObject.remote; InputDebuggerWindow.ReviveAfterDomainReload(); } else { Reset(); } EditorApplication.playModeStateChanged += OnPlayModeChange; }