Exemplo n.º 1
0
 void HandleCrimes()
 {
     cooldownRemaining -= Time.deltaTime;
     if (cooldownRemaining <= 0)
     {
         GameObject     chosenCrime = possibleCrimes [Random.Range(0, possibleCrimes.Length)];
         GameObject     newCrime    = (GameObject)Instantiate(chosenCrime, new Vector3(0f, .2f, 0f), Quaternion.identity);
         CrimeDataClass crimeData   = newCrime.GetComponent <CrimeDataClass>();
         Debug.Log(crimeData);
         crimeData.SetData(chosenCrime.name, communists, communistPower, buildings);
         dossier.dossierCrimeEntries.Add(crimeData);
         SetBuildings();
         communistPower   += 10;
         cooldownRemaining = AdjustCrimeCooldown(crimeCooldown);
         currentCrime      = crimeData;
     }
 }
Exemplo n.º 2
0
 void HandleCrimes()
 {
     cooldownRemaining -= Time.deltaTime;
     if (cooldownRemaining <= 0) {
         BalanceCommunists();
         dossier.dossierCrimeEntries.Remove (currentCrime);
         GameObject chosenCrime = possibleCrimes [Random.Range (0, possibleCrimes.Length)];
         GameObject newCrime = (GameObject) Instantiate (chosenCrime, new Vector3(0f,.2f,0f), Quaternion.identity);
         CrimeDataClass crimeData = newCrime.GetComponent<CrimeDataClass>();
         crimeData.SetData (chosenCrime.name, communists, communistPower, buildings);
         dossier.dossierCrimeEntries.Add (crimeData);
         SetBuildings ();
         communistPower += 10;
         cooldownRemaining = AdjustCrimeCooldown(crimeCooldown);
         currentCrime = crimeData;
     }
 }