summaryrefslogtreecommitdiff
path: root/WorldlineKeepers/Assets/Scripts/Stats
diff options
context:
space:
mode:
Diffstat (limited to 'WorldlineKeepers/Assets/Scripts/Stats')
-rw-r--r--WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs28
-rw-r--r--WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsMetadata.cs2
2 files changed, 20 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
diff --git a/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsMetadata.cs b/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsMetadata.cs
index c240ca1..dbb0942 100644
--- a/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsMetadata.cs
+++ b/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsMetadata.cs
@@ -16,6 +16,8 @@ namespace WK.Data
public string type;
+ public string behaviour;
+
// 暂留数据
public string extra_data;
}