public static void CheckGenSurfExtractor()
    {
        // Init indice
        s_indiceMax = new int[SurfExtractorsMan.c_vertsCntMax];         // max number of vertices in an unity mesh
        for (int i = 0; i < SurfExtractorsMan.c_vertsCntMax; i++)
        {
            s_indiceMax [i] = i;
        }
        s_indice4Pool = new int[SurfExtractorsMan.c_vertsCnt4Pool];
        Array.Copy(s_indiceMax, s_indice4Pool, SurfExtractorsMan.c_vertsCnt4Pool);

        // Init extractor
        if (_vxSurfOpt != null && _vxSurfOpt.CompareTo(oclManager.CurOclOpt) == 0)
        {
            _vxSurfExtractor.Reset();
        }
        else
        {
            if (_vxSurfExtractor != null)
            {
                _vxSurfExtractor.CleanUp();
            }
#if UNITY_EDITOR
            oclManager.CurOclOpt = oclManager.OclOptionList[0];
            //oclManager.CurOclOpt = "aa";
            //oclManager.CurOclOpt = "OpenCL|NVIDIA CUDA     |GeForce GTX 560".Replace(' ', '_');
            //oclManager.CurOclOpt = "OpenCL|Intel(R) OpenCL |        Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz".Replace(' ', '_');
#endif
            oclManager.InitOclFromOpt();
            if (oclManager.ActiveOclMan != null)
            {
                _vxSurfExtractor = new SurfExtractorOclMC();
                _vxSurfExtractor.Init();
            }
            else
            {
                _vxSurfExtractor = new SurfExtractorCpuMC();
                _vxSurfExtractor.Init();
            }
            _vxSurfOpt = string.Copy(oclManager.CurOclOpt);
        }

        if (_b45BuildSurfExtractor != null)
        {
            _b45BuildSurfExtractor.CleanUp();
        }
        _b45BuildSurfExtractor = new SurfExtractorCpuB45();
        _b45BuildSurfExtractor.Init();
    }
 public static void CleanUp()
 {
     if (_vxSurfExtractor != null)
     {
         _vxSurfExtractor.CleanUp();
     }
     if (_b45BuildSurfExtractor != null)
     {
         _b45BuildSurfExtractor.CleanUp();
     }
     if (_b45CursorSurfExtractor != null)
     {
         _b45CursorSurfExtractor.CleanUp();
     }
     _vxSurfExtractor        = null;
     _b45BuildSurfExtractor  = null;
     _b45CursorSurfExtractor = null;
     Debug.Log("Mem size after surfExtractor CleanUp :" + GC.GetTotalMemory(true));
 }