Exemple #1
0
 public override void Interact()
 {
     base.Interact();
     if (_cm.isCrying)
     {
         _gm.goodJobCounter++;
         GlobalManager.instance.jobs.Add("Comforted the crying " + _cm.name + " (+1pts)");
         _cm.SwitchToState(ChildManager.ChildrenAnimation.Idle);
         _cm.isCrying = false;
         _cm.StopSound();
     }
     if (_cm.isEatingBad)
     {
         _gm.goodJobCounter++;
         GlobalManager.instance.jobs.Add("Took junk food away from a child");
         _cm.SwitchToState(ChildManager.ChildrenAnimation.Idle);
         _cm.isEatingBad = false;
         _cm.StopSound();
     }
     if (_cm.isHoldingBeer)
     {
         _gm.goodJobCounter++;
         GlobalManager.instance.jobs.Add("Took beer away from " + _cm.name + " (+1pts)");
         _cm.beer.SetActive(false);
         _cm.isHoldingBeer = false;
     }
 }
Exemple #2
0
    public void sit(ChildManager child, Transform sitTransform)
    {
        child.transform.position = sitTransform.position;
        child.transform.rotation = sitTransform.rotation;

        child.SwitchToState(ChildManager.ChildrenAnimation.SitOnSofa);
    }
Exemple #3
0
    public IEnumerator ChooseNextRoom(ChildManager child, Transform next)
    {
        float timestamp = Time.time;

        child.SwitchToState(ChildManager.ChildrenAnimation.Idle);

        while (Time.time - timestamp < 3)
        {
            yield return(null);
        }

        child.nextRoom = next;
        child.ResetChild();
        child.agent.isStopped = false;
        child.SwitchToState(ChildManager.ChildrenAnimation.Run);
        child.canMove = true;
    }
Exemple #4
0
    public void sadTV(ChildManager child, Transform sitTransform)
    {
        child.transform.position = sitTransform.position;
        child.transform.rotation = sitTransform.rotation;

        child.SwitchToState(ChildManager.ChildrenAnimation.Cry);
        child.PlayCrying();
        child.isCrying = true;
        // Play sad TV
        tv.PlayTV(tv.sadClip);
    }
Exemple #5
0
    public void badTV(ChildManager child, Transform sitTransform)
    {
        // Sit
        child.transform.position = sitTransform.position;
        child.transform.rotation = sitTransform.rotation;

        child.SwitchToState(ChildManager.ChildrenAnimation.SitOnSofa);

        // Play bad TV
        tv.PlayTV(tv.badClip);
    }
Exemple #6
0
    public void beer(ChildManager child, Transform sitTransform)
    {
        if (child.beer)
        {
            child.beer.SetActive(true);
            child.isHoldingBeer = true;
        }
        child.transform.position = sitTransform.position;
        child.transform.rotation = sitTransform.rotation;

        child.SwitchToState(ChildManager.ChildrenAnimation.SitOnSofa);
    }
Exemple #7
0
    public void eat(ChildManager child, Transform sitTransform)
    {
        Debug.Log("attempting eat");

        if (bowl.activeSelf)
        {
            child.transform.position = sitTransform.position;
            child.transform.rotation = sitTransform.rotation;

            StartCoroutine(setOnOff(null, bowl, child.timeToEat));
            Debug.Log("TTL: " + child.timeToEat);
            goodJobCounter += 3;
            GlobalManager.instance.jobs.Add("Fed " + child.name + "(+3pts)");
            //child.isEatingBad = true;
            child.SwitchToState(ChildManager.ChildrenAnimation.Eat);
        }
        else
        {
            child.isWaitingForFood = true;
            sit(child, sitTransform);
        }
    }