Skip to content

Commit c1cb2f0

Browse files
committed
Small change to make the script readable without scrolling horizontally
1 parent 13bf486 commit c1cb2f0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Examples/MeshCreatorExample.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ void Awake()
4141

4242
void Update()
4343
{
44-
// Make the vertices wobble independently
44+
// Make the vertices wobble
4545
for (int i = 0; i < meshCreator.MeshVerticesCount; i++)
4646
{
4747
MeshVertex meshVertex = meshCreator.MeshVertices[i];
48-
meshVertex.Position = meshVertex.Position.normalized * 2f * Mathf.Lerp(1f, 2f, Mathf.Abs(Mathf.Cos(Time.time + i / 4f)));
48+
float scale = Mathf.Lerp(2f, 4f, Mathf.Abs(Mathf.Cos(Time.time + i / 4f)));
49+
meshVertex.Position = meshVertex.Position.normalized * scale;
4950
}
5051

5152
// Update the mesh

MeshCreator/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ public class MeshCreatorExample : MonoBehaviour
4848
for (int i = 0; i < meshCreator.MeshVerticesCount; i++)
4949
{
5050
MeshVertex meshVertex = meshCreator.MeshVertices[i];
51-
meshVertex.Position = meshVertex.Position.normalized * 2f * Mathf.Lerp(1f, 2f, Mathf.Abs(Mathf.Cos(Time.time + i / 4f)));
51+
float scale = Mathf.Lerp(2f, 4f, Mathf.Abs(Mathf.Cos(Time.time + i / 4f)));
52+
meshVertex.Position = meshVertex.Position.normalized * scale;
5253
}
5354

5455
// Update the mesh

0 commit comments

Comments
 (0)