From ac9a877105ee3a8a1c13a273513c7a9cd96cb6eb Mon Sep 17 00:00:00 2001 From: qingqing-zhao Date: Thu, 29 Mar 2018 21:44:22 +0800 Subject: [PATCH] define use unity 2017 --- KSFramework/Assets/Editor/KSFrameworkTests.cs | 2 +- .../Plugins/KSFramework/Editor/KSFrameworkEditor.cs | 8 ++++---- .../Plugins/KSFramework/Modules/UI/UGUISLuaBridge.cs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/KSFramework/Assets/Editor/KSFrameworkTests.cs b/KSFramework/Assets/Editor/KSFrameworkTests.cs index 379ea1c4..813c2e8b 100644 --- a/KSFramework/Assets/Editor/KSFrameworkTests.cs +++ b/KSFramework/Assets/Editor/KSFrameworkTests.cs @@ -1,4 +1,4 @@ -#if UNITY_5 +#if UNITY_5 || UNITY_2017_1_OR_NEWER using System.IO; using KEngine; using KSFramework; diff --git a/KSFramework/Assets/Plugins/KSFramework/Editor/KSFrameworkEditor.cs b/KSFramework/Assets/Plugins/KSFramework/Editor/KSFrameworkEditor.cs index 20600087..28599d1c 100644 --- a/KSFramework/Assets/Plugins/KSFramework/Editor/KSFrameworkEditor.cs +++ b/KSFramework/Assets/Plugins/KSFramework/Editor/KSFrameworkEditor.cs @@ -4,7 +4,7 @@ using KEngine; using KEngine.UI; using UnityEditor; -#if UNITY_5 +#if UNITY_5 || UNITY_2017_1_OR_NEWER using UnityEditor.SceneManagement; #endif @@ -61,7 +61,7 @@ public static void OpenLastScene() if (!string.IsNullOrEmpty(lastScene)) { -#if UNITY_5 +#if UNITY_5 || UNITY_2017_1_OR_NEWER EditorSceneManager.OpenScene(lastScene); #else EditorApplication.OpenScene(lastScene); @@ -77,7 +77,7 @@ public static void OpenLastScene() [MenuItem("KEngine/Open Main Scene %&i")] public static void OpenMainScene() { -#if UNITY_5 +#if UNITY_5 || UNITY_2017_1_OR_NEWER var currentScene = EditorSceneManager.GetActiveScene().path; #else var currentScene = EditorApplication.currentScene; @@ -87,7 +87,7 @@ public static void OpenMainScene() EditorPrefs.SetString(LastScenePrefKey, currentScene); Log.Info("Open Main Game Scene!"); -#if UNITY_5 +#if UNITY_5 || UNITY_2017_1_OR_NEWER EditorSceneManager.OpenScene(mainScene); #else EditorApplication.OpenScene(mainScene); diff --git a/KSFramework/Assets/Plugins/KSFramework/Modules/UI/UGUISLuaBridge.cs b/KSFramework/Assets/Plugins/KSFramework/Modules/UI/UGUISLuaBridge.cs index 917b8dd8..e9aeb5ca 100644 --- a/KSFramework/Assets/Plugins/KSFramework/Modules/UI/UGUISLuaBridge.cs +++ b/KSFramework/Assets/Plugins/KSFramework/Modules/UI/UGUISLuaBridge.cs @@ -14,7 +14,7 @@ public virtual void InitBridge() { EventSystem = new GameObject("EventSystem").AddComponent(); EventSystem.gameObject.AddComponent(); -#if !UNITY_5 +#if UNITY_4 EventSystem.gameObject.AddComponent(); #else EventSystem.gameObject.GetComponent().forceModuleActive = true;