in unity 2d how to call another script code example
Example: how to reference function in unity
public GameObject myObject; //make ref. in inspector window
myObject.GetComponent<MyScript>().MyFunction();
public GameObject myObject; //make ref. in inspector window
myObject.GetComponent<MyScript>().MyFunction();