I want to make a generic function in another script that needs a script as an argument. The code would look something like this
void Health (? (not sure what goes here) script) { script.health = 10; }
This function could be used by multiple different scripts, for example enemy and player.
Health(GetComponent());
Health(GetComponent());
↧