public static void Draw(Rect rect, Vector2 offset) { if (inst == null) { inst = new tk2dGrid(); inst.InitTexture(); } GUI.DrawTextureWithTexCoords(rect, inst.gridTexture, new Rect(-offset.x / textureSize, (offset.y - rect.height) / textureSize, rect.width / textureSize, rect.height / textureSize), false); }
public static void Done() { if (inst != null) { inst.DestroyTexture(); inst = null; } }
public static void Draw(Rect rect, Vector2 offset) { if (inst == null) { inst = new tk2dGrid(); inst.InitTexture(); } GUI.DrawTextureWithTexCoords(rect, inst.gridTexture, new Rect(-offset.x / textureSize, offset.y / textureSize, rect.width / textureSize, rect.height / textureSize), false); }