Ага, вот решил как это сделать, вот код, правда последние строчки ещё не дописал
public int inWordCount;
public int numberInArray = 0;
public int[] wordsCount;
public GameObject[] Letters;
public GameObject[] TakeLetters;
public bool[] IsLetterActive;
private void Start()
{
for (int i = 0; i < IsLetterActive.Length; i++)
{
IsLetterActive[i] = false;
}
}
private void OnTriggerEnter2D(Collider2D col)
{
if (TakeLetters[numberInArray] == null)
{
TakeLetters[numberInArray] = col.gameObject;
}
else
{
while (TakeLetters[numberInArray] != null)
{
numberInArray++;
if (TakeLetters[numberInArray] == null)
{
TakeLetters[numberInArray] = col.gameObject;
}
}
}
if (numberInArray < Letters.Length)
{
numberInArray++;
}
}
private void OnPress(InputValue value)
{
if (value.isPressed)
{
}
else
{
for (int inNumber = 0; inNumber < wordsCount.Length; inNumber++)
{
for (int InLetters = 0; InLetters < TakeLetters.Length; InLetters++)
{
inWordCount = wordsCount[inNumber];
while (inWordCount <= 0)
{
if (TakeLetters[InLetters])
{
}
}
}
}
}
}