summaryrefslogtreecommitdiff
path: root/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs
diff options
context:
space:
mode:
authorchai <215380520@qq.com>2023-05-13 15:20:20 +0800
committerchai <215380520@qq.com>2023-05-13 15:20:20 +0800
commit6fb204d494b897907d655b5752196983a82ceba2 (patch)
tree99b874414e9578cb68be5390b2cf08d2069ca77e /WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs
parent6c91f1ed6810a57da08a24dd1359f288c443dd75 (diff)
*misc
Diffstat (limited to 'WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs')
-rw-r--r--WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs28
1 files changed, 18 insertions, 10 deletions
diff --git a/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs b/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs
index b4869cb..8dbb161 100644
--- a/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs
+++ b/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs
@@ -7,24 +7,24 @@ using WK.Data;
namespace WK
{
- [System.Runtime.InteropServices.StructLayout(LayoutKind.Explicit)]
+ [StructLayout(LayoutKind.Explicit)]
public struct CharacterStatsValue
{
- [System.Runtime.InteropServices.FieldOffset(0)]
+ [FieldOffset(0)]
public int i;
- [System.Runtime.InteropServices.FieldOffset(0)]
+ [FieldOffset(0)]
public float f;
- [System.Runtime.InteropServices.FieldOffset(0)]
+ [FieldOffset(0)]
public bool boolean;
- [System.Runtime.InteropServices.FieldOffset(0)]
+ [FieldOffset(0)]
public char c;
- [System.Runtime.InteropServices.FieldOffset(0)]
+ [FieldOffset(0)]
public Vector2 v2;
- [System.Runtime.InteropServices.FieldOffset(0)]
+ [FieldOffset(0)]
public Vector3 v3;
- [System.Runtime.InteropServices.FieldOffset(0)]
+ [FieldOffset(0)]
public Vector4 v4;
- [System.Runtime.InteropServices.FieldOffset(0)]
+ [FieldOffset(0)]
public Color color;
}
@@ -44,7 +44,15 @@ namespace WK
/// µ±Ç°ÊôÐÔÖµ
/// </summary>
public CharacterStatsValue value;
-
+
+ public ref int intValue => ref value.i;
+ public ref bool boolValue => ref value.boolean;
+ public ref float floatValue => ref value.f;
+ public ref char chartValue => ref value.c;
+ public ref Vector2 Vector2Value => ref value.v2;
+ public ref Vector3 Vector3Value => ref value.v3;
+ public ref Vector4 Vector4Value => ref value.v4;
+
public string uid
{
get