Created
November 30, 2018 05:08
-
-
Save TheAllenChou/bd3d289cc150f9b24e69c5629a9730c6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<GameObject> sprites; | |
List<GameObject> nameTextFields; | |
for (int i = 0, n = sprites.Length; i < n; ++i) | |
{ | |
var s = sprites[i]; | |
var ntf = nameTextFields[i]; | |
int row = i / numCols; | |
int col = i % numCols; | |
s.transform.position = | |
new Vector3(col * colSize, row * rowSize, 0.0f); | |
ntf.transform.position = | |
s.transform.position | |
+ textFieldOffset; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment