赞
踩
public Sprite LoadSourceSprite(string relativePath) { //Debug.Log("relativePath=" + relativePath); //把资源加载到内存中 Object Preb = Resources.Load(relativePath, typeof(Sprite)); Sprite tmpsprite = null; try { tmpsprite = Instantiate(Preb) as Sprite; } catch ( System.Exception ex ) { } //用加载得到的资源对象,实例化游戏对象,实现游戏物体的动态加载 return tmpsprite; //return Resources.Load(relativePath, typeof(Sprite)) as Sprite; }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。