skip to Main Content

Advanced Topics and Notes

Sorting layers

Highlight Plus 2D Effects are always rendered into Sorting Layer 0. If you have sprites that use a greater sorting layer, you may need to change them, so they use a lower sorting layer.

Using scripting to add effects

Use GetComponent<HighlightEffect2D>() to get a reference to the component of your sprite.

Most properties shown in the inspector can be accessed through code, for example:

using HighlightPlus2D;
…
HighlightEffect2D effect = mySprite.GetComponent<HighlightEffect2D>();
effect.outline = true;
effect.outlineColor = Color.blue;
effect.Refresh();

Events / reacting to selection

When an object is highlighted the HighlightStart and HighlightEnd messages are invoked on all scripts attached to the sprite. You can also use the OnObjectHighlightStart/OnObjectHiglhightEvent to react to highlight events and cancel the event depending on the situation.

Check PotionHighlightEventSample.cs script in the demo scene.

2D animation support

To enable support for Sprite Skin animations, please make sure that:

  1. Polygon/SVG packing is enabled in the inspector.

  2. Edit HighlightEffect2D.cs script and uncomment this line on top:

//#define USE_SPRITE_SKIN

License of the icons

All icons in the demo scene are Public Domain.

Back To Top