Skip to content

A MissingReferenceException is thrown when using UIParticle, even in a very simple setup. #403

@BenoitFreslon

Description

@BenoitFreslon

Describe the bug
A MissingReferenceException is thrown when using UIParticle, even in a very simple setup.

It happens with a minimal scene containing only:

  • one UIParticle
  • one simple Particle System

The exception points to UIParticle.OnDisable() / UIParticleRenderer.Reset() and suggests that a UIParticleRenderer reference has already been destroyed but is still being accessed.

Stack trace:

MissingReferenceException: The object of type 'Coffee.UIExtensions.UIParticleRenderer' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Object+MarshalledUnityObject.TryThrowEditorNullExceptionObject (UnityEngine.Object unityObj, System.String parameterName) (at <63bb50fab3ed4848b7f15ef3cb2c182e>:0)
UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException (System.Object obj) (at <63bb50fab3ed4848b7f15ef3cb2c182e>:0)
UnityEngine.Behaviour.get_isActiveAndEnabled () (at <63bb50fab3ed4848b7f15ef3cb2c182e>:0)
Coffee.UIExtensions.UIParticleRenderer.Reset (System.Int32 index) (at ./Library/PackageCache/com.coffee.ui-particle@92fb173507ec/Runtime/UIParticleRenderer.cs:124)
Coffee.UIExtensions.UIParticle+<>c.<OnDisable>b__88_0 (Coffee.UIExtensions.UIParticleRenderer r) (at ./Library/PackageCache/com.coffee.ui-particle@92fb173507ec/Runtime/UIParticle.cs:361)
System.Collections.Generic.List`1[T].ForEach (System.Action`1[T] action) (at <f713e1c3c5f545ce9b1df47230f4f853>:0)
Coffee.UIExtensions.UIParticle.OnDisable () (at ./Library/PackageCache/com.coffee.ui-particle@92fb173507ec/Runtime/UIParticle.cs:361)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions