public void PlayTheVideo() { if (pressed == false) { Video.SetActive(true); stream.Play(); pressed = true; } else { stream.Stop(); Video.SetActive(false); pressed = false; } }
public void Display(ClassResource resource) { switch (resource.type) { case "video": Media.SetActive(true); player.gameObject.SetActive(true); Debug.Log("Carregando video de:" + Application.streamingAssetsPath + resource.src); player.SetSource(Application.streamingAssetsPath + resource.src); player.Play(); break; case "image": Media.SetActive(true); image.gameObject.SetActive(true); Debug.Log("Carregando imagem de:" + Application.streamingAssetsPath + resource.src); StartCoroutine(LoadTextureInto(Application.streamingAssetsPath + resource.src, image)); break; case "text": Media.SetActive(true); textoPages.SetActive(true); Debug.Log("Carregando texto de:" + Application.streamingAssetsPath + resource.src); ShowText(resource); break; case "url": Application.OpenURL(resource.src); break; default: Debug.Log("Abrindo aplicacao para o arquivo:" + resource.src); Application.OpenURL(Application.streamingAssetsPath + resource.src); break; } }