예제 #1
0
    private void OnCollisionEnter(Collision other)
    {
        FMODUnity.RuntimeManager.PlayOneShot(throwableSFX, transform.position);
        if (enableInteract || hasHit)
        {
            return;
        }

        noisePing.SpawnNoisePing(other);
        hasHit = true;
    }
예제 #2
0
    private void OnCollisionEnter(Collision other)
    {
        if (!hasBeenBumped || hasHit || other.gameObject.CompareTag("Player"))
        {
            return;
        }

        noisePing.SpawnNoisePing(other);
        hasHit = true;

        UIManager.Instance.staminaBar.InstantIncreaseAwakenessBy(awakenessIncreasePercentage);

        OnHit?.Invoke();

        if (fadeAndDestroyAfterThrow)
        {
            ObjectFader objectFader = GetComponent <ObjectFader>();
            if (objectFader)
            {
                objectFader.FadeToTransparent(destroyAfterSeconds, fadeAndDestroyAfterThrow);
            }
        }
    }