Esempio n. 1
0
    void Start()
    {
        world = new World(worldWidth);

        texture2d            = new Texture2D(worldWidth, worldWidth, TextureFormat.RGBA32, false, true);
        texture2d.filterMode = FilterMode.Point;

        GenerateEmptyWorld();
        GenerateHeightmap();

        texture2d.Apply();
        //heightmapMaterial.SetTexture("_MainTex", texture2d);

        PlaceCliffs(0);
        PlaceCliffs(1);
        PlaceCliffs(2);

        TrimCliffs(0);
        TrimCliffs(1);
        TrimCliffs(2);

        for (int i = 0; i < world.GetLevels(); i++)
        {
            FillLayerRandomOnFloor(i, World.Tile.Pfb_Flower, 0.1f, true);
            //FillLayerRandomOnFloor(i, World.Tile.Pfb_Entity_Slime, 0.02f, true);
        }

        WorldLoader.InstantiateWorld(world);
    }