private void Awake() { if (_singleton != null) { Debug.LogError("more than one LineDrawTool present"); } _singleton = this; }
public static void EnsureExistance() { if (_singleton != null) { return; } GameObject go = new GameObject("line_draw_tool"); _singleton = go.AddComponent <LineDrawTool>(); go.hideFlags = HideFlags.DontSave; }