Upgrading to Unity 5.3.3p2 from 5.3.2 broke things

More
3 years 3 months ago - 3 years 3 months ago #1308 by kylerwk
Hello,

Just tried upgrading to Unity 5.3.3p2 from 5.3.2. I'm using 2.6.4 F3

I'm getting lots of errors like this in the console. And I am not able to look at any localization inspectors for objects in my scene. Only when the scene is running do the Localization inspectors show up.

I also can't even see the global source in an inspector until I run the game once.

Hopefully you can fix this soon!

The localization in the game seem to work.

InvalidOperationException: The following game object is invoking the DontDestroyOnLoad method: I2ResourceManager. Notice that DontDestroyOnLoad can only be used in play mode and, as such, cannot be part of an editor script.
I2.Loc.ResourceManager.get_pInstance () (at Assets/I2/Localization/Scripts/ResourceManager.cs:23)
I2.Loc.LocalizationManager.RegisterSourceInResources () (at Assets/I2/Localization/Scripts/LocalizationManager.cs:283)
I2.Loc.LocalizationManager.UpdateSources () (at Assets/I2/Localization/Scripts/LocalizationManager.cs:255)
I2.Loc.LocalizeInspector.OnEnable () (at Assets/I2/Localization/Scripts/Editor/Inspectors/LocalizeInspector.cs:55)

and

InvalidOperationException: The following game object is invoking the DontDestroyOnLoad method: I2ResourceManager. Notice that DontDestroyOnLoad can only be used in play mode and, as such, cannot be part of an editor script.
I2.Loc.ResourceManager.get_pInstance () (at Assets/I2/Localization/Scripts/ResourceManager.cs:23)
I2.Loc.LocalizationManager.RegisterSourceInResources () (at Assets/I2/Localization/Scripts/LocalizationManager.cs:283)
I2.Loc.LocalizationManager.UpdateSources () (at Assets/I2/Localization/Scripts/LocalizationManager.cs:255)
I2.Loc.LocalizationManager.InitializeIfNeeded () (at Assets/I2/Localization/Scripts/LocalizationManager.cs:101)
I2.Loc.LocalizationManager.get_CurrentLanguage () (at Assets/I2/Localization/Scripts/LocalizationManager.cs:14)
I2.Loc.Localize.OnLocalize (Boolean Force) (at Assets/I2/Localization/Scripts/Localize.cs:118)
I2.Loc.LocalizeInspector.OnDisable () (at Assets/I2/Localization/Scripts/Editor/Inspectors/LocalizeInspector.cs:87)


and

InvalidOperationException: The following game object is invoking the DontDestroyOnLoad method: I2ResourceManager. Notice that DontDestroyOnLoad can only be used in play mode and, as such, cannot be part of an editor script.
I2.Loc.ResourceManager.get_pInstance () (at Assets/I2/Localization/Scripts/ResourceManager.cs:23)
I2.Loc.LocalizationManager.RegisterSourceInResources () (at Assets/I2/Localization/Scripts/LocalizationManager.cs:283)
I2.Loc.LocalizationManager.UpdateSources () (at Assets/I2/Localization/Scripts/LocalizationManager.cs:255)
I2.Loc.LocalizeInspector.OnInspectorGUI () (at Assets/I2/Localization/Scripts/Editor/Inspectors/LocalizeInspector.cs:116)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1231)
UnityEditor.DockArea:OnGUI()



and

Unexpected top level layout group! Missing GUILayout.EndScrollView/EndVertical/EndHorizontal?
UnityEditor.DockArea:OnGUI()
Last edit: 3 years 3 months ago by kylerwk. Reason: grammar

Please Log in or Create an account to join the conversation.

More
3 years 3 months ago #1309 by Frank
Hi,
Thanks for reporting this issue. Seems that in the newest unity versions, DontDestroyOnLoad are enforced better :-)

You can fix it by replacing the pInstance property by the following code:
(ResourceManager.cs line 10-30)
		public static ResourceManager pInstance
		{
			get {
				bool changed = mInstance==null;

				if (mInstance==null)
					mInstance = (ResourceManager)Object.FindObjectOfType(typeof(ResourceManager));

				if (mInstance==null)
				{
					GameObject GO = new GameObject("I2ResourceManager", typeof(ResourceManager));
					GO.hideFlags = GO.hideFlags | HideFlags.HideAndDontSave;	// Only hide it if this manager was autocreated
					mInstance = GO.GetComponent<ResourceManager>();
				}

				if (changed && Application.isPlaying)
					DontDestroyOnLoad(mInstance.gameObject);

				return mInstance;
			}
		}
		static ResourceManager mInstance;

Also, you can get that fix and a few others by downloading v2.6.5a2 version from the beta folder.

Hope that helps,
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

More
3 years 3 months ago #1310 by kylerwk
Thanks Frank! That fixed it right up!

Please Log in or Create an account to join the conversation.

Time to create page: 0.120 seconds
Template by JoomlaShine