示例#1
0
    /// <summary>
    /// 骑乘状态或者坐骑装备变化(其他人)
    /// </summary>
    /// <param name="_msg"></param>
    public void Update(scene_ply _msg)
    {
        //Debug.Log("mountID:" + _msg.ride_type + ",Skin:" + _msg.currskin + ",ride:" + _msg.ride_state + "  ,ridelev : " + _msg.ride_lev);
        bool changeRide  = (_msg.ride_state == (byte)1) != serverData.isRiding;
        bool changeModel = (serverData.curChangeId != _msg.currskin) || (serverData.configID != _msg.ride_type);

        {
            serverData.configID = (int)_msg.ride_type;
        }
        if (_msg.currskin != 0)
        {
            serverData.configID = (int)_msg.currskin;
        }
        serverData.isRiding = _msg.ride_state == (byte)1;
        serverData.lev      = _msg.ride_lev;
        if (changeRide)
        {
            if (OnRideStateUpdate != null)
            {
                OnRideStateUpdate(serverData.isRiding);
            }
            if (ownerInfo.OnMountRideStateUpdate != null)
            {
                ownerInfo.OnMountRideStateUpdate(serverData.isRiding, true);
            }
        }
        if (changeModel)
        {
            ownerInfo.UpdateMount(this);
        }
        UpdateMountEffect();
    }
示例#2
0
 /// <summary>
 /// 以服务端数据和PlayerBaseInfo构造MountInfo
 /// </summary>
 public MountInfo(MountData _actorData, PlayerBaseInfo _info)
 {
     hasInited  = true;
     serverData = _actorData;
     ownerInfo  = _info;
     if (RefData != null)
     {
         previewItem = new EquipmentInfo(RefData.itemID, 1, EquipmentBelongTo.PREVIEW);
     }
     if (ownerInfo != null && _actorData.isRiding)
     {
         ownerInfo.UpdateMount(this);
     }
     ProcessLevEffect();
 }