Hello. I can't find how to programmatically change a texture. I'm working on a card game in 2D and I essentially want to be able to "flip" the card from the back to the front, vice/versa.
In it's simplest form, I was planning on doing this by swapping out the textures from the CardBack resource (png) in my hirerarchy to another.
For the life of me, I can't find this in the docs. I'm seeing resourceloader/preloader examples...
Many examples are using var texture = load("my file"); And assigning it but this load method is not coming up in code completion for me.
In the area I'm working, I have a line of code...
sprite.Texture = cardBackTexture;
Where cardBackTexture is a Texture2D type, as that's what the .Texture property is. But I can't make any headway of this. I'm sure there's a simpler way to do this. Any help is appreciated. I'm using C# but I imagine that really doesn't matter...
Thx.