예제 #1
0
    public void AIGetFood()
    {
        int tries = 0;

        while (tries < 4)
        {
            int randomNum = Random.Range(0, empolyees.Length);

            if (computers.Length != 0)
            {
                EmpolyeeController compCon = empolyees[randomNum].GetComponent <EmpolyeeController>();
                if (compCon.GetIsHome() == true && compCon.GetDead() == false)
                {
                    compCon.SetPath(fridgeLoc, 0);
                    tries = 4;
                }
            }
            tries++;
        }
    }
예제 #2
0
    public void AIWonder()
    {
        int tries = 0;

        while (tries < 4)
        {
            int randomNum = Random.Range(0, empolyees.Length);

            if (computers.Length != 0)
            {
                EmpolyeeController compCon = empolyees[randomNum].GetComponent <EmpolyeeController>();
                if (compCon.GetIsHome() == true && compCon.GetDead() == false)
                {
                    int randomNum2     = Random.Range(0, randomLocs.Length);
                    int randomWaitTime = Random.Range(0, 4);
                    compCon.SetPath(randomLocs[randomNum2], randomWaitTime);
                    tries = 4;
                }
            }
            tries++;
        }
    }