Video Player Target Material Property#
Video / Video Player / Video Player Target Material Property
Can Read
Can Write
Description#
The Target Material Property 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 Target Material Property")]
[Category("Video/Video Player/Target Material Property")]
[Description("The Target Material Property property of the Video Player component")]
[Image(typeof(IconVideo), ColorTheme.Type.Blue)]
[Keywords("Movie, Film")]
[Serializable]
public class GenTypeString_VideoPlayer_TargetMaterialProperty : TypeString
{
[SerializeField] private GetGameObject m_VideoPlayer = new GetGameObject(
new GenTypeGameObject_VideoPlayer()
);
public override string GetPreview(GameObject source)
{
GameObject instance = this.m_VideoPlayer.GetPreview(source);
if (instance == null) return default;
VideoPlayer component = instance.GetComponent<VideoPlayer>();
return component != null ? component.targetMaterialProperty : default;
}
public override string Get(Args args)
{
VideoPlayer instance = this.m_VideoPlayer.Get<VideoPlayer>(args);
return instance != null
? instance.targetMaterialProperty
: default;
}
public override void Set(string value, Args args)
{
VideoPlayer component = this.m_VideoPlayer.Get<VideoPlayer>(args);
if (component != null) component.targetMaterialProperty = (string) value;
}
public override string ToString()
{
return $"{this.m_VideoPlayer} Target Material Property";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}