示例#1
0
    public bool Spook()
    {
        if (_claimedMemento != null && _claimedMemento.mementoState == Memento.MementoState.PickedUp)
        {
            _spooked = true;
            _animator.SetTrigger("Scared");
            _claimedMemento.Drop();
            _mementoManager.ForfeitMemento(_claimedMemento);
            _claimedMemento = null;

            audioSource.PlayOneShot(spookedSounds[Random.Range(0, spookedSounds.Length)]);

            _destination        = _spawnPointManager.GetRandomSpawnPoint();
            _navMeshAgent.speed = settings.scaredSpeed;
            return(true);
        }

        return(false);
    }