Advertisement
tmoneygames

GridPattern

Nov 23rd, 2019 (edited)
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | Source Code | 0 0
  1. /*
  2.   Copyright 2019 John Wheeler<tmoneygames2019@gmail.com>
  3.   Trying to do different things with unity
  4. */
  5.         for(float x = gridBoundsMin.x; x < gridBoundsMax.x; x += 40f)
  6.         {
  7.             for (float y = gridBoundsMin.z; y < gridBoundsMax.z; y += 40f)
  8.             {
  9.                 int hash = (x * y).GetHashCode();
  10.                 Random.InitState(hash);
  11.                 var debugColor = new Color(Random.value, Random.value, Random.value, 1f);
  12.                 Debug.DrawLine(new Vector3(x, 0f, y), new Vector3(x + 40f, 0f, y), debugColor, 60f);
  13.                 Debug.DrawLine(new Vector3(x, 0f, y), new Vector3(x , 0f, y + 40f), debugColor, 60f);
  14.                 Debug.DrawLine(new Vector3(x + 40f, 0f, y), new Vector3(x + 40f, 0f, y + 40f), debugColor, 60f);
  15.                 Debug.DrawLine(new Vector3(x, 0f, y + 40f), new Vector3(x + 40f, 0f, y + 40f), debugColor, 60f);
  16.             }
  17.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement