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.cs58
-rw-r--r--WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs.meta11
-rw-r--r--WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsMetadata.cs23
-rw-r--r--WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsMetadata.cs.meta11
4 files changed, 103 insertions, 0 deletions
diff --git a/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs b/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs
new file mode 100644
index 0000000..b4869cb
--- /dev/null
+++ b/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs
@@ -0,0 +1,58 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using UnityEngine;
+using WK.Data;
+
+namespace WK
+{
+
+ [System.Runtime.InteropServices.StructLayout(LayoutKind.Explicit)]
+ public struct CharacterStatsValue
+ {
+ [System.Runtime.InteropServices.FieldOffset(0)]
+ public int i;
+ [System.Runtime.InteropServices.FieldOffset(0)]
+ public float f;
+ [System.Runtime.InteropServices.FieldOffset(0)]
+ public bool boolean;
+ [System.Runtime.InteropServices.FieldOffset(0)]
+ public char c;
+ [System.Runtime.InteropServices.FieldOffset(0)]
+ public Vector2 v2;
+ [System.Runtime.InteropServices.FieldOffset(0)]
+ public Vector3 v3;
+ [System.Runtime.InteropServices.FieldOffset(0)]
+ public Vector4 v4;
+ [System.Runtime.InteropServices.FieldOffset(0)]
+ public Color color;
+ }
+
+
+ /// <summary>
+ /// 运行时角色基础属性
+ /// </summary>
+ public abstract class CharacterStats
+ {
+
+ /// <summary>
+ /// 表格数据
+ /// </summary>
+ public CharacterStatsMetadata metadata;
+
+ /// <summary>
+ /// 当前属性值
+ /// </summary>
+ public CharacterStatsValue value;
+
+ public string uid
+ {
+ get
+ {
+ return metadata.uid;
+ }
+ }
+
+ }
+
+}
diff --git a/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs.meta b/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs.meta
new file mode 100644
index 0000000..758018e
--- /dev/null
+++ b/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 749cbea7742c65244b0d1a662be4fb9e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsMetadata.cs b/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsMetadata.cs
new file mode 100644
index 0000000..3b0b13b
--- /dev/null
+++ b/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsMetadata.cs
@@ -0,0 +1,23 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace WK.Data
+{
+
+ /// <summary>
+ /// 角色基础属性元数据
+ /// </summary>
+ public class CharacterStatsMetadata
+ {
+ public string uid;
+
+ public string name_key;
+
+ public int type;
+
+ // 暂留数据
+ public string extra_data;
+ }
+
+}
diff --git a/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsMetadata.cs.meta b/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsMetadata.cs.meta
new file mode 100644
index 0000000..a8d9a08
--- /dev/null
+++ b/WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsMetadata.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 63006c2b6a413714bb852f46b214df90
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant: