Esempio n. 1
0
        /// <summary>
        /// 属性改变
        /// </summary>
        private void OnUnitAttrModifyInt(PacketBase packet)
        {
            ss2gl.NotifyUpdatePlayerAttribInteger msg = packet as ss2gl.NotifyUpdatePlayerAttribInteger;
            Unit unit = UnitManager.Instance.GetUnitByIdx(msg.char_idx);

            if (unit != null)
            {
                unit.UpdateAttribute(msg.type, msg.value);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 发给gl
        /// </summary>
        /// <param name="type"></param>
        /// <param name="nValue"></param>
        private void Send2GL(eUnitModType type, long nValue)
        {
            Player player = m_owner_unit as Player;

            if (player == null)
            {
                return;
            }

            ss2gl.NotifyUpdatePlayerAttribInteger msg = PacketPools.Get(ss2gl.msg.UNIT_MODIFY_INT) as ss2gl.NotifyUpdatePlayerAttribInteger;
            msg.char_idx = player.char_idx;
            msg.type     = type;
            msg.value    = nValue;
            ServerNetManager.Instance.Send2GL(msg);
        }