calling an editor function ...

hi all …

i’m trying to call the function changeLightMode() on this script :

@MenuItem (“Component/AssignSkybox”)
static function changeLightMode() {
var sky = Camera.main.GetComponent(Skybox); sky.material=EditorUtility.FindAsset(“Skyboxes/NightSkyboxes/NightSkybox.mat”, Material);
}

… by another script :

function OnGUI () {

if (GUI.Button (Rect (10,10,150,100), “Night Mode”)) {
// calling the function here !

}
}

any help ??

Editor Scripts can not be called by MonoBehaviours
They are for working in the Editor, not really for runtime stuff