how to reference function in unity

C#
public GameObject myObject; //make ref. in inspector window

myObject.GetComponent<MyScript>().MyFunction();
Source

Also in C#: