Beispiel #1
0
        //------------------------
        // OPEN AND CLOSE
        //------------------------

        public void OnRelease()
        {
            if (!IsInteractable)
            {
                return;
            }

            //Inform Hotspot controller that popup has been opened
            if (controller != null)
            {
                controller.PopUpOpened();
            }

            //Enable Children
            EnableChildHotspots();
            DisableNonHotspotChildren();

            //Click Action
            switch (ClickAction)
            {
            case OnClickAction.Disable:
                IsInteractable = false;
                break;

            case OnClickAction.Hide:
            case OnClickAction.Delete:
                HideHotspot();
                break;
            }
        }
        //==============================================================
        //POPUP
        //==============================================================

        //When touched spawn correct popup.
        public void OnRelease()
        {
            if (!canvas)
            {
                return;
            }
            if (!IsInteractable)
            {
                return;
            }

            //Pay Audio
            if (hotspotDataModel.playAudioOnAction && hotspotDataModel.clickAudio.audioClip != null)
            {
                AudioSource.PlayClipAtPoint(hotspotDataModel.clickAudio.audioClip, AbstractImmersiveCamera.CurrentImmersiveCamera.transform.position, hotspotDataModel.clickAudio.audioVolume);
            }

            //Inform Hotspot controller that popup has been opened
            if (controller != null)
            {
                controller.PopUpOpened();
            }

//#if UNITY_WEBGL && !UNITY_EDITOR
//            WebGLCommunication._instance.CallWeb("" + hotspotDataModel.actionType);
//#endif
            //Select and instantiate the correct pop up type
            switch (hotspotDataModel.actionType)
            {
            case ActionType.ImagePopup:
                InstantiateImagePopUp();
                break;

            case ActionType.ImageSequencePopup:
                InstantiateImageSequencePopUp();
                break;

            case ActionType.VideoPopup:
                InstantiateVideoPopUp();
                break;

            case ActionType.TextPopup:
                InstantiateTextPopUp();
                break;

            case ActionType.QuizPopup:
                InstantiateQAndAPopUp();
                break;

            case ActionType.SceneLink:
                ChangeScene();
                break;

            case ActionType.ActivateAndHideObjects:
                HideOrRevealObjects();
                break;

            case ActionType.AudioPopup:
                InstantiateAudioPopUp();
                break;

            case ActionType.SplitPopup:
                InstantiateSplitPopup();
                break;
            }

            if (presentingMultiHotspot != null)
            {
                presentingMultiHotspot.ChildHotspotOpened(this, hotspotDataModel.clickAction);
            }

            if (IsPopupHotspot)
            {
                HideDeleteOrDisableOnClick();
            }
        }