Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity3D Null Reference Exception #58

Open
CasulScrub opened this issue Oct 19, 2018 · 5 comments
Open

Unity3D Null Reference Exception #58

CasulScrub opened this issue Oct 19, 2018 · 5 comments

Comments

@CasulScrub
Copy link

I am having this null reference thrown very randomly, so it is hard to trace the cause. I am using Unity 2018.3. It stops my animations from playing.
NullReferenceException: Object reference not set to an instance of an object DragonBones.AnimationState.AdvanceTime (Single passedTime, Single cacheFrameRate) (at Assets/DragonBones/Scripts/animation/AnimationState.cs:951

@CasulScrub
Copy link
Author

This error also occurs randomly, switching between scenes.

InvalidOperationException: Destroying a GameObject inside a Prefab instance is not allowed.
UnityEngine.Object.DestroyImmediate (UnityEngine.Object obj) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:322)
DragonBones.UnityFactoryHelper.DestroyUnityObject (UnityEngine.Object obj) (at Assets/DragonBones/Scripts/unity/UnityFactory.cs:1171)
DragonBones.UnitySlot._DisposeDisplay (System.Object value, Boolean isRelease) (at Assets/DragonBones/Scripts/unity/UnitySlot.cs:138)
DragonBones.Slot._OnClear () (at Assets/DragonBones/Scripts/armature/Slot.cs:187)
DragonBones.UnitySlot._OnClear () (at Assets/DragonBones/Scripts/unity/UnitySlot.cs:94)
DragonBones.BaseObject.ReturnToPool () (at Assets/DragonBones/Scripts/core/BaseObject.cs:221)
DragonBones.Armature._OnClear () (at Assets/DragonBones/Scripts/armature/Armature.cs:131)
DragonBones.BaseObject.ReturnToPool () (at Assets/DragonBones/Scripts/core/BaseObject.cs:221)
DragonBones.DragonBones.AdvanceTime (Single passedTime) (at Assets/DragonBones/Scripts/core/DragonBones.cs:329)
DragonBones.UnityArmatureComponent.OnDestroy () (at Assets/DragonBones/Scripts/unity/UnityArmatureComponent.cs:746)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

@SirLink
Copy link
Contributor

SirLink commented Jan 13, 2019

I don't know if you still need this fixed but i fixed it in my forked version https://github.com/SirLink/DragonBonesCSharp

@JuanGdelaCruz
Copy link

I don't know if you still need this fixed but i fixed it in my forked version https://github.com/SirLink/DragonBonesCSharp

Did you fix the first one or the second one?

@SirLink
Copy link
Contributor

SirLink commented Jul 24, 2019

I don't know if you still need this fixed but i fixed it in my forked version https://github.com/SirLink/DragonBonesCSharp

Did you fix the first one or the second one?

The first one

@hzj730
Copy link

hzj730 commented Feb 27, 2020

This error also occurs randomly, switching between scenes.

InvalidOperationException: Destroying a GameObject inside a Prefab instance is not allowed.
UnityEngine.Object.DestroyImmediate (UnityEngine.Object obj) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:322)
DragonBones.UnityFactoryHelper.DestroyUnityObject (UnityEngine.Object obj) (at Assets/DragonBones/Scripts/unity/UnityFactory.cs:1171)
DragonBones.UnitySlot._DisposeDisplay (System.Object value, Boolean isRelease) (at Assets/DragonBones/Scripts/unity/UnitySlot.cs:138)
DragonBones.Slot._OnClear () (at Assets/DragonBones/Scripts/armature/Slot.cs:187)
DragonBones.UnitySlot._OnClear () (at Assets/DragonBones/Scripts/unity/UnitySlot.cs:94)
DragonBones.BaseObject.ReturnToPool () (at Assets/DragonBones/Scripts/core/BaseObject.cs:221)
DragonBones.Armature._OnClear () (at Assets/DragonBones/Scripts/armature/Armature.cs:131)
DragonBones.BaseObject.ReturnToPool () (at Assets/DragonBones/Scripts/core/BaseObject.cs:221)
DragonBones.DragonBones.AdvanceTime (Single passedTime) (at Assets/DragonBones/Scripts/core/DragonBones.cs:329)
DragonBones.UnityArmatureComponent.OnDestroy () (at Assets/DragonBones/Scripts/unity/UnityArmatureComponent.cs:746)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

UnityArmatureComponent.cs
void DBClear()

if (this._armature != null)
            {
                this._armature = null;
                if (this._disposeProxy)
                {
                    try
                    {
                        var go = gameObject;
                        UnityFactoryHelper.DestroyUnityObject(gameObject);
                    }
                    catch (System.Exception e)
                    {

                    }
                }
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants