Пример #1
0
    // Start is called before the first frame update
    void Start()
    {
        timer       = Camera.main.GetComponent <Timer>();
        dm          = GetComponent <DataManager>();
        dm.savefile = savefile;

        ColorUtility.TryParseHtmlString("#0182FF", out maxColor);
        ColorUtility.TryParseHtmlString("#9A9A9A", out minColor);
        sim = new SimProfile();

        grid.addTiles(resourceMap, sizeX, sizeY, sim);

        foreach (GameObject harbor in harbors)
        {
            harbor.GetComponent <HarborMaster>().grid = grid;
            harbor.GetComponent <HarborMaster>().sim  = sim;
            //  harbor.GetComponent<HarborMaster>().resourceMap = resourceMap;
            harbor.GetComponent <HarborMaster>().setStartValues(sim);
        }

        //InvokeRepeating("colorResourceGrid", 1f, 1f);
        StartCoroutine(colorResourceGrid(grid));


        timer.startTimer(sim);
        // resourceMap.RefreshAllTiles();
        //InvokeRepeating("colorTest", 0f, 1f);
    }
Пример #2
0
    public void makeTiles()
    {
        grid = new ResourceGrid();
        setResourceTileColors();
        grid.addTiles(profile);

        //update the map in the profile with the newly created grid. Although that's just weird.
        //Let's see how it goes
        // profile.getComponent<ResourceTileMap>().map.GetComponent<MarineResourceBehavior>().grid = grid;
        colorResource();
    }
 public void makeTiles(Tilemap resourceMap, int sizeX, int sizeY, SimProfile sim)
 {
     this.sim = sim;
     grid.addTiles(resourceMap, sizeX, sizeY, sim);
     colorResource();
 }