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

        noisePing.SpawnNoisePing(other);
        hasHit = true;
    }
Ejemplo n.º 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);
            }
        }
    }