예제 #1
0
 public CellData(float x,
                 float y,
                 float population,
                 Nation nation,
                 AgeData ageData,
                 int daysOfData)
 {
     X             = x;
     Y             = y;
     Population    = population;
     Nation        = nation;
     AgeData       = ageData;
     CovidTimeline = new CovidDayData[daysOfData];
 }
예제 #2
0
 private AgeData[,] GetAgeData(string[] ageMapsSource)
 {
     AgeData[,] ret   = new AgeData[Width, Height];
     float[][,] items = ageMapsSource.Select(item => LoadFloats(item)).ToArray();
     for (int x = 0; x < Width; x++)
     {
         for (int y = 0; y < Height; y++)
         {
             IEnumerable <float> ageDatum = items.Select(item => item[x, y]);
             ret[x, y] = new AgeData(ageDatum);
         }
     }
     return(ret);
 }
예제 #3
0
    private CellData[,] GetGridData(float[,] populationData, AgeData[,] ageData, int[,] nationData)
    {
        CellData[,] ret = new CellData[Width, Height];

        for (int x = 0; x < Width; x++)
        {
            for (int y = 0; y < Height; y++)
            {
                int    nationalId = nationData[x, y];
                float  population = Mathf.Max(0, populationData[x, y]);
                Nation nation     = null;
                if (nationTable.ContainsKey(nationalId))
                {
                    nation = nationTable[nationalId];
                }
                AgeData age  = ageData[x, y];
                float   xVal = (float)x / Width;
                float   yVal = (float)y / Height;
                ret[x, y] = new CellData(xVal, yVal, population, nation, age, DaysOfData);
            }
        }
        return(ret);
    }
예제 #4
0
	void pushAgeSettings(AgeData newAge) {
		currentAge.ageRootNode.SetActive(false);

		//Make sure FPSController is enabled as it's off in start age
		var fpc = Services.instance.Get<FirstPersonController>();
		fpc.GetComponent<CharacterController>().enabled = true;
		fpc.enabled = true;

		//Update FPSController settings
		fpc.transform.position = newAge.linkLocation.transform.position;
		fpc.transform.rotation = newAge.linkLocation.transform.rotation;

		//Update camera settings
		Camera.main.cullingMask = newAge.linkPanelCamera.cullingMask;

		//Update picking settings
		fpc.GetComponent<CursorController>().raycastLayers = newAge.cursorRaycastLayers;

		Skybox ageSkybox = newAge.linkPanelCamera.GetComponent<Skybox>();
		if (ageSkybox != null) {
			Camera.main.GetComponent<Skybox>().material = ageSkybox.material;
		}

		Services.instance.Get<SoundManager>().playLoop(newAge.ambience, 0.5f);

		currentAge = newAge;
	}
예제 #5
0
	void Start() {
		currentAge = getAge("start");
		Services.instance.Get<SoundManager>().playLoop(currentAge.ambience, 0.0f);
	}