Ejemplo n.º 1
0
        public void Populate()
        {
#if UNITY_EDITOR
            if (Debuger_K.useProfiler)
            {
                profiler = new NavmeshProfiler(gridPosition.x, gridPosition.z);
                profiler.StartProfile();
            }
#endif
            //getting target space
            YRangeInt chunkSize = GetChunkSizes();
            chunkData = new ChunkData(gridPosition.x, gridPosition.z, chunkSize.min, chunkSize.max);
            GetInitialValues();   //getting all public values to support further work
            PopulateCollectors(); //getting colliders to make navmesh from them
        }
        //all things here are used in UNITY main thread so things here can use unity API

        /// <summary>
        /// Function to populate template with further information. Here goes information about colliders and also usage of compute shaders if it enabled
        /// </summary>
        public void PopulateTemplate()
        {
#if UNITY_EDITOR
            if (Debuger_K.useProfiler)
            {
                profiler = new NavmeshProfiler(gridPosition.x, gridPosition.z);
                profiler.StartProfile();
            }
#endif

            //getting target space
            YRangeInt chunkSize = GetChunkSizes();                                                   //get chunk height size
            chunkData = new ChunkData(gridPosition.x, gridPosition.z, chunkSize.min, chunkSize.max); //create chunk data so further code are a bit more readable
            GetInitialValues();                                                                      //getting all public values listed on top to support further work
            PopulateCollectors();                                                                    //getting colliders to make navmesh from them
        }