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

How can I use this to apply on an image instead of a mesh renderer? #57

Open
graham30rad opened this issue Feb 25, 2023 · 1 comment
Open

Comments

@graham30rad
Copy link

No description provided.

@graham30rad
Copy link
Author

graham30rad commented Feb 25, 2023

I figured it out, you need to use this helper class (unless there is an easier and more efficient way..

using UnityEngine;

public static class ConvertToSpriteExtensiton
{
public static Sprite ConvertToSprite(this Texture2D texture)
{
return Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
}
}

credit to nnm_t on githib.

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

No branches or pull requests

1 participant