Ejemplo n.º 1
0
    /// <summary>
    /// Sets up line renderer to display graph of births across the years
    /// </summary>
    public void DrawBirthGraph()
    {
        int[] dataArray = new int[NUM_YEARS];

        for (int i = 0; i < NUM_YEARS; ++i)
        {
            dataArray[i] = yearDatabase[i].numBirths;
        }

        birthVis.InitLine(dataArray, mostPopulousYear.numPopulation);
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Sets up line renderer to display graph of population across the years
    /// </summary>
    public void DrawPopulationGraph()
    {
        int[] dataArray = new int[NUM_YEARS];

        for (int i = 0; i < NUM_YEARS; ++i)
        {
            dataArray[i] = yearDatabase[i].numPopulation;
        }

        int yearIndex = mostPopulousYear.year - 1900;

        arrowMarker.transform.position = new Vector3(yearIndex * 0.5f, (dataArray[yearIndex] / mostPopulousYear.numPopulation) * 25, 0);
        arrowMarker.SetActive(true);
        populationVis.InitLine(dataArray, mostPopulousYear.numPopulation);
    }