Exemple #1
0
        public IEnumerator OnUpdate()
        {
            while (true)
            {
                if (_npc.Agent.remainingDistance < 0.3f)
                {
                    if (_reached == false)
                    {
                        Debug.Log("Heii am ajuns la destinatie gata, oprirea!!!");
                        _npc.Agent.isStopped = true;
                        Infirmery.Instance.CallDoctor(_npc);
                        _reached = true;
                    }
                }

                if (_npc.InfectionSystem.Cured)
                {
                    Debug.Log("Now I am healed! The bed is free");
                    Infirmery.Instance.FreeBed(_npc);
                    _npc.Agent.isStopped = false;
                    _npc.RemoveBehaviour(this);
                }

                yield return(null);
            }
        }
 private IEnumerator MoveChairBack()
 {
     while (Vector3.Distance(chair.transform.position, _chairInitialPosition) < 0.1f)
     {
         chair.transform.position =
             Vector3.MoveTowards(chair.transform.position, _chairInitialPosition, Time.deltaTime);
         yield return(null);
     }
     chair.transform.position = _chairInitialPosition;
     _npc.Agent.isStopped     = false;
     transform.parent         = null;
     _npc.RemoveBehaviour(this);
 }
        private IEnumerator WaitUntilMeetingEnds()
        {
            yield return(new WaitForSeconds(talkDuration));

            _npc.RemoveBehaviour(this);
        }