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

Update softmask not working when canvas component was deactivated #66

Closed
Danilovic opened this issue Nov 26, 2019 · 9 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Danilovic
Copy link

Hi!

I have encountered an issue when I deactivate the canvas component of a gameobject where the masks are located, when softmask script tries to update those masks, it throws a null.

You can find a little package with an example.

SoftMaskIssue.zip

Regards

@mob-sakai mob-sakai self-assigned this Nov 26, 2019
@mob-sakai mob-sakai added the bug Something isn't working label Nov 26, 2019
@mob-sakai
Copy link
Owner

Hi @Danilovic

Thank you for your reporting!

@mob-sakai
Copy link
Owner

@Danilovic

Many scripts are missing in your scene... X(
Please zip your entire project folder and attach it.

image

@Danilovic
Copy link
Author

@mob-sakai

I just downloaded the package in another pc with a clean Unity with no projects and I didn't see the missing files, in fact, I didn't use any custom script for this example. Could you show me the gameobject (s) with this problem?

@mob-sakai
Copy link
Owner

@Danilovic

I imported it to Unity2018.3 project on Mac.
I will try again with a clean project.
Thanks!

@mob-sakai
Copy link
Owner

mob-sakai commented Dec 3, 2019

@Danilovic

Hmm, I tested it with Unity2018.2 and Unity2018.3 on Mac and Windows, but it does not work...
So, I fixed m_Script in scene file.
I will test it later. :)

Softmask.unity.zip

Edit: All missing scripts are not solved...

@mob-sakai
Copy link
Owner

@Danilovic

Fix SoftMask.cs(line:428) as following:

if (!sm || sm._hasChanged)

To

if (!sm || sm._hasChanged || !sm.graphic || !sm.graphic.canvas)

Does it work well?

@Danilovic
Copy link
Author

@mob-sakai

It doesn't work for me. I tested the package on Unity 2019.2.8 and works ok, without missing scripts so I tested the same package on Unity 2018.2 and I saw the missing files. Please check on Unity 2019.2.8

@JJarvis89
Copy link

Hi, I am having the same issue.

Attached you can find a sample project (hopefully with no missing scripts!)

Steps:

  1. Open SampleScene
  2. Run
  3. Disable Canvas

This causes a NullReferenceException. Depending on which Canvas Render mode the culprit is either the Canvas or the Camera.

Kind regards
SoftMaskIssue.zip

@mob-sakai
Copy link
Owner

@JJarvis89 , @Danilovic

Thank you!
I will fix it ASAP.

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

No branches or pull requests

3 participants