How to run a int function only once in unity code example
Example: how to call something once in update
bool isDone = false;
void Update() {
if (!isDone) {
// put your code that runs once here
isDone = true;
}
}
bool isDone = false;
void Update() {
if (!isDone) {
// put your code that runs once here
isDone = true;
}
}