Exemplo n.º 1
0
    private void OnTriggerExit(Collider other)
    {
        if (other.CompareTag("Player") || other.CompareTag("Clickable"))
        {
            counter -= 1;
            if (counter == 0)
            {
                RenderMat.SetFloat("_isCollide", 0f);
                RenderMat.SetFloat("_isActive", 0f);
                ScrollSpeed *= -0.5f;
                active       = false;

                SetConnectorStates(TriggerConnector.State.Waiting);

                if (gameObject.layer + 5 == Toolbox.Instance.GetPlayer().layer)
                {
                    MFPP.Audio.Play(SoundBox.Instance.platformOff, Toolbox.Instance.soundEffectsVolume, 1f);
                }


                if (CheckOtherTriggers())
                {
                    controller.CloseAll();
                }
            }
        }
    }