Example #1
0
    public void GenerateWorld()
    {
        GameObject worldObj = new GameObject();

        worldObj.name = "WorldMap";

        //List<GameObject> tiles = new List<GameObject>();
        tiles = new GameObject[Map.size.x, Map.size.y];

        for (int a = 0; a < Map.size.x; a++)
        {
            GameObject row = new GameObject();
            row.transform.parent = worldObj.transform;
            row.name             = "Row_" + a;

            for (int b = 0; b < Map.size.y; b++)
            {
                GameObject tile = GenerateTile(a, b, row);
                tiles[a, b] = tile;
            }
        }

        meshCombiner.CreateTilemapMesh(tiles);

        //actionSelecter.LoadActionButtons();
        actionSelecter.LoadActionEnablers();

        ProductivityController.LoadProductivityLists();
        ProductivityController.LoadCompetitors(diplomacy.cities);
        ProductivityController.UpdateProductivities();

        immigration.LoadImmigrantData();

        WalkerGrid = Map.size.CreateArrayOfSize <List <Walker> > ();
    }
Example #2
0
    void Update()
    {
        //if (!IsPaused)
        //    Time.timeScale = timescale;

        TimeDelta += Time.deltaTime;

        //update label
        UpdateTimeLabel();

        if (TimeDelta >= DayTime)
        {
            //convert timedelta to day
            TimeDelta = 0;
            Days++;

            //convert days to week
            if (Days >= WeekTime)
            {
                Days = 0;
                Weeks++;
            }

            //convert weeks to month
            if (Weeks >= MonthTime)
            {
                Weeks = 0;
                Months++;
                //research.IterateResearch();
                //labor.PayWages();
            }

            //convert months to season
            if (Months >= SeasonTime)
            {
                Months = 0;
                Seasons++;
                UpdateClockColor();
                if (Seasons < YearTime)
                {
                    money.BeginNewQuarter(Seasons, CurrentYear);
                }
                finances.LoadFinancialReports();
                ProductivityController.UpdateProductivities();
            }

            //convert seasons to year
            if (Seasons >= YearTime)
            {
                Seasons = 0;
                Years++;
                money.BeginNewQuarter(Seasons, CurrentYear);
                finances.LoadFinancialReports();
                UpdateClockColor();
            }
        }
    }