コード例 #1
0
ファイル: Planet.cs プロジェクト: fishykins/Doddys-World-OLD
 public void InitializePlanet()
 {
     planetGenerator        = GetComponent <PlanetGenerator>();
     planetGenerator.planet = this;
     cube  = planetGenerator.cubeGenerator.GenerateCube(this);
     faces = cube.faces;
     PlanetGenerator.CreateGenerators(false); //True will force a new generator to be created, false will only init if none already made
     PlanetGenerator.UpdateGenerators();
 }
コード例 #2
0
        public Chunk(Planet planet, Face face, int u, int v)
        {
            this.planet          = planet;
            this.face            = face;
            this.faceCoord       = new IUV(face.index, u, v);
            this.planetGenerator = planet.PlanetGenerator;

            CalculateCentre(planet.faceResolution, planet.radius);

            //Add lod levels based on planet presets
            lodMeshes = new LodData[planet.detailLevels.Length];
            for (int i = 0; i < planet.detailLevels.Length; i++)
            {
                lodMeshes[i] = new LodData(planet.detailLevels[i].lod, UpdateChunk, planetGenerator);
            }

            //Debug.Log("Chunk [" + iuv.x + "," + iuv.y + "," + iuv.z + "] has been constructed");
        }
コード例 #3
0
 //called in Chunk init
 public LodData(int lod, System.Action updateCallback, PlanetGenerator planetGenerator)
 {
     this.lod             = lod;
     this.updateCallback  = updateCallback;
     this.planetGenerator = planetGenerator;
 }
コード例 #4
0
 public MeshGenerator(PlanetGenerator planetGenerator, int resolution)
 {
     this.planetGenerator = planetGenerator;
     this.borderedSize    = resolution;
     this.faceResolution  = planetGenerator.planet.faceResolution;
 }
コード例 #5
0
 public ChunkGenerator(PlanetGenerator planetGenerator, int resolution)
 {
     this.planetGenerator = planetGenerator;
     this.resolution      = resolution;
 }