Skip to main content

GenerateUVPoints

A class in Root.Township, the global namespace.

Editor tool that places empty child objects on mesh surfaces at given texture coordinates.

Constructors​

MemberWhat it is
GenerateUVPoints()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

5 private and internal fields
MemberWhat it is
private bool isGeneratingInspector button that runs Generate.
private bool isYFlippedFlips the V coordinate.
private MeshFilter[] meshFiltersMeshes to place points on.
private Vector2 textureSizeTexture size in pixels; UV points are divided by it.
private Vector2[] uvPointsPoints in texture pixels.

Methods​

1 private and internal method
MemberWhat it is
private void Generate()For each UV point, finds the triangles that contain it on each mesh and creates a child object at that spot.