SoftMaskForUGUI
SoftMaskForUGUI copied to clipboard
NullReferenceException when adding SoftMask component
Describe the bug When adding a SoftMask component to an empty GameObject, NullReferenceExceptions are continuously thrown until a Graphic is also added.
To Reproduce Steps to reproduce the behavior:
- Create an empty GameObject
- Add a SoftMask component
- See error in console
Expected behavior No errors are thrown when adding a SoftMask component. Either a default Graphic should be added if required (during Reset or OnValidate), or ideally, handle missing Graphic components.
Environment (please complete the following information):
- Version: 1.0.2
- Platform: Editor(Windows)
- Unity version: 2022.3.9f1
Additional context
NullReferenceException: Object reference not set to an instance of an object
Coffee.UISoftMask.SoftMask.UpdateMaskTextures () (at ./Library/PackageCache/[email protected]/Scripts/SoftMask.cs:476)
UnityEngine.Canvas.SendWillRenderCanvases () (at <836aea33117647b388cc5f48bed669c4>:0)