diff --git a/XboxCtrlrInput/Assets/Plugins/XboxCtrlrInput.cs b/XboxCtrlrInput/Assets/Plugins/XboxCtrlrInput.cs index af5975f..70dae0b 100644 --- a/XboxCtrlrInput/Assets/Plugins/XboxCtrlrInput.cs +++ b/XboxCtrlrInput/Assets/Plugins/XboxCtrlrInput.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.SceneManagement; using XInputDotNetPure; namespace XboxCtrlrInput @@ -1006,26 +1007,19 @@ private static bool OnMac() // http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/OsxDriver // http://wiki.unity3d.com/index.php?title=Xbox360Controller return (Application.platform == RuntimePlatform.OSXEditor || - Application.platform == RuntimePlatform.OSXPlayer || - Application.platform == RuntimePlatform.OSXWebPlayer); + Application.platform == RuntimePlatform.OSXPlayer ); } private static bool OnWindows() { return (Application.platform == RuntimePlatform.WindowsEditor || - Application.platform == RuntimePlatform.WindowsPlayer || - Application.platform == RuntimePlatform.WindowsWebPlayer); + Application.platform == RuntimePlatform.WindowsPlayer ); } - - private static bool OnWindowsWebPlayer() - { - return (Application.platform == RuntimePlatform.WindowsWebPlayer); - } - - private static bool OnWindowsNative() + + private static bool OnWindowsNative() { return (Application.platform == RuntimePlatform.WindowsEditor || - Application.platform == RuntimePlatform.WindowsPlayer); + Application.platform == RuntimePlatform.WindowsPlayer ); } private static bool OnLinux() @@ -1755,10 +1749,21 @@ void Awake() DontDestroyOnLoad(this.gameObject); } - void OnLevelWasLoaded(int level) - { - this.ResetTriggerTouches(); - } + void OnEnable() + { + SceneManager.sceneLoaded += OnSceneFinishedLoading; + } + + void OnDisable() + { + SceneManager.sceneLoaded -= OnSceneFinishedLoading; + } + + // Callback made to replace obsolete method OnLevelWasLoaded(int) + void OnSceneFinishedLoading(Scene currentScene, LoadSceneMode mode) + { + this.ResetTriggerTouches(); + } void OnApplicationFocus(bool isWindowInFocusNow) { diff --git a/XboxCtrlrInput/Assets/XboxCtrlrInputExample/MovePlayer.cs b/XboxCtrlrInput/Assets/XboxCtrlrInputExample/MovePlayer.cs index 2a0c6fe..18fde2b 100644 --- a/XboxCtrlrInput/Assets/XboxCtrlrInputExample/MovePlayer.cs +++ b/XboxCtrlrInput/Assets/XboxCtrlrInputExample/MovePlayer.cs @@ -1,5 +1,5 @@ using UnityEngine; -using System.Collections; +using UnityEngine.SceneManagement; using XboxCtrlrInput; // Be sure to include this if you want an object to have Xbox input public class MovePlayer : MonoBehaviour @@ -243,7 +243,7 @@ void OnTriggerEnter(Collider other) { if(other.gameObject.CompareTag("KillField")) { - Application.LoadLevel(Application.loadedLevel); + SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); } } diff --git a/XboxCtrlrInput/Assets/XboxCtrlrInputExample/Test Level Scripts.meta b/XboxCtrlrInput/Assets/XboxCtrlrInputExample/Test Level Scripts.meta deleted file mode 100644 index 41b3555..0000000 --- a/XboxCtrlrInput/Assets/XboxCtrlrInputExample/Test Level Scripts.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 8242e56b77d8a4db68327a41ca717a55 -folderAsset: yes -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/XboxCtrlrInput/ProjectSettings/ProjectVersion.txt b/XboxCtrlrInput/ProjectSettings/ProjectVersion.txt index e040c5c..66e05aa 100644 --- a/XboxCtrlrInput/ProjectSettings/ProjectVersion.txt +++ b/XboxCtrlrInput/ProjectSettings/ProjectVersion.txt @@ -1,2 +1 @@ -m_EditorVersion: 5.2.0f3 -m_StandardAssetsVersion: 0 +m_EditorVersion: 5.5.0f3 diff --git a/XboxCtrlrInput/ProjectSettings/UnityAdsSettings.asset b/XboxCtrlrInput/ProjectSettings/UnityAdsSettings.asset deleted file mode 100644 index 224050c..0000000 --- a/XboxCtrlrInput/ProjectSettings/UnityAdsSettings.asset +++ /dev/null @@ -1,11 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!292 &1 -UnityAdsSettings: - m_ObjectHideFlags: 0 - m_Enabled: 0 - m_InitializeOnStartup: 1 - m_TestMode: 0 - m_EnabledPlatforms: 4294967295 - m_IosGameId: - m_AndroidGameId: diff --git a/XboxCtrlrInput/ProjectSettings/UnityAnalyticsManager.asset b/XboxCtrlrInput/ProjectSettings/UnityAnalyticsManager.asset deleted file mode 100644 index 4a7b668..0000000 --- a/XboxCtrlrInput/ProjectSettings/UnityAnalyticsManager.asset +++ /dev/null @@ -1,10 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!303 &1 -UnityAnalyticsManager: - m_ObjectHideFlags: 0 - m_Enabled: 0 - m_InitializeOnStartup: 1 - m_TestMode: 0 - m_TestEventUrl: - m_TestConfigUrl: diff --git a/XboxCtrlrInput/ProjectSettings/UnityConnectSettings.asset b/XboxCtrlrInput/ProjectSettings/UnityConnectSettings.asset index 9b7a578..2943e44 100755 --- a/XboxCtrlrInput/ProjectSettings/UnityConnectSettings.asset +++ b/XboxCtrlrInput/ProjectSettings/UnityConnectSettings.asset @@ -3,6 +3,14 @@ --- !u!310 &1 UnityConnectSettings: m_ObjectHideFlags: 0 + m_Enabled: 0 + m_TestMode: 0 + m_TestEventUrl: + m_TestConfigUrl: + CrashReportingSettings: + m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes + m_Enabled: 0 + m_CaptureEditorExceptions: 1 UnityPurchasingSettings: m_Enabled: 0 m_TestMode: 0 @@ -12,3 +20,10 @@ UnityConnectSettings: m_TestMode: 0 m_TestEventUrl: m_TestConfigUrl: + UnityAdsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_EnabledPlatforms: 4294967295 + m_IosGameId: + m_AndroidGameId: