17 lines
480 B
C#
17 lines
480 B
C#
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// Simple material color tint
|
|
/// </summary>
|
|
public class DefaultVisualFeedback : IVisualFeedback
|
|
{
|
|
public void OnValid(BlockEditContext ctx) => ApplyTint(ctx, ctx.ValidTint);
|
|
public void OnInvalid(BlockEditContext ctx) => ApplyTint(ctx, ctx.InvalidTint);
|
|
|
|
private static void ApplyTint(BlockEditContext ctx, Color tint)
|
|
{
|
|
foreach (var r in ctx.GhostRenderers)
|
|
if (r != null) r.material.color = tint;
|
|
}
|
|
}
|