-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add a null-check of TeleportMarker before instantiating the object. #1122
Add a null-check of TeleportMarker before instantiating the object. #1122
Conversation
} | ||
else | ||
{ | ||
fadeMaterial = GetComponentInChildren<MeshRenderer>().material; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.material
is bad unless we're destroying the fade material later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -90,7 +99,7 @@ void CalculateFade() | |||
|
|||
protected override void OnDestroy() | |||
{ | |||
if (fadeMaterial != null) | |||
if (fadeMaterial != null && !FadeSharedMaterial) | |||
{ | |||
Destroy(fadeMaterial); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh good. we are.
We could put this on the master branch, if we get the back port in soon. |
Fixes #1112 Added a null-check of TeleportMarker before instantitiating the object.
Fixes #1113 Add an option to use sharedMaterial when fading.