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

NullReferenceException after copy-n-paste #258

Closed
Watcher3056 opened this issue Apr 25, 2023 · 2 comments
Closed

NullReferenceException after copy-n-paste #258

Watcher3056 opened this issue Apr 25, 2023 · 2 comments
Assignees
Labels
bug Something isn't working released

Comments

@Watcher3056
Copy link

Watcher3056 commented Apr 25, 2023

Describe the bug
Problem using copy-paste feature of gameobject with UI Particle component on it, constant null reference exceptions starts to appear - need to remove UI Particle component and destroy all UIParticleRenderer gameobjects and setup again in order to fix issue.

UPD: Problem appear when clicking on any UIParticleRenderer gameobject even after destroying them and UIParticle component and attach it back.
Log of error:

NullReferenceException: Object reference not set to an instance of an object
Coffee.UIExtensions.UIParticleRenderer.GetModifiedMaterial (UnityEngine.Material baseMaterial) (at Assets/3_ThirdParty/0_Source/ParticleEffectForUGUI-4.1.7/Scripts/UIParticleRenderer.cs:121)
UnityEngine.UI.Graphic.get_materialForRendering () (at Library/PackageCache/[email protected]/Runtime/UI/Core/Graphic.cs:497)
UnityEngine.UI.Graphic.UpdateMaterial () (at Library/PackageCache/[email protected]/Runtime/UI/Core/Graphic.cs:658)
UnityEngine.UI.Graphic.Rebuild (UnityEngine.UI.CanvasUpdate update) (at Library/PackageCache/[email protected]/Runtime/UI/Core/Graphic.cs:636)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at Library/PackageCache/[email protected]/Runtime/UI/Core/CanvasUpdateRegistry.cs:215)
UnityEngine.Camera:Render(Camera)
Kamgam.UIPreview.UIPreview:CreateAssetPreview(Object) (at Assets/3_ThirdParty/1_Tools/UIPreview/Editor/UIPreview.cs:447)
Kamgam.UIPreview.UIPreview:createPreviewTextureForTarget(Object) (at Assets/3_ThirdParty/1_Tools/UIPreview/Editor/UIPreview.cs:175)
Kamgam.UIPreview.UIPreview:Initialize(Object[]) (at Assets/3_ThirdParty/1_Tools/UIPreview/Editor/UIPreview.cs:139)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

To Reproduce
Copy and paste Particle System in UI with UI Particle component on it

Expected behavior
No errors

Environment (please complete the following information):

  • Version latest(3.1.7)
  • Platform: Editor(Windows)
  • Unity version: 2021.3.13f1
  • Build options: IL2CPP, Android
@Watcher3056 Watcher3056 added the bug Something isn't working label Apr 25, 2023
@dkasenko
Copy link

dkasenko commented Aug 8, 2023

Same?

  • Version: 4.1.7
  • Platform: Editor (Windows)
  • Unity version: Unity 2022.3.4f1
  • Build options: IL2CPP, Android
Coffee.UIExtensions.UIParticleRenderer.GetModifiedMaterial (UnityEngine.Material baseMaterial) (at ./Library/PackageCache/com.coffee.ui-particle@a499f0c046/Scripts/UIParticleRenderer.cs:121)
UnityEngine.UI.Graphic.get_materialForRendering () (at ./Library/PackageCache/[email protected]/Runtime/UI/Core/Graphic.cs:514)
UnityEngine.UI.Graphic.UpdateMaterial () (at ./Library/PackageCache/[email protected]/Runtime/UI/Core/Graphic.cs:675)
UnityEngine.UI.Graphic.Rebuild (UnityEngine.UI.CanvasUpdate update) (at ./Library/PackageCache/[email protected]/Runtime/UI/Core/Graphic.cs:653)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at ./Library/PackageCache/[email protected]/Runtime/UI/Core/CanvasUpdateRegistry.cs:215)
UnityEngine.Canvas:SendWillRenderCanvases()```

mob-sakai added a commit that referenced this issue Aug 14, 2023
mob-sakai added a commit that referenced this issue Aug 14, 2023
mob-sakai added a commit that referenced this issue Aug 15, 2023
mob-sakai added a commit that referenced this issue Aug 17, 2023
github-actions bot pushed a commit that referenced this issue Aug 18, 2023
# [4.2.0](4.1.7...4.2.0) (2023-08-18)

### Bug Fixes

* assertion 'ps->array_size()' in UpdateMesh() when using trails of type ribbon ([f75fcce](f75fcce)), closes [#241](#241)
* built-in shaders are no longer supported ([c2119c1](c2119c1)), closes [#233](#233) [#257](#257)
* crash occurs when too many vertices are rendered ([723a04d](723a04d))
* error: SerializedObject target has been destroyed ([e930516](e930516)), closes [#267](#267)
* excessive particle emitted on move ParticleSystem for local space simulation and emission over distance ([2fe0bde](2fe0bde)), closes [#265](#265)
* fix typos ([52f2ef1](52f2ef1))
* generated GameObject will be named '[generated] *' ([9b2e5c1](9b2e5c1))
* inactive ParticleSystems are removed from the list on refresh ([4851a18](4851a18))
* mesh sharing not working ([8b4ca1a](8b4ca1a)), closes [#236](#236)
* nullptr exceptions when using nested UIParticle components in hierarchy ([e67e948](e67e948)), closes [#246](#246)
* nullReferenceException after copy-n-paste ([425aad0](425aad0)), closes [#258](#258)
* remove unnecessary per-frame allocation. ([e92b514](e92b514))
* scaling ParticleSystem puts prewarmed particles in wrong location ([fb31db4](fb31db4)), closes [#235](#235)
* sub-emitters option is not work in editor playing ([b308b26](b308b26)), closes [#231](#231)
* the camera under UIParticle will be assigned as _orthoCamera ([c42f8c8](c42f8c8))
* UIParticleAttractor attracts the particles at wrong position when in RelativeMode ([68d9925](68d9925)), closes [#262](#262)

### Features

* 'AbsoluteMode' option is renamed to 'PositionMode' ([67eff61](67eff61))
* 'AutoScaling' option will be imported from 'IgnoreCanvasScale' (for v3.x) ([4103041](4103041))
* add 'AutoScaling' option for UIParticle ([35325c8](35325c8))
* add 'UpdateMode' option for UIParticleAttractor ([903f702](903f702)), closes [#250](#250)
* add particle system getter and setter for attractor ([a4bcf93](a4bcf93)), closes [#253](#253)
* add public properties for UIParticleAttractor ([392ab6d](392ab6d)), closes [#253](#253)
* add Start/StopEmission API for UIParticle ([e499836](e499836)), closes [#240](#240)
@github-actions
Copy link

🎉 This issue has been resolved in version 4.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

3 participants