Reputation: 67
I want to implement Silhouette Highlight
on MouseOver
like in this picture:
Built in Unity3d user interface elements have a component called Outline
and Shadow
, but they only work with the user interface, not with the SpriteRenderer
. The first idea was to create a second sprite with highlight at background and enable it to MouseOver
, but I think that this method is not good.
Upvotes: 1
Views: 2107
Reputation: 12582
As Everts (and me) mentions in a comment,
there's nothing wrong with simply making the "glow sprites" and turning them on and off. That would certainly be done in many large games: it's good.
It's true that you could write a shader that does this, but really that would be "bad engineering" - totally unnecessary for such a simple need. (And to be clear, arguably it's plain better to make custom sprites.)
Now, this brings us to an important point about Unity engineering -
There are a couple of stand-out examples. Like, NatCam and Edy's vehicle system. You just - literally - cannot use the camera in a game unless you use "NatCam"; the only alternative would be to completely pointlessly spend a year building NatCam yourself.
In this case, there are many good "glow shaders" available ...
https://www.assetstore.unity3d.com/en/#!/content/20166
Enjoy!
Upvotes: 2