コード例 #1
0
        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);
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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);
            }
        }