Beispiel #1
0
 public void OnTeleport(Transform exitPoint)
 {
     // TODO: going passive / active here really should be in the base NPC
     Sheep.SetPassive();
     Owner.Movement.Teleport(exitPoint);
     Sheep.SetAgent();
 }
Beispiel #2
0
        private void SetState(State state)
        {
            if (NPCManager.Instance.DebugBehavior)
            {
                Debug.Log($"Sheep {Owner.Id} set state {state}");
            }

            _state = state;
            switch (_state)
            {
            case State.Idle:
                NPCOwner.Stop(true, true);
                Sheep.SetObstacle();
                break;

            case State.Carried:
                Sheep.SetPassive();
                break;

            case State.Enqueued:
                Sheep.SetAgent();
                NPCOwner.Stop(true, false);
                break;

            case State.Launched:
                Sheep.SetPassive();
                break;
            }
        }
Beispiel #3
0
        private void HandleEnqueued()
        {
            if (null == _target)
            {
                SetState(State.Idle);
                return;
            }

            if (!Sheep.UpdatePath(_target.position))
            {
                _target = null;
                return;
            }
        }