载入资产

#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");
}

 

posted @ 2012-09-01 15:09  softimagewht  阅读(200)  评论(0编辑  收藏  举报