Video Player Is Prepared#
Video / Video Player / Video Player Is Prepared
Can Read
Cannot Write
Description#
The Is Prepared property of the Video Player component
Code#
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>
using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.Video;
namespace VisualScript.Runtime
{
[Get]
[Title("Video Player Is Prepared")]
[Category("Video/Video Player/Is Prepared")]
[Description("The Is Prepared property of the Video Player component")]
[Image(typeof(IconVideo), ColorTheme.Type.Blue)]
[Keywords("Movie, Film")]
[Serializable]
public class GenTypeBool_VideoPlayer_IsPrepared : TypeBool
{
[SerializeField] private GetGameObject m_VideoPlayer = new GetGameObject(
new GenTypeGameObject_VideoPlayer()
);
public override bool GetPreview(GameObject source)
{
GameObject instance = this.m_VideoPlayer.GetPreview(source);
if (instance == null) return default;
VideoPlayer component = instance.GetComponent<VideoPlayer>();
return component != null ? component.isPrepared : default;
}
public override bool Get(Args args)
{
VideoPlayer instance = this.m_VideoPlayer.Get<VideoPlayer>(args);
return instance != null
? instance.isPrepared
: default;
}
public override string ToString()
{
return $"{this.m_VideoPlayer} Is Prepared";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}