// Use this for initialization void Start() { ActionFunction = "MediaHotspot"; addMediaHotspot = GameObject.Find("AddMediaHotspot").GetComponent <TriLib.Samples.AddMediaHotspot>(); addMediaHotspot.LandscapeMode(); targetAction = addMediaHotspot.targetAction; targetAction.onValueChanged.AddListener(delegate { if (SetupDome.SelectedHotspot == gameObject) { // InstantiateObjects (targetObject.captionText.text); if (targetAction.captionText.text == "Image") { BrowseImage = true; } else { BrowseImage = false; } } }); }
// Update is called once per frame void Update() { Position = gameObject.transform.position; if (!Preview) { if (addMediaHotspot == null) { addMediaHotspot = GameObject.Find("AddMediaHotspot").GetComponent <TriLib.Samples.AddMediaHotspot>(); } } else { // FullScreenVideoUIPrv = GameObject.Find("FullScreenPreView").gameObject; } if (changeAspetRatio) { if (Potrate) { changeAspetRatio = false; VideoMesh.SetActive(true); FullScreenVideoPlayer.Stop(); FrameOutLine.gameObject.SetActive(true); FullScreenVideoPlayer.gameObject.SetActive(false); VideoMesh.gameObject.SetActive(true); VideoMesh.gameObject.transform.localScale = new Vector3(80f, 100f, 1f); VideoMesh.gameObject.transform.localPosition = new Vector3(0f, 0f, 1f); FrameOutLine.rectTransform.sizeDelta = new Vector2(80 + 5f, 100 + 5f); FrameOutLine.rectTransform.localPosition = new Vector3(0f, 0f, 1f); FrameOutLine.GetComponent <BoxCollider>().size = new Vector3(80f, 100f, 4f); videoPlayer.url = videoURL; } if (landscape) { changeAspetRatio = false; VideoMesh.SetActive(true); FullScreenVideoPlayer.Stop(); FrameOutLine.gameObject.SetActive(true); FullScreenVideoPlayer.gameObject.SetActive(false); VideoMesh.gameObject.SetActive(true); VideoMesh.gameObject.transform.localScale = new Vector3(140f, 75f, 1f); FrameOutLine.rectTransform.sizeDelta = new Vector2(140f + 5f, 75f + 5f); FrameOutLine.GetComponent <BoxCollider>().size = new Vector3(145f, 75f, 4f); if (videoURL != "") { videoPlayer.url = videoURL; } } if (fullScreen) { videoPlayer.Stop(); FrameOutLine.gameObject.SetActive(false); VideoMesh.gameObject.SetActive(false); changeAspetRatio = false; if (!Preview) { videoPlayer.playOnAwake = false; videoPlayer.waitForFirstFrame = false; FullScreenVideoUIPrv = addMediaHotspot.FullSceenVideoUI; FullScreenVideoUIPrv.SetActive(true); if (Application.platform == RuntimePlatform.OSXPlayer) { FullScreenVideoUIPrv.GetComponent <Camera>().rect = new Rect(0.266f, 0.42f, 0.465f, 0.42f); } if (Application.platform == RuntimePlatform.WindowsPlayer) { FullScreenVideoUIPrv.GetComponent <Camera>().rect = new Rect(0.247f, 0.41f, 0.4699f, 0.38f); } } else { VideoMesh.SetActive(false); MediaContainer.SetActive(true); FullScreenVideoPlayer.Stop(); videoPlayer.Stop(); FullScreenVideoPlayer.playOnAwake = false; FullScreenVideoPlayer.waitForFirstFrame = false; FullScreenVideoPlayer.GetComponent <Camera>().rect = new Rect(0, 0.05f, 0.83f, 0.83f); FullScreenVideoUIPrv.transform.GetChild(0).gameObject.SetActive(true); FullScreenVideoUIPrv.transform.GetChild(0).GetChild(0).GetComponent <MediaFullScrenController>().FullVideo = FullScreenVideoPlayer; } FullScreenVideoPlayer.gameObject.SetActive(true); FullScreenVideoPlayer.url = videoURL; } } }