Переглянути джерело

[unity] Minor fix for EditorInstantiation.NewGameObject

pharan 6 роки тому
батько
коміт
9e7783e4c2

+ 4 - 5
spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs

@@ -38,11 +38,11 @@
 #define NEWPLAYMODECALLBACKS
 #define NEWPLAYMODECALLBACKS
 #endif
 #endif
 
 
-#if UNITY_2018_3 || UNITY_2019
+#if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER
 #define NEW_PREFAB_SYSTEM
 #define NEW_PREFAB_SYSTEM
 #endif
 #endif
 
 
-#if UNITY_2018 || UNITY_2019
+#if UNITY_2018 || UNITY_2019 || UNITY_2018_3_OR_NEWER
 #define NEWHIERARCHYWINDOWCALLBACKS
 #define NEWHIERARCHYWINDOWCALLBACKS
 #endif
 #endif
 
 
@@ -53,7 +53,6 @@ using System.IO;
 using System.Text;
 using System.Text;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
-using Spine;
 
 
 namespace Spine.Unity.Editor {
 namespace Spine.Unity.Editor {
 	using EventType = UnityEngine.EventType;
 	using EventType = UnityEngine.EventType;
@@ -1306,7 +1305,7 @@ namespace Spine.Unity.Editor {
 			/// <summary>Handles creating a new GameObject in the Unity Editor. This uses the new ObjectFactory API where applicable.</summary>
 			/// <summary>Handles creating a new GameObject in the Unity Editor. This uses the new ObjectFactory API where applicable.</summary>
 			public static GameObject NewGameObject (string name) {
 			public static GameObject NewGameObject (string name) {
 				#if NEW_PREFAB_SYSTEM
 				#if NEW_PREFAB_SYSTEM
-				return ObjectFactory.CreateGameObject(gameObjectName);
+				return ObjectFactory.CreateGameObject(name);
 				#else
 				#else
 				return new GameObject(name);
 				return new GameObject(name);
 				#endif
 				#endif
@@ -1315,7 +1314,7 @@ namespace Spine.Unity.Editor {
 			/// <summary>Handles creating a new GameObject in the Unity Editor. This uses the new ObjectFactory API where applicable.</summary>
 			/// <summary>Handles creating a new GameObject in the Unity Editor. This uses the new ObjectFactory API where applicable.</summary>
 			public static GameObject NewGameObject (string name, params System.Type[] components) {
 			public static GameObject NewGameObject (string name, params System.Type[] components) {
 				#if NEW_PREFAB_SYSTEM
 				#if NEW_PREFAB_SYSTEM
-				return ObjectFactory.CreateGameObject(gameObjectName, components);
+				return ObjectFactory.CreateGameObject(name, components);
 				#else
 				#else
 				return new GameObject(name, components);
 				return new GameObject(name, components);
 				#endif
 				#endif