Exemple #1
0
    public TerrainChunk(Planet planet, Material terrainMat, Transform parent, Vector3[] vertices, Vector2[] uv, Dictionary <Vector2, TileData> tileData, Texture2D spritemap, TilesetLookup tilesetLookup, Vector2 position, Vector2 viewPosition, int width, int height, float featureSize, Color[] colors, Color mainColor)
    {
        myPlanet = planet;
        string randomSeed = (int)(position.x) + "" + (int)(Mathf.Abs(position.y));

        rand                = new System.Random(int.Parse(randomSeed));
        this.terrainMat     = terrainMat;
        this.parent         = parent;
        this.vertices       = vertices;
        this.uv             = uv;
        this.tileDictionary = tileData;
        this.spritemap      = spritemap;
        this.tilesetLookup  = tilesetLookup;
        this.position       = position;
        this.viewPosition   = viewPosition;
        this.width          = width;
        this.height         = height;
        this.featureSize    = featureSize;
        this.colors         = colors;
        this.mainColor      = mainColor;
    }
Exemple #2
0
 /// <summary>
 /// Create initial planet components including tilesetlookup, noise object, and texture
 /// </summary>
 public void Init()
 {
     random        = new System.Random(planetSettings.planetSeed);
     tilesetLookup = new TilesetLookup(tilesetInformation, tilesetTriangulation);
     planetTexture = new Texture2D(400, 400);
 }