private void Awake() { // get realtime references myGameManager = FindObjectOfType <GameManager>(); myGarbageManager = GetComponent <GarbageManager>(); mySatisfactionManager = GetComponentInChildren <SatisfactionManager>(); if (mySatisfactionManager.GetComponent <SphereCollider>()) { mySatisfactionTrigger = mySatisfactionManager.GetComponent <SphereCollider>(); } myHouseMeshRender = GetComponentInChildren <MeshRenderer>(); // set some variables RandomHouseType(); }
public void UpdateSatisfation() { totalSatisfation.text = SatisfactionManager.SomaSatisfacao().ToString(); }
public void BasicSelectionBetweenScenes() { int i = 0; int r = 0; orderedCitizensForStory = new List <CitizenData>(citizens); foreach (GameObject citizen in GameObject.FindGameObjectsWithTag("Citizen")) { SatisfactionManager sm = citizen.GetComponent <SatisfactionManager>(); int index = citizens.IndexOf(citizen.GetComponent <CitizenBehaviour>().citizenData); if (sm.strikes == 3) { GoToLeavingCamp(index); } if (sm.increased == true) { GoToDislikeStory(index); } else { if (sm.strikes > 0) { GoToGotBetterCalll(index); } } } if (gameManager.craftedItem != null) { GoToItemComent(Random.Range(0, citizens.Count)); } foreach (CitizenData cd in citizens) { if (!cd.revealedLike) { i++; } if (!cd.revealedDislike) { i++; } if (!cd.revealProficience) { i++; } } r = Random.Range(0, i); UpdateCitizenData(); for (int j = 0; j < citizens.Count; j++) { if (!citizens[j].revealedLike) { r--; if (r == 0) { GoToLikeStory(j); } } if (!citizens[j].revealedDislike) { r--; if (r == 0) { GoToDislikeStory(j); } } if (!citizens[j].revealProficience) { r--; if (r == 0) { GoToProficiencyStory(j); } } } }