public override void SetSenderIcon(uint senderID, uint transferLv) { string icon_name = RoleHelp.GetPlayerIconName(senderID, transferLv, false); Sprite iconSpr = mSpriteList.LoadSprite(icon_name); if (null != iconSpr) { mSenderIconImg.sprite = iconSpr; } }
public void InsertOneServerRoleHead(GameObject roleHead, ServerRoleInfo serverRoleInfo) { GameObject item = GameObject.Instantiate(roleHead); item.SetActive(true); item.name = "ServerRole_" + serverRoleInfo.RoleId; Transform itemTrans = item.transform; itemTrans.SetParent(roleHead.transform.parent); itemTrans.localScale = Vector3.one; itemTrans.localPosition = Vector3.zero; // 等级,新角色控制服会发0过来,强制显示成1 Text levelText = itemTrans.Find("Text").GetComponent <Text>(); if (serverRoleInfo.Level <= 0) { levelText.text = "1"; } else { // 巅峰等级 Image lvBGImage = itemTrans.Find("LvBG").GetComponent <Image>(); Image peakLvBGImage = itemTrans.Find("PeakLvBG").GetComponent <Image>(); uint peakLevel = 0; bool isPeak = TransferHelper.IsPeak((uint)serverRoleInfo.Level, out peakLevel, serverRoleInfo.TransferLv); if (isPeak == true) { lvBGImage.gameObject.SetActive(false); peakLvBGImage.gameObject.SetActive(true); } else { lvBGImage.gameObject.SetActive(true); peakLvBGImage.gameObject.SetActive(false); } levelText.text = peakLevel.ToString(); } // 头像 Image headImage = itemTrans.Find("HeadImage").GetComponent <Image>(); headImage.sprite = mRoleHeadSpriteList.LoadSprite(RoleHelp.GetPlayerIconName((uint)serverRoleInfo.IconId, serverRoleInfo.TransferLv, false)); }
/// <summary> /// 技能装配信息发生改变 /// </summary> void OnSkillUpdate(xc.ClientEventBaseArgs data) { if (mCacheTrans == null) { return; } uint skillId = SkillManager.GetInstance().GetFitSkillId(mFuryHole); if (mSkillIdx != skillId) { // 装配的技能ID更换的时候,触发特效 if (mSkillIdx != 0) { if (mChangeEffect != null) { mChangeEffect.SetActive(false); mChangeEffect.SetActive(true); } } mSkillIdx = skillId; } mBasicSkillInfo = DBManager.Instance.GetDB <DBDataAllSkill>().GetOneAllSkillInfo_byActiveSkillId(skillId); mSkillInfo = DBSkillSev.Instance.GetSkillInfo(skillId); // 设置技能图标 if (mBasicSkillInfo != null && mSpriteList != null) { var sprite = mSpriteList.LoadSprite(mBasicSkillInfo.Icon); if (sprite != null) { mSkillImage.color = Color.white; mSkillImage.sprite = sprite; return; } } // 技能未装配,不显示技能对应图片 mSkillImage.color = Color.clear; }
/// <summary> /// 技能装配信息发生改变 /// </summary> void OnSkillUpdate(xc.ClientEventBaseArgs data) { if (mCacheTrans == null) { return; } uint skillId = SkillManager.GetInstance().GetFitSkillId(mFitPos); mSkillIdx = skillId; mBasicSkillInfo = DBManager.Instance.GetDB <DBDataAllSkill>().GetOneAllSkillInfo_byActiveSkillId(skillId); mSkillInfo = DBSkillSev.Instance.GetSkillInfo(skillId); DBSkillSev skill_db = DBManager.GetInstance().GetDB <DBSkillSev>(); mHasCastingReadyStage = skill_db.HasCastingReadyStage(skillId); // 设置技能图标 if (SkillHoleManager.Instance.IsHoleOpen(mFitPos) == false || SkillHoleManager.Instance.IsHoleWillOpen(mFitPos)) { mSkillImage.color = Color.clear; } else { if (skillId != 0)// 设置技能图标 { if (mBasicSkillInfo != null) { if (mSpriteList != null) { string icon_str = mBasicSkillInfo.Icon; if (mFitPos == (uint)DBCommandList.OPFlag.OP_A) //普攻 { var localPlayer = Game.Instance.GetLocalPlayer(); if (localPlayer != null && localPlayer.IsShapeShift)// 变身状态下的图标需要特殊处理 { icon_str = mBasicSkillInfo.Icon; if (string.IsNullOrEmpty(icon_str)) { VocationInfo info = DBVocationInfo.Instance.GetVocationInfo(Game.Instance.LocalPlayerVocation); if (info != null && string.IsNullOrEmpty(info.common_skill_icon_main) == false) { icon_str = info.common_skill_icon_main; } } } else { VocationInfo info = DBVocationInfo.Instance.GetVocationInfo(Game.Instance.LocalPlayerVocation); if (info != null && string.IsNullOrEmpty(info.common_skill_icon_main) == false) { icon_str = info.common_skill_icon_main; } } } Sprite sprite = mSpriteList.LoadSprite(icon_str); if (sprite != null) { mSkillImage.color = Color.white; mSkillImage.sprite = sprite; } else { mSkillImage.color = Color.clear; } } else { mSkillImage.color = Color.clear; } } else { mSkillImage.color = Color.clear; } } else// 技能未装配,不显示技能对应图片 { mSkillImage.color = Color.clear; } } }