Exemple #1
0
    public void SetMapParam()
    {
        WeatherConfig.SetClimateType(ScenceClimate, vegetationId);
        SetTerrainHeight(terrainHeight, ScenceClimate);
        VFDataRTGen.SetRiverDensity(riverDensity);
        VFDataRTGen.SetRiverWidth(riverWidth);
        System.Random randTool = new System.Random(RandSeed);
        VFDataRTGen.SetPlainThickness(plainHeight);
//		VFDataRTGen.SetPlainMin((float)randTool.NextDouble());
//		VFDataRTGen.SetPlainMax((float)randTool.NextDouble());
        VFDataRTGen.SetFlatness(flatness);
        VFDataRTGen.SetFlatMin((float)randTool.NextDouble());
        VFDataRTGen.SetFlatMax((float)randTool.NextDouble());
        VFDataRTGen.SetBridgeMaxHeight(bridgeMaxHeight);
        //Debug.LogError(Mathf.Atan(1)*4);
        switch (mapSize)
        {
        case 0:
            //boundary
            SetBoundary(-20000, 20000, -20000, 20000, 200);
            //VFDataRTGen mineral
            VFDataRTGen.MetalReduceSwitch = false;
            VFDataRTGen.MetalReduceArea   = 4000;
            //VFDataRTGen.MineFrequency0 = 0.5;
            //VFDataRTGen.MineFrequency1 = 2;

            VFDataRTGen.SetMapTypeFrequency(1f);
            //VArtifactTownManager town level campDistance detectarea
            //SetTownBoundary(-19200, 19200, -19200, 19200);
            //VArtifactTownManager.Instance.LevelRadius = 4000;
            //SetTownDistance(1, 1);
            //VArtifactTownManager.Instance.DetectedChunkNum = 32;
            //allyCount=8;
            break;

        case 1:
            //boundary
            SetBoundary(-10000, 10000, -10000, 10000, 100);
            //VFDataRTGen mineral
            VFDataRTGen.MetalReduceSwitch = false;
            VFDataRTGen.MetalReduceArea   = 2000;
            //VFDataRTGen.MineFrequency0 = 0.5;
            //VFDataRTGen.MineFrequency1 = 2;

            VFDataRTGen.SetMapTypeFrequency(1f);
            //VArtifactTownManager town level
            //SetTownBoundary(-9600, 9600, -9600, 9600);
            //VArtifactTownManager.Instance.LevelRadius = 2000;
            //SetTownDistance(1, 1);
            //VArtifactTownManager.Instance.DetectedChunkNum = 32;
            //allyCount=8;
            break;

        case 2:
            //boundary
            SetBoundary(-4000, 4000, -4000, 4000, 40);
            //VFDataRTGen mineral
            VFDataRTGen.MetalReduceSwitch = false;
            //VFDataRTGen.MineFrequency0 = 0.25;
            //VFDataRTGen.MineFrequency1 = 0.25;
            //maptype
            VFDataRTGen.SetMapTypeFrequency(1.5f);
            //VFDataRTGen.SetTerrainFrequency(1.5f);
            //VArtifactTownManager town level campDistance detectarea
            //SetTownBoundary(-3860, 3860, -3860, 3860);
            //VArtifactTownManager.Instance.LevelRadius = 800;
            //SetTownDistance(0.5f, 0.8f);
            //VArtifactTownManager.Instance.DetectedChunkNum = 16;
            //allyCount=8;
            break;

        case 3:
            //boundary
            SetBoundary(-2000, 2000, -2000, 2000, 20);
            //VFDataRTGen mineral
            VFDataRTGen.MetalReduceSwitch = false;
            //VFDataRTGen.MineFrequency0 = 1;
            //VFDataRTGen.MineFrequency1 = 2;
            VFDataRTGen.SetMapTypeFrequency(3f);
            //VFDataRTGen.SetTerrainFrequency(3f);
            //VArtifactTownManager town level campDistance detectarea
            //SetTownBoundary(-1920, 1920, -1920, 1920);
            //VArtifactTownManager.Instance.LevelRadius = 400;
            //SetTownDistance(0.5f, 0.8f);
            //VArtifactTownManager.Instance.DetectedChunkNum = 12;
            //allyCount=4;
            break;

        case 4:
            //boundary
            SetBoundary(-1000, 1000, -1000, 1000, 10);
            //VFDataRTGen mineral
            VFDataRTGen.MetalReduceSwitch = false;
            //VFDataRTGen.MineFrequency0 = 1;
            //VFDataRTGen.MineFrequency1 = 2;
            VFDataRTGen.SetMapTypeFrequency(3f);
            //VFDataRTGen.SetTerrainFrequency(3f);
            //VArtifactTownManager town level campDistance detectarea
            //SetTownBoundary(-960, 960, -960, 960);
            //VArtifactTownManager.Instance.LevelRadius = 200;
            //SetTownDistance(0.25f, 0.8f);
            //VArtifactTownManager.Instance.DetectedChunkNum = 6;
            //allyCount=4;
            break;
        }
        //VFDataRTGen.TestMapBound();

        Debug.Log("<color=red>SeedString:" + SeedString
                  + "terrainHeight:" + terrainHeight
                  + "mapsize: " + mapSize
                  + ", riverdensity: " + riverDensity
                  + ", riverwidth: " + riverWidth
                  + "plainHeight:" + plainHeight
                  + "flatness:" + flatness
                  + "bridgemaxheight:" + bridgeMaxHeight
                  + "allyCount" + allyCount
                  + "</color>");


        VFVoxelWater.c_fWaterLvl = VFDataRTGen.WaterHeightBase;
        if (ScenceClimate == ClimateType.CT_Wet)
        {
            System.Random waterseed = new System.Random(RandSeed);
            int           waterplus = waterseed.Next(VFDataRTGen.WET_WATER_PLUS_MIN, VFDataRTGen.WET_WATER_PLUS_MAX);
            VFVoxelWater.c_fWaterLvl += waterplus;
        }
        else if (ScenceClimate == ClimateType.CT_Temperate)
        {
            System.Random waterseed = new System.Random(RandSeed);
            int           waterplus = waterseed.Next(VFDataRTGen.TEMP_WATER_PLUS_MIN, VFDataRTGen.TEMP_WATER_PLUS_MAX);
            VFVoxelWater.c_fWaterLvl += waterplus;
        }
        VFDataRTGen.sceneClimate = ScenceClimate;
        VFDataRTGen.waterHeight  = VFVoxelWater.c_fWaterLvl;
        VFDataRTGen.InitStaticParam(RandSeed);
        SetGlobalFogHeight(VFDataRTGen.waterHeight);
    }