/// <summary> /// 属性改变 /// </summary> private void OnUnitAttrModifyInt(PacketBase packet) { ss2fs.NotifyUpdatePlayerAttribInteger msg = packet as ss2fs.NotifyUpdatePlayerAttribInteger; Unit unit = UnitManager.Instance.GetUnitByIdx(msg.char_idx); if (unit != null) { unit.UpdateAttribute(msg.type, msg.value); } }
/// <summary> /// 发给fs /// </summary> /// <param name="type"></param> /// <param name="nValue"></param> private void Send2FS(eUnitModType type, long nValue) { Player player = m_owner_unit as Player; if (player == null) { return; } ss2fs.NotifyUpdatePlayerAttribInteger msg = PacketPools.Get(ss2fs.msg.UNIT_MODIFY_INT) as ss2fs.NotifyUpdatePlayerAttribInteger; msg.char_idx = player.char_idx; msg.type = type; msg.value = nValue; ServerNetManager.Instance.Send2FS(player.fs_uid, msg); }