Raw Image Texture#
UI / Graphic / Raw Image / Raw Image Texture
Can Read
Can Write
Description#
The Texture property of the Raw Image 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.UI;
namespace VisualScript.Runtime
{
[Get]
[Set]
[Title("Raw Image Texture")]
[Category("UI/Graphic/Raw Image/Texture")]
[Description("The Texture property of the Raw Image component")]
[Image(typeof(IconRawImage), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface")]
[Serializable]
public class GenTypeTexture_RawImage_Texture : TypeTexture
{
[SerializeField] private GetGameObject m_RawImage = new GetGameObject(
new GenTypeGameObject_RawImage()
);
public override Texture GetPreview(GameObject source)
{
GameObject instance = this.m_RawImage.GetPreview(source);
if (instance == null) return default;
RawImage component = instance.GetComponent<RawImage>();
return component != null ? component.texture : default;
}
public override Texture Get(Args args)
{
RawImage instance = this.m_RawImage.Get<RawImage>(args);
return instance != null
? instance.texture
: default;
}
public override void Set(Texture value, Args args)
{
RawImage component = this.m_RawImage.Get<RawImage>(args);
if (component != null) component.texture = (Texture) value;
}
public override string ToString()
{
return $"{this.m_RawImage} Texture";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}