示例#1
0
    public void UpdateMe()
    {
        if (start_time >= 9999999999f)
        {
            start_time = Time.time;
            time       = start_time;
            dTime      = timeInMinutes;
        }
        else
        {
            eatCountdown += (Time.time - time);
            //Debug.Log(eatCountdown);
            time = Time.time;
            if (eatCountdown > MaxCountdown)
            {
                TimePasses(hive.GetPopulationSize());
                eatCountdown = 0f;
                if (hungry > 75)
                {
                    hive.IncreaseAggressiveness();
                }
            }
            //if (full <= 10.0f)

            dTime = timeInMinutes - (time - start_time);
        }
        UpdateDisplay();

        if (dTime <= 0)
        {
            panel.SUCCEED();
        }
    }
示例#2
0
    void UpdateMe()
    {
        if (dispensePressed)
        {
            Debug.Log("HUngry" + ((int)(5 * timer.GetHungriness())).ToString() + " " + timer.GetHungriness().ToString());

            if (CorrectFood((int)(5 * hive.GetAgrressivinesPercentage()), (int)(5 * hive.GetPopulationPercentage()), (int)(5 * timer.GetHungriness())))
            {
                Debug.Log("correct food");
                hive.DecreaseAggressiveness();
                timer.Eat();
            }
            else
            {
                Debug.Log("wrong food");
                hive.IncreaseAggressiveness();
            }
            dispensePressed = false;
        }
    }