示例#1
0
    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();
    }
示例#2
0
 public void UpdateSatisfation()
 {
     totalSatisfation.text = SatisfactionManager.SomaSatisfacao().ToString();
 }
示例#3
0
    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);
                }
            }
        }
    }