Skip to content

Commit 7b302e6

Browse files
committed
Fix auto tiling unit scale
1 parent 28290a1 commit 7b302e6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Runtime/AutoTile.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if UNITY_EDITOR
1+
#if UNITY_EDITOR
22
using UnityEditor;
33
#endif
44
using UnityEngine;
@@ -52,10 +52,11 @@ public sealed class Submesh
5252
public int submeshIndex = 0;
5353

5454
/// <summary>
55-
/// The base texture scale. For example, planes have a scale of 10.
55+
/// The object's base unit scale. For example, planes have a unit
56+
/// scale of 10 compared to most other primitives.
5657
/// </summary>
57-
[Tooltip("The base texture scale. For example, planes have a scale of 10.")]
58-
public Vector2 baseScale = Vector2.one;
58+
[Tooltip("The object's base unit scale. For example, planes have a unit scale of 10 compared to most other primitives.")]
59+
public Vector3 unitScale = Vector3.one;
5960

6061
/// <summary>
6162
/// The texture offset applied on the material.
@@ -213,7 +214,7 @@ private void UpdateMaterial(Material material, Submesh submesh)
213214
return;
214215
}
215216

216-
Vector2 textureScale = GetTextureScale(submesh.axis, Vector3.one);
217+
Vector2 textureScale = GetTextureScale(submesh.axis, submesh.unitScale);
217218
Vector2 textureOffset = submesh.textureOffset;
218219

219220
for (int i = 0; i < this.textureNames.Length; i++)

0 commit comments

Comments
 (0)