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