载入资产

#pragma strict



var s1 : GUISkin;

var s2 : GUISkin;



function Start () {

  s1 = AssetDatabase.LoadAssetAtPath("Assets/Amiga500GUISkin.guiskin",GUISkin); 

  s2 = AssetDatabase.LoadAssetAtPath("Assets/MetalGUISkin.guiskin",GUISkin);



}



function OnGUI() {

    GUI.skin = s1;    

    if (GUI.Button(Rect(10,110,70,30), "A button"))

            Debug.Log("Button has been pressed");

            

    GUI.skin = s2;    

    if (GUI.Button(Rect(110,110,70,30), "A button"))

            Debug.Log("Buwwerwqqq");

}

 

你可能感兴趣的:(载入资产)