コード例 #1
0
    void Start()
    {
        List <ILODNodeDataMan> lodNodeDataMans = new List <ILODNodeDataMan> ();

        if (VFVoxelTerrain.self != null)
        {
            lodNodeDataMans.Add(VFVoxelTerrain.self);
            lodNodeDataMans.Add(VFVoxelWater.self);
        }
        if (Block45Man.self != null)
        {
            lodNodeDataMans.Add(Block45Man.self);
        }
        _lstActDependences.Add(SceneChunkDependence.Instance);
        _lstActDependences.Add(new SceneStaticObjDependence(_lstInactive));

        LODOctreeMan.ResetRootChunkCount();        //(6+2*terLv,6,6+2*terLv);
#if UNITY_EDITOR
        LoadLodDesc();
#endif
        int lodRefreshThreshold = 1;
        if (MaxLod > 3)
        {
            Debug.Log("[LOD]Too many levels");
            MaxLod = 3;
        }
        //MaxLod = 3;
        //VFVoxelTerrain.MapDataPath_Zip = GameConfig.PEDataPath + GameConfig.MapDataDir_Zip + "/";
        _lodMan = new LODOctreeMan(lodNodeDataMans.ToArray(), MaxLod, lodRefreshThreshold, PETools.PEUtil.MainCamTransform);
    }
コード例 #2
0
 void LoadLodDesc()
 {
     try{
         TerrainLodDescPaser.LoadTerLodDesc("TerrainLodDesc");
     }
     catch {
         Debug.Log("TerrainLodDesc not found.");
     }
     if (TerrainLodDescPaser.terLodDesc != null)
     {
         LODOctreeMan.ResetRootChunkCount(TerrainLodDescPaser.terLodDesc.x, TerrainLodDescPaser.terLodDesc.y, TerrainLodDescPaser.terLodDesc.z);
         MaxLod = TerrainLodDescPaser.terLodDesc.lod;
     }
 }