Esempio n. 1
0
            public void AddRef(CowValue value)
            {
                ReferenceCount++;
            #if UDONSHARP_DEBUG
                _referenceHolders.Add(value);
            #endif

                if (DeclaredContext.TopTable != DeclaredTable)
                {
                    throw new Exception($"CowValueInternalTracker for {SourceValue} has had ref added from different symbol table scope.");
                }
            }
Esempio n. 2
0
            public void ClearRef(CowValue value)
            {
                ReferenceCount--;
                // Debug.Log($"Clearing ref for {value.Value}, new ref count {ReferenceCount}\n{new StackTrace()}");

            #if UDONSHARP_DEBUG
                if (!_referenceHolders.Remove(value))
                {
                    throw new Exception("No matching holder for COWValue");
                }
            #endif

                if (DeclaredContext.TopTable != DeclaredTable)
                {
                    throw new Exception($"CowValueInternalTracker for {SourceValue} has had ref added from different symbol table scope.");
                }
            }