docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MediaContent

    Container class for a type of media used in a TutorialPage. Can be either an image, or a video (clip or url)

    Inheritance
    object
    MediaContent
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Tutorials.Core.Editor
    Assembly: Unity.Tutorials.Core.Editor.dll
    Syntax
    [Serializable]
    public class MediaContent

    Properties

    AutoStart

    If the Content type is video, does it auto start on load, or require the user to press play to start

    Declaration
    public bool AutoStart { get; set; }
    Property Value
    Type Description
    bool

    ContentType

    Which type of source this content media uses

    Declaration
    public MediaContent.MediaContentType ContentType { get; set; }
    Property Value
    Type Description
    MediaContent.MediaContentType

    Image

    The Texture2D used as Image if the Content Type is set to Image

    Declaration
    public Texture2D Image { get; set; }
    Property Value
    Type Description
    Texture2D

    Loop

    If the content is video, does it loop when it reaches the end.

    Declaration
    public bool Loop { get; set; }
    Property Value
    Type Description
    bool

    Url

    The URL to the video if the source type is set to VideoURL

    Declaration
    public string Url { get; set; }
    Property Value
    Type Description
    string

    VideoClip

    The Clip used if the source type is set to VideoClip

    Declaration
    public VideoClip VideoClip { get; set; }
    Property Value
    Type Description
    VideoClip

    Methods

    IsValid()

    A Media Content is considered valid if the associated media to its set type is not null (e.g. an Image Media Content Image properties is not null or a VideoUrl Media url is not null or empty

    Declaration
    public bool IsValid()
    Returns
    Type Description
    bool

    True if contains the right media, false otherwise

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)