So I’ve a nonstatic function on a script I need to call from another script using OnMouseDown.
The Script containing the OnMouseDown function is just a simple call on a gameobject acting as a button.
This nonstatic function is reliant on variables on the script it’s on, it receives input and gives output on this script, so if I make it static it sort of isolates it from the script it’s on and renders it useless, all the variables I’ve declared on the script are ignored and it’s basically deaf to everything going on around it.
Is there any way I can call this function with an OnMouseDown on another script without marking the function static? Or can I call the OnMouseDown on the nonstatic function’s script and specify which button the OnMouseDown call needs to come from?
Sorry I’m sure I’ve worded this badly, my brain’s fried. Thanks for reading, any input you have is much appreciated!