示例#1
0
    private void OpenTutorial(TutorialData tutorial)
    {
        rootRect.gameObject.SetActive(true);

        // Scale the root rect into view
        UISettings.OpenWindow(rootRect);

        // Set the display items
        title.text         = tutorial.Title;
        explanation.text   = tutorial.Explanation;
        image.enabled      = tutorial.VisualType == TutorialVisualType.Image;
        videoImage.enabled = tutorial.VisualType == TutorialVisualType.Video;

        // Check if the video streaming path exists
        if (videoImage.enabled)
        {
            // Set the video player source to a file url
            videoPlayer.source = VideoSource.Url;
            videoPlayer.url    = tutorial.VideoStreamingURL;
            videoPlayer.Play();
        }
        // If video streaming path does not exist then
        // use the image for the tutorial
        else
        {
            image.sprite = tutorial.Sprite;
        }

        // When button is clicked then close the tutorial
        closeButton.onClick.AddListener(Close);
    }
示例#2
0
 public static void Open()
 {
     instance.gameObject.SetActive(true);
     UISettings.OpenWindow(instance.window);
 }
 public void Open(string message)
 {
     // Setup the text and button callbacks
     messageText.text = message;
     UISettings.OpenWindow(window);
 }