Пример #1
0
 public void Destroy()
 {
     lock (this)
     {
         if (SwigObject == null) return;
         GC.Collector.AddObject(SwigObject);
         SwigObject = null;
     }
     Particular.GC.SuppressFinalize(this);
 }
Пример #2
0
        internal MaterialPropertyBlock(swig.MaterialPropertyBlock coreInstance)
        {
#if DEBUG
            // 唯一の対応するクラスであることを保証
            if (GC.MaterialPropertyBlocks.Contains(coreInstance.GetPtr()))
            {
                Particular.Helper.ThrowException("");
            }
#endif
            CoreInstance = coreInstance;
        }
Пример #3
0
        internal MaterialPropertyBlock(swig.MaterialPropertyBlock swig)
        {
#if DEBUG
            // 唯一の対応するクラスであることを保証
            if (GC.MaterialPropertyBlocks.GetObject(swig.GetPtr()) != null)
            {
                Particular.Helper.ThrowException("");
            }
#endif
            SwigObject = swig;
        }
Пример #4
0
        internal static MaterialPropertyBlock GenerateMaterialPropertyBlock(swig.MaterialPropertyBlock o, GenerationType type)
        {
            if (o == null)
            {
                return(null);
            }
            var p = o.GetPtr();

            var existing = GC.MaterialPropertyBlocks.GetObject(p);

            existing = GenerateInternal(existing, o, type);
            if (existing != null)
            {
                return(existing);
            }

            var ret = new MaterialPropertyBlock(o);

            GC.MaterialPropertyBlocks.AddObject(p, ret);
            return(ret);
        }