Hello I’m a scripting beginner so I would appreciate a clear answer if possible.
I bought a script but I need to adapt it to my needs. Basically my needs are to use unity 5 canvas buttons instead the example supplied buttons that happen to be in the same .cs file as the action I need to use. The script plays YouTube videos on mobile. I’ve tested it and it works out of the box, but is not working with the customization I’ve made.
I’m supposed to create an empty object and put 2 scripts there.
This is the script SUPPLIED example that works perfectly:
public class GetVideo : MonoBehaviour {
public string videoId1 = "";
void OnGUI()
{
GUI.depth = 0;
if(GUI.Button(new Rect(0,0,Screen.width,Screen.height/2),"Load Video 1"))
{
Handheld.PlayFullScreenMovie(YoutubeVideo.Instance.RequestVideo(videoId1, 720));
Debug.Log("The video only plays on mobile device, if you receive one big url on console all it's ok");
}
}
}
This is the script I’ve done to use along with Unity5 Button’s onClic function:
public class GetVideo : MonoBehaviour
{
public string videoId1 = "";
public void OnClic()
{
{
Handheld.PlayFullScreenMovie(YoutubeVideo.Instance.RequestVideo(videoId1, 720));
Debug.Log("The video only plays on mobile device, if you receive one big url on console all it's ok");
}
}
}
Then I seek for what I think is the correct function:
!
I appreciate if someone gives me a hint on what I’m missing here?
Thanks!!