Free Selection Outline

FREE
Publisher BookSun's Ideas
File size 189.03kB
Number of files 9
Latest version 1
Latest release date 2021-07-08 10:29:55
First release date 2021-04-16 08:56:14
Supported Unity versions 2018.4.2 or higher

Not compatible with URP and HDRP.

Remember to Assign two related shaders (PostprocessOutline and Target) into the ProjectSettings->Graphic->Always Included Shaders.

Otherwise this function would not work properly after you built your game.


How to use:

Add the script called "SelectionOutlineController.cs" to the camera you want to affect.

Then play the demo scene, click and hold on any object in the scene and it will show the outline.


Parameters:


Selection Mode:1,Only outline the single object you select.2 ,outline its children too.

Outline Type:1,Outline the whole object .2,Outline the whole object but colorize the occluded parts.3,Only outline the visible parts .

Alpha Mode:1,Read the alpha data of MainTex and cause holes.2,Only outline the intact geometry.

Outline Color: The outline Color.

Occluded Color: The color that the occluded parts will be tinted with.

Outline Width:Outline's width.

Outline Hardness: How much the outline color blend in.



An object must be given a collider and the collider must be put at the same place where the its renderer is.So that it can be selected (By Raycast).


Selection codes are in the Update function of the script. Write your own codes there if you want.


Advice:

It'd be better that the main texture property of the selected object was named as "_MainTex", and the alpha data are stored in its Alpha channel.

So the transparent and clipped objects can be outlined properly.


Top Publisher Assets