Video Player Wait For First Frame#
Video / Video Player / Video Player Wait For First Frame
Can Read
Can Write
Description#
The Wait For First Frame 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]
[Set]
[Title("Video Player Wait For First Frame")]
[Category("Video/Video Player/Wait For First Frame")]
[Description("The Wait For First Frame property of the Video Player component")]
[Image(typeof(IconVideo), ColorTheme.Type.Blue)]
[Keywords("Movie, Film")]
[Serializable]
public class GenTypeBool_VideoPlayer_WaitForFirstFrame : 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.waitForFirstFrame : default;
}
public override bool Get(Args args)
{
VideoPlayer instance = this.m_VideoPlayer.Get<VideoPlayer>(args);
return instance != null
? instance.waitForFirstFrame
: default;
}
public override void Set(bool value, Args args)
{
VideoPlayer component = this.m_VideoPlayer.Get<VideoPlayer>(args);
if (component != null) component.waitForFirstFrame = (bool) value;
}
public override string ToString()
{
return $"{this.m_VideoPlayer} Wait For First Frame";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}