In the inspector of the attached script. When the user selects the context menu, the function will be executed.
docs.unity3d.com