/// <summary> /// 刷新上阵小队信息 /// </summary> /// <param name="item"></param> void UpdateHeroGrid(UIGridItem item) { if (item == null || item.oData == null || item.mScripts == null) { return; } item.onPress = SeeHeroArcaneInfo; HeroInfo info = item.oData as HeroInfo; UILabel heroName = item.mScripts[0] as UILabel; UILabel cardName = item.mScripts[1] as UILabel; UITexture isEmpty = item.mScripts[4] as UITexture; CreateSpineAni player = item.mScripts[2] as CreateSpineAni; item.name = "hero" + item.miCurIndex.ToString(); if (player != null) { MonoBehaviour.Destroy(player.gameObject); } heroName.gameObject.SetActive(info.heroUUId > 0); cardName.gameObject.SetActive(info.heroUUId > 0); isEmpty.gameObject.SetActive(info.heroUUId <= 0); if (info.heroUUId > 0) { TD_Hero heroInfo = HeroConfig.GetItem(info.configId); heroName.text = heroInfo.name; cardName.text = info.cardTeamName; ResourceManager.Instance.LoadPrefab(heroInfo.res, LoadComplete, LoadFail, item); } }
/// <summary>加载A队人物伍完成</summary> /// <param name="abName"></param> /// <param name="obj"></param> /// <param name="param"></param> private void OnLoader_FSideAvatarCompleteTest(string abName, GameObject obj, object param) { CreateSpineAni create = obj.GetComponent <CreateSpineAni>(); create.SpineScale = new Vector3(0.01f, 0.01f, 0.01f); int index; CardRole cdRole = obj.GetComponent <CardRole>(); if (FightProxy.Instance.RoomInfo != null) { FightHeroMsg msg = param as FightHeroMsg; cdRole.SerData = msg; index = msg.pos - 1; cdRole.SlotIndex = msg.pos; CardRoleDidDic[msg.heroId] = cdRole; } else { index = param.ToInt(); FightHeroMsg msg = new FightHeroMsg(); msg.heroId = index; cdRole.SerData = msg; cdRole.SerData.pos = index; cdRole.SlotIndex = index + 1; CardRoleDidDic[msg.heroId] = cdRole; } cdRole.SlotPostion = Instance.MyPosition[index].position; obj.transform.position = Instance.MyPosition[index].position; TransformCardRoleTeamA[obj.transform] = cdRole; obj.layer = LayerMask.NameToLayer("MapLayer"); Facade.Instance.SendNotification(NotificationID.FightRoleHp_AddMyHP, cdRole); }