Exemplo n.º 1
0
    void OnMouseDown()
    {
        // If menu or popup is open, accept no input
        if (!(_ui.isMenuOpen || _popupManager.IsDisplaying()))
        {
            // Is this a cassette container?
            if (!cassetteOverride)
            {
                if (!_interactedWith)
                {
                    StartCoroutine(TapeDiscoveryAudio());
                }
                else
                {
                    FMODUnity.RuntimeManager.PlayOneShot(postDialogAudio);
                }

                if (!dontShowPopup)
                {
                    // Only display the popup if it has not been recently interacted with
                    if (!_recentlyPressed)
                    {
                        if (_popupManager.GetIfAvailable())
                        {
                            // LAUNCH CARTRIDGE DIALOG IF UNPRESSED BEFORE
                            if (!_interactedWith)
                            {
                                _popupManager.Pop(preDialog, _cassetteColor, cassetteFound);
                                _interactedWith  = true;
                                _recentlyPressed = true;
                            }

                            // LAUNCH SECONDARY DIALOG IF PRESSED
                            else
                            {
                                _popupManager.Pop(postDialog, new Color(0, 0, 0, 0));
                            }
                        }
                    }
                    // This is a micro interaction!
                }
                else
                {
                    FMODUnity.RuntimeManager.PlayOneShot(preDialogAudio);
                    if (!dontShowPopup)
                    {
                        if (!_recentlyPressed)
                        {
                            if (_popupManager.GetIfAvailable())
                            {
                                _popupManager.Pop(preDialog, Color.clear);
                                _recentlyPressed = true;
                            }
                        }
                    }
                }
            }

            _anim.Play("Pressed");
            _pressTimer = 0;
        }
    }