public static IntPtr GetConfigBlock(this UIGraphData self, int index, byte config) { HeaderConfig *header = (HeaderConfig *)(GetNodePointer(self, index) + sizeof(int)).ToPointer(); var childCount = header->childCount; var offset = UIConfigUtility.GetOffset(header->configurationMask, config); return(((IntPtr)header) + UnsafeUtility.SizeOf <HeaderConfig>() + (sizeof(int) * childCount) + offset); }
public static bool HasConfigBlock(this UIGraphData self, int index, byte config) { HeaderConfig *header = (HeaderConfig *)(GetNodePointer(self, index) + sizeof(int)).ToPointer(); var childCount = header->childCount; var offset = UIConfigUtility.GetOffset(header->configurationMask, config); if (offset < 0) { return(false); } else { return(true); } }
public static bool TryGetConfigBlock(this UIGraphData self, int index, byte config, out IntPtr result) { HeaderConfig *header = (HeaderConfig *)(GetNodePointer(self, index) + sizeof(int)).ToPointer(); var childCount = header->childCount; var offset = UIConfigUtility.GetOffset(header->configurationMask, config); if (offset < 0) { result = IntPtr.Zero; return(false); } else { result = ((IntPtr)header) + UnsafeUtility.SizeOf <HeaderConfig>() + (sizeof(int) * childCount) + offset; return(true); } }