how to reference a script in another script unity code example
Example: reference to another script unity
SomeScript script = GetComponent<SomeScript>();
// alternatively, just make it a field:
[SerializeField] protected SomeScript script;
SomeScript script = GetComponent<SomeScript>();
// alternatively, just make it a field:
[SerializeField] protected SomeScript script;