You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
830 B
32 lines
830 B
|
1 year ago
|
using UnityEngine;
|
||
|
|
|
||
|
|
// OutlineFx © NullTale - https://x.com/NullTale/
|
||
|
|
namespace OutlineFx
|
||
|
|
{
|
||
|
|
[ExecuteAlways] [DisallowMultipleComponent]
|
||
|
|
public abstract class Outline : MonoBehaviour
|
||
|
|
{
|
||
|
|
internal Renderer _renderer;
|
||
|
|
|
||
|
|
public abstract Color Color {get; set; }
|
||
|
|
|
||
|
|
// =======================================================================
|
||
|
|
private void OnEnable()
|
||
|
|
{
|
||
|
|
_renderer = GetComponent<Renderer>();
|
||
|
|
}
|
||
|
|
|
||
|
|
private void OnWillRenderObject()
|
||
|
|
{
|
||
|
|
#if UNITY_EDITOR
|
||
|
|
if (Application.isEditor && Equals(_renderer, null) == false)
|
||
|
|
{
|
||
|
|
if (TryGetComponent<Renderer>(out _renderer) == false)
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
|
||
|
|
OutlineFxFeature.Render(this);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|