From 2fc9585797067730f28b03b0727bf05f9deed091 Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Fri, 12 May 2023 10:32:11 +0800 Subject: + worldline keepers --- .../Assets/Scripts/Stats/CharacterStatsBase.cs | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs (limited to 'WorldlineKeepers/Assets/Scripts/Stats/CharacterStatsBase.cs') 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; + } + + + /// + /// 运行时角色基础属性 + /// + public abstract class CharacterStats + { + + /// + /// 表格数据 + /// + public CharacterStatsMetadata metadata; + + /// + /// 当前属性值 + /// + public CharacterStatsValue value; + + public string uid + { + get + { + return metadata.uid; + } + } + + } + +} -- cgit v1.1-26-g67d0