public int GetEffect() { SkillBuff configVO = m_SkillProxy.GetBuff((int)VO.ID); if (configVO.ByteBuffer != null) { return(configVO.PropEffect); } return(0); }
public Buff(BuffVO vo, IBuffProperty property) { VO = vo; BuffProperty = property; // Cache m_SkillProxy = GameFacade.Instance.RetrieveProxy(ProxyName.CfgSkillSystemProxy) as CfgSkillSystemProxy; m_GameplayProxy = GameFacade.Instance.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy; Leyoutech.Utility.DebugUtility.LogWarning("Buff", string.Format("创建一个Buff ---> 归属entity = {0} , Buff ID = {1}", BuffProperty.EntityId(), VO.ID)); SkillBuff configVO = m_SkillProxy.GetBuff((int)VO.ID); if (configVO.ByteBuffer != null) { BuffEffect = BuffEffectBase.GetBuffEffectByType((BuffEffectType)configVO.BuffEffectId, this); Transform selfTf = BuffProperty.GetRootTransform(); SpacecraftEntity otherEntity = m_GameplayProxy.GetEntityById <SpacecraftEntity>(VO.Link_id) as SpacecraftEntity; Transform otherTf = null; if (otherEntity != null && !otherEntity.IsDead()) { otherTf = otherEntity.GetRootTransform(); } BuffEffect.Init(selfTf, otherTf); } else { BuffEffect = new BuffEffectBase(this); } }
public void CheckBuffPlaySound(uint buffId, bool isOpen) { CfgSkillSystemProxy skillProxy = GameFacade.Instance.RetrieveProxy(ProxyName.CfgSkillSystemProxy) as CfgSkillSystemProxy; SkillBuff configVO = skillProxy.GetBuff((int)buffId); if (isOpen && configVO.SoundAppearance > 0) { WwiseUtil.PlaySound(configVO.SoundAppearance, false, null); } else if (!isOpen && configVO.SoundEnd > 0) { WwiseUtil.PlaySound(configVO.SoundEnd, false, null); } }
/// <summary> /// 显示BuffIcon /// </summary> public void OnAddBufferIcon(SpacecraftEntity target) { RectTransform view = null; if (m_UIDToRectTranform1.ContainsKey(target.GetUId())) { view = m_UIDToRectTranform1[target.GetUId()].view; } else { if (m_UIDToRectTranform2.ContainsKey(target.GetUId())) { view = m_UIDToRectTranform2[target.GetUId()].view; } else { return; } } Transform bufferIconBox = view.Find("BuffIconBox"); if (bufferIconBox == null) { return; } bufferIconBox.gameObject.SetActive(true); Transform iconTemplate = bufferIconBox.GetChild(0); iconTemplate.gameObject.SetActive(false); int index = 0; if (target.GetAllBuffs().Count > 0) { foreach (KeyValuePair <uint, Buff> buffID2Value in target.GetAllBuffs()) { SkillBuff configVO = m_SkillProxy.GetBuff((int)buffID2Value.Key); Transform iconTras; if (configVO.ByteBuffer != null) { if ((BufferType)configVO.BuffHudShow == BufferType.None) { continue; } // Debug.LogError(target.GetName() + "==============" + configVO.Id + "========" //+ target.GetAllBuffs().Count + "=======" + (BufferType)configVO.BuffHudShow); index++; if (bufferIconBox.childCount >= index) { iconTras = bufferIconBox.GetChild(index - 1); } else { iconTras = Object.Instantiate(iconTemplate); iconTras.SetParent(bufferIconBox); iconTras.localScale = Vector3.one; iconTras.localPosition = Vector3.zero; iconTras.SetAsLastSibling(); } bufferIconBox.localScale = Vector3.one; if (m_MainEntity == target) { bufferIconBox.localScale = Vector3.one * 1.5f; } if ((uint)configVO.BuffHudIcon > 0) { UIUtil.SetIconImage(iconTras.GetComponent <Image>(), (uint)configVO.BuffHudIcon); } else { Debug.LogWarning("报错" + configVO.Id); } //Debug.Log(configVO.BuffHudIcon + "-=-=-=-=-=-" + configVO.BuffHudShow); switch ((BufferType)configVO.BuffHudShow) { case BufferType.All: // 1 全体 iconTras.gameObject.SetActive(true); break; case BufferType.Friend: // 2 友方 if (m_TeamProxy.GetMember(target.GetPlayerId()) != null) { iconTras.gameObject.SetActive(true); } break; case BufferType.Enemy: // 3 敌方 if (m_MainEntity != target && m_TeamProxy.GetMember(target.GetPlayerId()) == null) { iconTras.gameObject.SetActive(true); } break; case BufferType.Self: // 4 自己 if (m_MainEntity = target) { iconTras.gameObject.SetActive(true); } break; default: break; } } } // Debug.Log(index); for (int i = index; i < bufferIconBox.childCount; i++) { bufferIconBox.GetChild(i).gameObject.SetActive(false); } } else { for (int i = 0; i < bufferIconBox.childCount; i++) { bufferIconBox.GetChild(i).gameObject.SetActive(false); } } }