/// <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(); }
/// <summary> /// 其他玩家的坐骑构造 /// </summary> /// <param name="_msg"></param> public MountInfo(scene_ply _msg, PlayerBaseInfo _belongto) { //Debug.Log(" MountInfo " + " rideType : " + _msg.ride_type + " ,rideState : " + _msg.ride_state + " , skin : " + _msg.currskin + " , ridelev : " + _msg.ride_lev); ownerInfo = _belongto; serverData = new MountData(); 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 (OnRideStateUpdate != null) { OnRideStateUpdate(serverData.isRiding); } if (ownerInfo.OnMountRideStateUpdate != null) { ownerInfo.OnMountRideStateUpdate(serverData.isRiding, true); } UpdateMountEffect(); }