コード例 #1
0
    private void OnPrisonStateChange(PrisonState state)
    {
        if (state == prisonState)
        {
            return;
        }
        prisonState = state;
        switch (state)
        {
        case PrisonState.LockUp:
            agent.SetDestination(prisoner.GetPrison().transform.position);
            break;

        case PrisonState.Sleep:
            agent.SetDestination(prisoner.GetPrison().bed.transform.position);
            break;

        case PrisonState.FreeTime:
            break;

        case PrisonState.Shower:
            ShowerTime();
            break;

        case PrisonState.Eating:
            EatingTime();
            break;

        case PrisonState.Work:
            break;
        }
    }
コード例 #2
0
 public void SetupAi()
 {
     prisoner = new Prisoner(NameGenerator.GetName(), (uint)Random.Range(200, 50), 100, 100, Random.Range(0f, 4f), 0);
     this.transform.position = prisoner.GetPrison().transform.position;
     this.GetComponent <Renderer>().material.color = SkinColor.instance.GetSkinColor(prisoner.GetSkinColor());
     agent = this.gameObject.AddComponent <NavMeshAgent>();
 }