public override void InitEquipment(Pathea.PeEntity entity, ItemAsset.ItemObject itemObj) { base.InitEquipment(entity, itemObj); m_Equip.SetEnergySheild(this); m_EnergyAttr = m_ItemObj.GetCmpt <ItemAsset.Energy>(); if (null != m_EnergyAttr) { m_Entity.SetAttribute(AttribType.Shield, m_EnergyAttr.energy.current); m_EnergyAttr.SetMax(m_MaxEnergy); } m_Entity.SetAttribute(AttribType.ShieldMax, m_MaxEnergy); lastUsedTime = Time.time; m_Time = new UTimer(); m_Time.ElapseSpeed = -1f; m_Time.Second = GameConfig.NetUpdateInterval; m_LastNetValue = enCurrent; if (!m_Active) { DeactiveSheild(); } }
public override void RemoveEquipment() { base.RemoveEquipment(); if (null != m_Energy) { m_Energy.SetMax(m_Entity.GetAttribute(AttribType.EnergyMax)); m_Energy.floatValue.current = m_Entity.GetAttribute(AttribType.Energy); m_Entity.SetAttribute(AttribType.EnergyMax, 0); m_Entity.SetAttribute(AttribType.Energy, 0); } }