Example #1
0
 public void Destroy(CGModule module, Component obj, string context, bool kill)
 {
     if (obj != null)
     {
         if (kill)
         {
             if (Application.isPlaying)
                 GameObject.Destroy(obj.gameObject);
             else
                 GameObject.DestroyImmediate(obj.gameObject);
         }
         else
         {
             obj.StripComponents(typeof(CGMeshResource), typeof(MeshFilter), typeof(MeshRenderer));
             module.Generator.PoolManager.GetComponentPool<CGMeshResource>().Push(obj);
         }
     }
 }