The title explains everything.
The code doing so is this one:
for (int i = 0; i < 5; i++)
{
enemy.Push (cardDeckEnemy.Pop ());
}
What should be changed to do so?
The title explains everything.
The code doing so is this one:
for (int i = 0; i < 5; i++)
{
enemy.Push (cardDeckEnemy.Pop ());
}
What should be changed to do so?
I recommend not using a for-loop, but instead use InvokeRepeating.
Example:
int nCardsToPush = 5;
void Start () {
InvokeRepeating("PopCard", 0, 0.5f);
}
void PopCard () {
if (nCardsToPush > 0) {
enemy.Push (cardDeckEnemy.Pop ());
nCardsToPush--;
} else {
CancelInvoke();
}
}
Have you tried the InvokeRepeating function?
Then, you can Invoke a funcion, with a delay, and a cadence: InvokeRepeating("FunctionName", delay, cadence);
Hope this solved your question.