进入和离开地图和房间协议合并

This commit is contained in:
2025-09-09 00:18:10 +08:00
parent f1672122be
commit cb856ec8c4
13 changed files with 142 additions and 240 deletions

View File

@@ -78,31 +78,43 @@ namespace NBC
[ProtoMember(4)]
public float w { get; set; }
}
/// <summary>
/// 玩家当前使用钓组信息
/// </summary>
[ProtoContract]
public partial class UnitFishingInfo : AMessage, IProto
public partial class GearInfo : AMessage, IProto
{
public static UnitFishingInfo Create(Scene scene)
public static GearInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<UnitFishingInfo>();
return scene.MessagePoolComponent.Rent<GearInfo>();
}
public override void Dispose()
{
Rod = default;
Rigs.Clear();
LineLength = default;
ReelSpeed = default;
OpenLight = default;
RodSetting = default;
State = default;
Position = default;
Rotation = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<UnitFishingInfo>(this);
GetScene().MessagePoolComponent.Return<GearInfo>(this);
#endif
}
[ProtoMember(1)]
public float LineLength { get; set; }
public long Rod { get; set; }
[ProtoMember(2)]
public float ReelSpeed { get; set; }
public List<long> Rigs = new List<long>();
[ProtoMember(3)]
public bool OpenLight { get; set; }
public float LineLength { get; set; }
[ProtoMember(4)]
public int RodSetting { get; set; }
public float ReelSpeed { get; set; }
[ProtoMember(5)]
public int State { get; set; }
[ProtoMember(6)]
public Vector3Info Position { get; set; }
[ProtoMember(7)]
public Vector3Info Rotation { get; set; }
}
[ProtoContract]
public partial class UnitStateInfo : AMessage, IProto
@@ -138,9 +150,8 @@ namespace NBC
Position = default;
Rotation = default;
State = default;
Gears = default;
FishingInfo = default;
KV.Clear();
Gears.Clear();
Propertys.Clear();
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<MapUnitInfo>(this);
#endif
@@ -156,10 +167,8 @@ namespace NBC
[ProtoMember(5)]
public UnitStateInfo State { get; set; }
[ProtoMember(6)]
public GearInfo Gears { get; set; }
public List<GearInfo> Gears = new List<GearInfo>();
[ProtoMember(7)]
public UnitFishingInfo FishingInfo { get; set; }
[ProtoMember(8)]
public List<KeyValueInt32> KV = new List<KeyValueInt32>();
public List<KeyValueInt32> Propertys = new List<KeyValueInt32>();
}
}