Пример #1
0
    public void AddHunger(float modifier)
    {
        hunger += modifier; hunger = Mathf.Clamp01(hunger); UIHunger.GetComponent <Slider>().value = hunger;
        if (carried && modifier < 0)
        {
            hunger += modifier;
            hunger  = Mathf.Clamp01(hunger);
            UIHunger.GetComponent <Slider>().value = hunger;
        }
        if (carrying && modifier < 0)
        {
            hunger -= modifier / 2;
            hunger  = Mathf.Clamp01(hunger);
            UIHunger.GetComponent <Slider>().value = hunger;
        }

        if (childOne != null || childTwo != null)
        {
            if (hunger >= 0.75)
            {
                AddTrust(0.05f);
            }
        }

        if (parentOne != null)
        {
            parentOne.GetComponent <Character_r>().AddTrust(0.15f);

            if (parentTwo != null)
            {
                parentTwo.GetComponent <Character_r>().AddTrust(0.15f);
            }
        }

        AddTrust(0.1f);
    }
Пример #2
0
    public void AddHunger(float modifier)
    {
        hunger += modifier; hunger = Mathf.Clamp01(hunger); UIHunger.GetComponent <Slider>().value = hunger;

        if (childOne != null || childTwo != null)
        {
            if (hunger >= 0.75)
            {
                AddTrust(-5);
            }
        }

        if (parentOne != null)
        {
            parentOne.GetComponent <Character_r>().AddTrust(15);

            if (parentTwo != null)
            {
                parentTwo.GetComponent <Character_r>().AddTrust(15);
            }
        }

        AddTrust(10);
    }