Example #1
0
        internal SoundSource(swig.SoundSource swig)
        {
#if DEBUG
            // 唯一の対応するクラスであることを保証
            if (GC.SoundSources.GetObject(swig.GetPtr()) != null)
            {
                throw new Exception();
            }
#endif
            SwigObject = swig;
        }
Example #2
0
        internal SoundSource(swig.SoundSource swig)
        {
#if DEBUG
            // 唯一の対応するクラスであることを保証
            if (GC.SoundSources.GetObject(swig.GetPtr()) != null)
            {
                Particular.Helper.ThrowException("");
            }
#endif
            CoreInstance = swig;
        }
Example #3
0
        internal SoundSource(swig.SoundSource coreInstance)
        {
#if DEBUG
            // 唯一の対応するクラスであることを保証
            if (GC.SoundSources.Contains(coreInstance.GetPtr()))
            {
                Particular.Helper.ThrowException("");
            }
#endif
            CoreInstance = coreInstance;
        }
Example #4
0
 public void Destroy()
 {
     lock (this)
     {
         if (SwigObject == null)
         {
             return;
         }
         GC.Collector.AddObject(SwigObject);
         SwigObject = null;
     }
     System.GC.SuppressFinalize(this);
 }
Example #5
0
        /// <summary>
        /// ネイティブのインスタンスからラッパー側のインスタンスを生成する。
        /// </summary>
        /// <param name="o"></param>
        /// <param name="type"></param>
        internal static SoundSource GenerateSoundSource(swig.SoundSource o, GenerationType type)
        {
            var p = o.GetPtr();

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

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

            var ret = new SoundSource(o);

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