主题
GameCore.Data
GameDataNativeCacheAttribute 双端
命名空间 GameCore.Data
csharp
public sealed class GameDataNativeCacheAttribute : Attribute标记某个 GameData 类型在 native 侧可能存在缓存表示。
备注
该特性用于向调用方、工具链和文档说明: 当前类型在客户端、服务端或双端的 native 层可能存在缓存表示。 这不保证所有平台都支持显式刷新,只表示该类型应被视为潜在的 native 缓存参与者。
构造函数
GameDataNativeCacheAttribute 双端
csharp
public GameDataNativeCacheAttribute(NativeCacheSide side)属性
Side 双端
csharp
public NativeCacheSide Side { get; }获取该类型可能参与 native 缓存的平台侧别。
GameDataUnitProperty 双端
命名空间 GameCore.Data
csharp
public class GameDataUnitProperty : GameDataCategory<GameDataUnitProperty>, IGameDataCategory<GameDataUnitProperty>, IGameData<GameDataUnitProperty>, IGameData单位属性配置,定义同步方式与计算公式。
构造函数
GameDataUnitProperty 双端
csharp
public GameDataUnitProperty(GameLink<GameDataUnitProperty, GameDataUnitProperty> link)GameDataUnitProperty 双端
csharp
public GameDataUnitProperty(IGameLink<GameDataUnitProperty> link)属性
SyncType 双端
csharp
public SyncType SyncType { get; set; }属性同步类型,决定哪些客户端可见该属性(如视野内、全图等)。
UseCustomFormula 双端
csharp
public bool UseCustomFormula { get; set; }是否使用自定义公式计算属性值。
CustomFormula 双端
csharp
public UnitPropertyFormula? CustomFormula { get; set; }自定义属性计算公式,需配合 UseCustomFormula 使用。
IGameDataMorph 双端
命名空间 GameCore.Data
csharp
public interface IGameDataMorphDefines the interface for morph transformation data, allowing entities to change into different unit types.
备注
This interface provides configuration for morphing abilities that can transform one unit type into another. Morphing is commonly used for shape-shifting abilities, unit upgrades, or transformation effects. The transformation maintains certain properties while changing the unit's fundamental type and capabilities.
属性
MorphUnit 双端
csharp
public IGameLink<GameDataUnit> MorphUnit { get; }Gets the game data link for the unit type that this morph will transform the entity into.
备注
This defines the target unit type for the morphing transformation. The entity will change from its current unit type to the type specified by this link, gaining new abilities, models, and properties defined by the target unit data.
MorphFlags 双端
csharp
public MorphFlags MorphFlags { get; }Gets the flags that control how the morphing transformation behaves.
备注
These flags determine various aspects of the morphing process, such as whether certain properties are preserved, how the transformation is visually presented, and what restrictions or conditions apply during the morph operation.
IGameDataNativeCacheRefreshable 双端
命名空间 GameCore.Data
csharp
public interface IGameDataNativeCacheRefreshable表示该 GameData 类型支持请求刷新 native 侧缓存。
备注
不同平台对具体缓存链路的支持范围可能不同。 当目标平台未接通对应缓存链路时,调用实现通常会安全忽略该请求。
方法
SetNativeCacheRefresh 双端
csharp
void SetNativeCacheRefresh(bool refresh = true)请求刷新此 GameData 在 native 侧的缓存状态。
refresh— 为true时,请求后续 native 读取时重建缓存; 为false时,清除此刷新请求。
NativeCacheSide 双端
命名空间 GameCore.Data
csharp
public enum NativeCacheSide指示该 GameData 类型在 native 侧可能存在缓存表示的平台范围。
枚举值
None = 0Client = 1Server = 2Both = 3