模型和贴图必需存在“Resources”文件夹下面
var mesh1 : GameObject; function Start() { mesh1 = Instantiate(Resources.Load("model")); //加载模型 mesh1.transform.position=Vector3(1020,14,720); //模型出现的位置 } function Update () { renderer.material.mainTexture = Resources.Load("a"); //加载材质 }