hippogamesunity / HeroEditor4DHub

10 stars 0 forks source link

V2.3 assignment errors and "SpriteCollection is null!" exception #23

Closed edougithub closed 3 years ago

edougithub commented 3 years ago

After loading the character editor scene, there are several assignment errors:

image

Saving/loading json creates exception : Exception: SpriteCollection is null! Assets.HeroEditor4D.Common.CharacterScripts.Character.ToJson () (at Assets/ThirdParty/HeroEditor4D/Common/CharacterScripts/CharacterSerializerExperimental.cs:16) Assets.HeroEditor4D.Common.CharacterScripts.Character4D.ToJson () (at Assets/ThirdParty/HeroEditor4D/Common/CharacterScripts/Character4D.cs:52) Assets.HeroEditor4D.Common.EditorScripts.CharacterEditor.SaveToJson () (at Assets/ThirdParty/HeroEditor4D/Common/EditorScripts/CharacterEditor.cs:276) UnityEngine.Events.InvokableCall.Invoke () (at :0) UnityEngine.Events.UnityEvent.Invoke () (at :0) UnityEngine.UI.Button.Press () (at C:/Program Files/Unity/Hub/Editor/2020.1.6f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Button.cs:68) UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/Program Files/Unity/Hub/Editor/2020.1.6f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Button.cs:110) UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/Program Files/Unity/Hub/Editor/2020.1.6f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:50) UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at C:/Program Files/Unity/Hub/Editor/2020.1.6f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:261) UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/Unity/Hub/Editor/2020.1.6f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:376)

image

edougithub commented 3 years ago

Seems the Human prefab has the gameobjects Right -> Armor, Head, etc... set to SpriteMapping -> SpriteName = "Right". Shouldn't these be "Left"? (similar to the Goblin prefab)

hippogamesunity commented 3 years ago

Hello! Looks like this may be caused by update. Try removing and reimporting the asset. I've checked the latest vesion from the Asset Store in the latest Unity, and it works fine.

edougithub commented 3 years ago

As a test I created a new empty 2D Unity 2020 project, only added this asset. It seems the Right Character is back, yeah! And the console errors are gone. However the Canvas is now completely white, any idea what could be the cause? The Atlases looks correct as well as the Scene view. No changes to the scene were made at all.

image

image

hippogamesunity commented 3 years ago

Select HeroEditor4D\FantasyHeroes\Atlases\UI.atlas and check Include in Build (if you really need it for your game).

edougithub commented 3 years ago

Thanks for the assistance.

hippogamesunity commented 3 years ago

See ya! Also hope to get your feedback on the Asset Store!