コード例 #1
0
    public void EnablePopUpButton()
    {
        GameObject canvas = GameObject.FindGameObjectWithTag(PopUpCanvasTag);

        if (canvas == null)
        {
            Debug.LogWarning("Unable to find Pop-up canvas to display image on");
        }
        else
        {
            if (gameObject.CompareTag("pic1"))
            {
                AudioEvent.SendAudioEvent(AudioEvent.AudioEventType.PictureOff_01, audioEvents, gameObject);
            }
            else if (gameObject.CompareTag("pic2"))
            {
                AudioEvent.SendAudioEvent(AudioEvent.AudioEventType.PictureOff_02, audioEvents, gameObject);
            }
            else if (gameObject.CompareTag("pic3"))
            {
                AudioEvent.SendAudioEvent(AudioEvent.AudioEventType.PictureOff_03, audioEvents, gameObject);
            }
            else if (gameObject.CompareTag("pic4"))
            {
                AudioEvent.SendAudioEvent(AudioEvent.AudioEventType.PictureOff_04, audioEvents, gameObject);
            }

            PopUpCanvas popUpCanvasComponent = canvas.GetComponent <PopUpCanvas>();
            popUpCanvasComponent.EnableButton();
        }
    }
コード例 #2
0
    IEnumerator ZoomCamerain()
    {
        closeCam.SetActive(true);
        yield return(new WaitForSeconds(TimeZoomedIn));

        GameObject  canvas = GameObject.FindGameObjectWithTag(PopUpCanvasTag);
        PopUpCanvas popUpCanvasComponent = canvas.GetComponent <PopUpCanvas>();

        popUpCanvasComponent.SetImage(Sprite);
        popUpCanvasComponent.ShowPopUp();
        dialogueTrigger.TriggerDialogue();
        _isShown = true;
        closeCam.SetActive(false);
    }