Exemple #1
0
 public static void Release(this GameObject o, int poolID = 0)
 {
     if (poolID <= 0)
     {
         GameObject.Destroy(o);
     }
     else
     {
         HandlePool.Despawn(poolID, o);
     }
 }
Exemple #2
0
        internal void ClearSessionData()
        {
            if (applicationIsQuitting)
            {
                return;
            }

            var toWipe = new List <int>();

            foreach (var pair in data)
            {
                var isKernel = pair.Value as IKernel;
                if (isKernel == null)
                {
                    toWipe.Add(pair.Key);
                }

                var needToBeCleaned = pair.Value as IDisposable;
                if (needToBeCleaned == null)
                {
                    continue;
                }

                needToBeCleaned.Dispose();
            }

            HandlePool.Dispose();
            ProcessorGroups.Dispose();
            ProcessorTimer.Default.Dispose();
            ProcessorScene.Default.Dispose();
            ProcessorUpdate.Default.Dispose();
            Box.Default.Dispose();

            for (var i = 0; i < toWipe.Count; i++)
            {
                data.Remove(toWipe[i]);
            }
        }