diff --git a/Reactor/Extensions/Extensions.cs b/Reactor/Extensions/Extensions.cs index f0ecf6c..4c36611 100644 --- a/Reactor/Extensions/Extensions.cs +++ b/Reactor/Extensions/Extensions.cs @@ -97,5 +97,23 @@ namespace Reactor.Extensions return task.Task; } + + private static readonly int _outline = Shader.PropertyToID("_Outline"); + private static readonly int _outlineColor = Shader.PropertyToID("_OutlineColor"); + private static readonly int _addColor = Shader.PropertyToID("_AddColor"); + + /// + /// Sets color outline for renderers using default Among Us shader + /// + public static void SetOutline(this Renderer renderer, Color? color) + { + renderer.material.SetFloat(_outline, color.HasValue ? 1 : 0); + + if (color.HasValue) + { + renderer.material.SetColor(_outlineColor, color.Value); + renderer.material.SetColor(_addColor, color.Value); + } + } } }