I'm trying to pass a function as an argument just like this:
void AvoidSpawn(float sRate, function f)
{
float calculateRate = 0;
if(Time.time>=calculateRate)
{
f();
calculateRate = Time.time + spawnRate;
}
}
I don't know how to use a function as an argument and pass it and I would like to replace function f
with something that works.