void OnDrawGizmos() { if (Config != null) { M_Math.SceneViewText(Config.ID, transform.position); } }
void OnSceneGUI(SceneView sceneView) { // Do your drawing here using Handles. Handles.BeginGUI(); if (weighted != null && Grid != null) { float sum_weights = weighted.Select(t => t.weight).Sum(); foreach (TileWeighted tw in weighted) { float percent = (tw.weight / sum_weights) * 100; if (percent > 0) { M_Math.SceneViewText(percent.ToString("00.00") + "%", Grid.Tiles[tw.tilePos.x, tw.tilePos.z].GetPosition(), Color.black); } } } Handles.EndGUI(); }