Raw Image Main Texture#
UI / Graphic / Raw Image / Raw Image Main Texture
Can Read
Cannot Write
Description#
The Main 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]
[Title("Raw Image Main Texture")]
[Category("UI/Graphic/Raw Image/Main Texture")]
[Description("The Main Texture property of the Raw Image component")]
[Image(typeof(IconRawImage), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface")]
[Serializable]
public class GenTypeTexture_RawImage_MainTexture : 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.mainTexture : default;
}
public override Texture Get(Args args)
{
RawImage instance = this.m_RawImage.Get<RawImage>(args);
return instance != null
? instance.mainTexture
: default;
}
public override string ToString()
{
return $"{this.m_RawImage} Main Texture";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}