Exemple #1
0
    void Awake()
    {
        graph        = new HexGraph(2 * regionRadius * worldRadius + regionRadius);
        regions      = new List <Region>();
        regionBounds = new List <Node>();
        worldBounds  = new List <Node>();
        riverStarts  = new List <Vertex>();

        Camera.main.GetComponent <CameraFollow>().maxSize
            = (2 * worldRadius + 1) * regionRadius * Mathf.Sqrt(2.0f / 3);
        //Camera.main.orthographicSize  = (2 * worldRadius + 1) * regionRadius * Mathf.Sqrt(2.0f/3);
    }
Exemple #2
0
    public void Awake()
    {
        if (Map.current != null)
        {
            Destroy(this.gameObject);
        }
        else
        {
            Map.current = this; current = this;
        }

        xOffset = Random.Range(0, 999999);
        yOffset = Random.Range(0, 999999);

        graph = new HexGraph(radius);
        Generate();
        SpawnTiles();
        setTopography(true);
        Variagate(Color.cyan, Color.red);
        Camera.main.GetComponent <CameraFollow>().maxSize = (radius + 1) * Mathf.Sqrt(2.0f / 3);
    }