public void Destroy() { lock (this) { if (SwigObject == null) return; GC.Collector.AddObject(SwigObject); SwigObject = null; } Particular.GC.SuppressFinalize(this); }
internal MaterialPropertyBlock(swig.MaterialPropertyBlock coreInstance) { #if DEBUG // 唯一の対応するクラスであることを保証 if (GC.MaterialPropertyBlocks.Contains(coreInstance.GetPtr())) { Particular.Helper.ThrowException(""); } #endif CoreInstance = coreInstance; }
internal MaterialPropertyBlock(swig.MaterialPropertyBlock swig) { #if DEBUG // 唯一の対応するクラスであることを保証 if (GC.MaterialPropertyBlocks.GetObject(swig.GetPtr()) != null) { Particular.Helper.ThrowException(""); } #endif SwigObject = swig; }
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); }