Initial commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user