Created
September 8, 2021 19:11
-
-
Save leventeren/aad1926bff04e54ae693a7f7fd36cea8 to your computer and use it in GitHub Desktop.
Array Resize
This file contains 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
public void GroupResize (int Size, ref GameObject[] Group) | |
{ | |
GameObject[] temp = new GameObject[Size]; | |
for (int c = 1; c < Mathf.Min(Size, Group.Length); c++ ) { | |
temp [c] = Group [c]; | |
} | |
Group = temp; | |
} | |
void Start () | |
{ | |
GameObject[] Test = new GameObject[5]; | |
Debug.Log (Test.Length); | |
GroupResize (15, ref Test); | |
Debug.Log (Test.Length); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment