예제 #1
0
 public World(Vector2I origin, Vector2I dimensions, CityMesh mesh, Texture2D texture = null)
 {
     this.Minimum      = origin;
     this.Maximum      = origin + dimensions - new Vector2I(1, 1);
     this.Mesh         = mesh;
     this.CityLayer    = new CityLayer(origin, dimensions, texture);
     this.DynamicLayer = new DynamicLayer();
 }
예제 #2
0
    public void switchCity(int i)
    {
        this.activeCityMesh = cityMeshes[i];
        this.World          = this.activeCityMesh.City;

        meshPosition.x = activeCityMesh.transform.position.x;
        meshPosition.y = activeCityMesh.transform.position.y;
        convertCoeff   = activeCityMesh.scaleCoeff;
        bottomCoord.x  = (meshPosition.x - 0.5f * convertCoeff * activeCityMesh.MeshWidth);
        bottomCoord.y  = (meshPosition.y - 0.5f * convertCoeff * activeCityMesh.MeshHeight);
        topCoord.x     = (meshPosition.x + 0.5f * convertCoeff * activeCityMesh.MeshWidth);
        topCoord.y     = (meshPosition.y + 0.5f * convertCoeff * activeCityMesh.MeshHeight);
    }