public unsafe ref T GetDataRef(int index, INodeBlob blob, IBlackboard bb) { // NOTE: error CS8170: Struct members cannot return 'this' or other instance members by reference // return ref VariableRegisters<T>.GetDataRef(VariableId)(ref this, index, blob, bb); var ptr = UnsafeUtility.AddressOf(ref VariableRegisters <T> .GetDataRef(VariableId)(ref this, index, blob, bb)); return(ref UnsafeUtilityEx.AsRef <T>(ptr)); }
static ComponentVariableProperty() { VariableRegisters <T> .Register(_DYNAMIC_ID, GetData, GetDataRef, GetDynamicAccess); VariableRegisters <T> .Register(_COPYTOLOCAL_ID, CopyAndGetData, CopyAndGetDataRef, GetCopyToLocalAccess); VariableRegisters <T> .Register(_LOCAL_ID, GetLocalData, GetLocalDataRef, GetCopyToLocalAccess); }
static ComponentVariableProperty() { var type = typeof(ComponentVariableProperty <T>); VariableRegisters <T> .Register(_DYNAMIC_ID, type.Getter("GetData"), type.Getter("GetDataRef"), GetDynamicAccess); VariableRegisters <T> .Register(_COPYTOLOCAL_ID, type.Getter("CopyAndGetData"), type.Getter("CopyAndGetDataRef"), GetCopyToLocalAccess); VariableRegisters <T> .Register(_LOCAL_ID, type.Getter("GetLocalData"), type.Getter("GetLocalDataRef"), GetCopyToLocalAccess); }
static NodeVariableProperty() { VariableRegisters <T> .Register(_ID_RUNTIME_NODE, GetRuntimeNodeData, GetRuntimeNodeDataRef); VariableRegisters <T> .Register(_ID_DEFAULT_NODE, GetDefaultNodeData, GetDefaultNodeDataRef); VariableRegisters <T> .Register(_ID_DEFAULT_NODE_VARIABLE, GetDefaultNodeVariable, GetDefaultNodeVariableRef); VariableRegisters <T> .Register(_ID_RUNTIME_NODE_VARIABLE, GetRuntimeNodeVariable, GetRuntimeNodeVariableRef); }
static NodeVariableProperty() { var type = typeof(NodeVariableProperty <T>); VariableRegisters <T> .Register(_ID_RUNTIME_NODE, type.Getter("GetRuntimeNodeData"), type.Getter("GetRuntimeNodeDataRef")); VariableRegisters <T> .Register(_ID_DEFAULT_NODE, type.Getter("GetDefaultNodeData"), type.Getter("GetDefaultNodeDataRef")); VariableRegisters <T> .Register(_ID_DEFAULT_NODE_VARIABLE, type.Getter("GetDefaultNodeVariable"), type.Getter("GetDefaultNodeVariableRef")); VariableRegisters <T> .Register(_ID_RUNTIME_NODE_VARIABLE, type.Getter("GetRuntimeNodeVariable"), type.Getter("GetRuntimeNodeVariableRef")); }
static ScriptableObjectVariableProperty() { VariableRegisters <T> .Register(ID, GetData, GetDataRef); }
static ScriptableObjectVariableProperty() { var type = typeof(ScriptableObjectVariableProperty <T>); VariableRegisters <T> .Register(ID, type.Getter("GetData"), type.Getter("GetDataRef")); }
static CustomVariableProperty() { VariableRegisters <T> .Register(ID, GetData, GetDataRef); }
public T GetData <TNodeBlob, TBlackboard>(int index, ref TNodeBlob blob, ref TBlackboard bb) where TNodeBlob : struct, INodeBlob where TBlackboard : struct, IBlackboard { return(VariableRegisters <T> .GetData <TNodeBlob, TBlackboard>(VariableId)(ref this, index, ref blob, ref bb)); }
static CustomVariableProperty() { var type = typeof(CustomVariableProperty <T>); VariableRegisters <T> .Register(ID, type.Getter("GetData"), type.Getter("GetDataRef")); }
public T GetData(int index, INodeBlob blob, IBlackboard bb) { return(VariableRegisters <T> .GetData(VariableId)(ref this, index, blob, bb)); }
public unsafe ref T GetDataRef(int index, INodeBlob blob, IBlackboard bb) { var ptr = UnsafeUtility.AddressOf(ref VariableRegisters <T> .GetDataRef(VariableId)(ref this, index, blob, bb)); return(ref UnsafeUtilityEx.AsRef <T>(ptr)); }