示例#1
0
 public Mundo(string nombre, int ancho, int altura, int largo, int idMaterialTerreno)
 {
     //Output the Game data path to the console
     this.nombre = nombre;
     tamAzulejo  = new Vector3Int(1, 1, 1);
     tamMundo.x  = ancho;
     tamMundo.z  = largo;
     tamMundo.y  = altura;
     //Se asume que se maneja texturas de 128 x 128 un total de 16 texturas de largo 16 ancho
     mapaVoxel = new MapaVoxel(nombre, idMaterialTerreno, new Vector3Int(ancho, altura, largo), 16);
     mapaVoxel.LlenarMapaTodo(1);
     mapaPosiciones = new Mapa <byte>(nombre, new Vector3Int(ancho, altura, largo), new Vector3Int(1, 1, 1), 30, false);
     mapaRecursos   = new MapaNativo <Entity>(nombre, new Vector3Int(ancho, altura, largo), new Vector3(1, 1, 1), 30, false);
 }
示例#2
0
 public CapaNativo(MapaNativo <T> mapa, CuadranteNativo <T> cuadrante, int capa, bool generaGameObject)
 {
     this.mapa          = mapa;
     this.cuadrante     = cuadrante;
     this.capa          = capa;
     adminAzulejos      = AdministradorAzulejos.Instanciar();
     contenedorAzulejos = new NativeHashMap <int, T>(mapa.cuadranteTam * mapa.cuadranteTam, Allocator.Persistent);
     /*-----------*/
     if (gameObject)
     {
         gameObject = new GameObject("Capa:" + capa);
         gameObject.transform.parent        = cuadrante.gameObject.transform;
         gameObject.transform.localPosition = new Vector3(0, capa - 1, 0);
     }
 }
示例#3
0
 public CuadranteNativo(MapaNativo <T> mapa, int cuadranteX, int cuadranteZ, bool generaGameObject)
 {
     this.generaGameObject = generaGameObject;
     this.mapa             = mapa;
     this.cuadranteX       = cuadranteX;
     this.cuadranteZ       = cuadranteZ;
     this.contenedorCapas  = new Dictionary <int, CapaNativo <T> >();
     /*---------------------------------------------------------*/
     if (generaGameObject)
     {
         gameObject = new GameObject("Cuadrante_" + cuadranteX + "_" + cuadranteZ);
         gameObject.transform.parent        = mapa.gameObject.transform;
         gameObject.transform.localPosition = new Vector3(cuadranteX * mapa.cuadranteTam, 0, cuadranteZ * mapa.cuadranteTam);
         this.meshCombiner = this.gameObject.AddComponent <MeshCombiner>();
     }
 }