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

Added Materials as possible targets; fixed useless warnings #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Morveus
Copy link

@Morveus Morveus commented Sep 13, 2022

I've added the possibility to pass a specific material (it was very useful to our project) as a parameters in the "into()" function (so you can target, for instance, a specific side of a cube, instead of all 6 sides)

Also, there were two warnings that bothered me in Unity:

  • One boolean that was set but never used
  • One exception never dumping the "ex.Message"

These have been fixed.

You can now pass a specific material in ".into(material)"

Two warnings were also fixed (one Exception not passed into the debug and one boolean never used)
switch (rendererType)
{
case RendererType.renderer:
Renderer renderer = targetObj.GetComponent<Renderer>();

if (renderer == null || renderer.material == null)
if (renderer == null || renderer.materials[1] == null)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a use-case specific change, and doesn't correspond with the use of renderer.material in the rest of the code below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants