public override void start(System.Object obj) { GameObject panel = GameObject.Find("UILoadBattlePanel"); IBattleUnit[] units = m_battle.getUnits(); FSequence seq = new FSequence(); foreach (var unit in units) { GRoleUnit role = unit as GRoleUnit; if (role != null) { Image img = panel.transform.FindChild("image_" + role.getRoleId()).GetComponent <Image> (); uint skin = role.getSkinId(); IHero hero = role.getHero(); string skinFile = hero.getSkinTexture(skin); seq.addAction(new FLoadAsset(FResID.SPRITE, "Texture/hero/" + skinFile)); // 加载对应皮肤的图片 seq.addAction(new FCallFunc(delegate() { img.sprite = FResManager.getInstance().getRes(FResID.SPRITE) as Sprite; // 显示皮肤图片 })); seq.addAction(new FUnloadAsset(FResID.SPRITE)); UnityEngine.Debug.Log(role.getHero().getSkinTexture(role.getSkinId())); } } this.runAction(seq); }
public void init() { m_actionManager = FActionManager.getInstance(); m_hotfixManager = FHotfixManager.getInstance(); m_luaManager = FLuaManager.getInstance(); m_networkManager = FNetworkManager.getInstance(); m_resManager = FResManager.getInstance(); m_soundManager = FSoundManager.getInstance(); m_uiManager = FUIManager.getInstance(); m_actionManager.init(); m_hotfixManager.init(); m_luaManager.init(); m_networkManager.init(); m_resManager.init(); m_soundManager.init(); m_uiManager.init(); m_inited = true; }