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

This commit is contained in:
2025-09-09 00:17:50 +08:00
parent ebb1a467c4
commit a2c5b61ba8
16 changed files with 228 additions and 287 deletions

View File

@@ -86,31 +86,43 @@ namespace Fantasy
[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
@@ -146,9 +158,8 @@ namespace Fantasy
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
@@ -164,10 +175,8 @@ namespace Fantasy
[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>();
}
}