private void OnUnitAttrModifyString(PacketBase packet) { ss2gl.NotifyUpdatePlayerAttribString msg = packet as ss2gl.NotifyUpdatePlayerAttribString; Unit unit = UnitManager.Instance.GetUnitByIdx(msg.char_idx); if (unit != null) { unit.UpdateAttribute(msg.type, msg.value); } }
/// <summary> /// 发给gl-string /// </summary> /// <param name="type"></param> /// <param name="nValue"></param> private void Send2GL(eUnitModType type, string nValue) { Player player = m_owner_unit as Player; if (player == null) { return; } ss2gl.NotifyUpdatePlayerAttribString msg = PacketPools.Get(ss2gl.msg.UNIT_MODIFY_STRING) as ss2gl.NotifyUpdatePlayerAttribString; msg.char_idx = player.char_idx; msg.type = type; msg.value = nValue; ServerNetManager.Instance.Send2GL(msg); }