コード例 #1
0
            public UdonHeapValueStorage(IUdonHeap heap, IUdonSymbolTable symbolTable, string symbolKey)
            {
                this.heap = heap;

                bool isValid = symbolTable.TryGetAddressFromSymbol(symbolKey, out symbolAddress) &&
                               heap.GetHeapVariableType(symbolAddress) == typeof(T) &&
                               heap.TryGetHeapVariable <T>(symbolAddress, out var validityCheckPlaceholder);

                if (!isValid)
                {
                    symbolAddress = 0xFFFFFFFF;
                }
            }
コード例 #2
0
            public UdonHeapValueStorage(IUdonHeap heap, IUdonSymbolTable symbolTable, string symbolKey)
            {
                this.heap = heap;

                bool isValid = symbolTable.TryGetAddressFromSymbol(UdonSharpUtils.UnmanglePropertyFieldName(symbolKey), out symbolAddress) &&
                               heap.GetHeapVariableType(symbolAddress) == typeof(T) &&
                               heap.TryGetHeapVariable <T>(symbolAddress, out _);

                if (!isValid)
                {
                    symbolAddress = 0xFFFFFFFF;
                }
            }