Highlighter.highlight C# (CSharp) Method

highlight() public static method

public static highlight ( GameObject obj, Color color ) : void
obj GameObject
color Color
return void
    public static void highlight(GameObject obj, Color color)
    {
        if(obj == null)
        {
            if(last != null)
                last.renderer.material.shader = old_shader;

            return;
        }

        GameObject obj_with_renderer = findRendererRecursive(obj);

        if(last != null)
        {
            last.renderer.material.shader = old_shader;
        }

        old_shader = obj_with_renderer.renderer.material.shader;
        last = obj_with_renderer;

        obj_with_renderer.renderer.material.shader = highlightShader();
        obj_with_renderer.renderer.material.SetColor("_OutlineColor", color);
    }

Usage Example

コード例 #1
0
 public void RecalculateHighlights()
 {
     highlighter.removeAllHighlights();
     foreach (Unit u in unitsInRange)
     {
         highlighter.highlight(u.tile.p, Highlight.Style.RED);
     }
     highlighter.highlight(actor.tile.p, Highlight.Style.BLUE);
 }
All Usage Examples Of Highlighter::highlight