Example #1
0
 private void Start()
 {
     population   = FindObjectOfType <PopulationManager>().GetComponent <PopulationManager>();
     c_stats      = GetComponent <HumanCurrentStats>();
     growth       = GetComponent <HumanGrowth>();
     audioManager = FindObjectOfType <AudioManager>().GetComponent <AudioManager>();
 }
    // Use this for initialization
    void Start()
    {
        c_Stats = GetComponent <HumanCurrentStats>();
        death   = GetComponent <HumanDeath>();

        speedIncreaseRate = c_Stats.stats.maxSpeed / maxSpeedAge;
        speedDecreaseRate = (c_Stats.stats.maxSpeed - c_Stats.stats.minSpeed) / (c_Stats.stats.maxAge - maxSpeedAge);
    }
Example #3
0
 // Use this for initialization
 void Start()
 {
     c_Stats          = GetComponent <HumanCurrentStats>();
     agent            = GetComponent <NavMeshAgent>();
     shop             = FindObjectOfType <ShopManager>().GetComponent <ShopManager>();
     audioManager     = FindObjectOfType <AudioManager>().GetComponent <AudioManager>();
     population       = FindObjectOfType <PopulationManager>().GetComponent <PopulationManager>();
     r_SightDistance += shop.s_r_sightRangeIncrease;
 }
Example #4
0
 // Use this for initialization
 void Start()
 {
     foods          = FindObjectOfType <FoodManager>().GetComponent <FoodManager>();
     shop           = FindObjectOfType <ShopManager>().GetComponent <ShopManager>();
     repopulate     = GetComponent <HumanRepopulate>();
     c_Stats        = GetComponent <HumanCurrentStats>();
     growth         = GetComponent <HumanGrowth>();
     audioManager   = FindObjectOfType <AudioManager>().GetComponent <AudioManager>();
     agent          = GetComponent <NavMeshAgent>();
     eatTimer       = h_Cooldown;
     h_Recovery    += shop.s_hungerIncrease;
     seesFoodRange += shop.s_h_sightRangeIncrease;
     canEat         = false;
     destinationSet = false;
     FoodNearBy();
 }
Example #5
0
    void CheckIfPartnerIsNear()
    {
        //get nearest partner then check its position
        float dist = 9999999999;

        for (int i = 0; i < population.humans.Count; i++)
        {
            if (population.humans[i].c_Age >= r_AgeRange.x - m_ageRange && population.humans[i].c_Age < r_AgeRange.x + m_ageRange &&
                isFemale != population.humans[i].GetComponent <HumanRepopulate>().isFemale)
            {
                float newDist = Vector3.Distance(population.humans[i].transform.position, transform.position);
                if (newDist < dist && newDist > 1f)
                {
                    dist    = newDist;
                    mate    = population.humans[i].GetComponent <Transform>();
                    m_Stats = population.humans[i].GetComponent <HumanCurrentStats>();
                }
            }
        }
    }
Example #6
0
 // Use this for initialization
 void Start()
 {
     rend    = GetComponent <Renderer>();
     c_Stats = GetComponentInParent <HumanCurrentStats>();
     growth  = GetComponentInParent <HumanGrowth>();
 }