From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/ProtoBuf/ProtoEnumAttribute.cs | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/ProtoBuf/ProtoEnumAttribute.cs (limited to 'Client/Assets/Scripts/XMainClient/ProtoBuf/ProtoEnumAttribute.cs') diff --git a/Client/Assets/Scripts/XMainClient/ProtoBuf/ProtoEnumAttribute.cs b/Client/Assets/Scripts/XMainClient/ProtoBuf/ProtoEnumAttribute.cs new file mode 100644 index 00000000..926a33c7 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/ProtoBuf/ProtoEnumAttribute.cs @@ -0,0 +1,44 @@ +using System; + +namespace ProtoBuf +{ + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] + public sealed class ProtoEnumAttribute : Attribute + { + public int Value + { + get + { + return this.enumValue; + } + set + { + this.enumValue = value; + this.hasValue = true; + } + } + + public string Name + { + get + { + return this.name; + } + set + { + this.name = value; + } + } + + private bool hasValue; + + private int enumValue; + + private string name; + + public bool HasValue() + { + return this.hasValue; + } + } +} -- cgit v1.1-26-g67d0