Set Raw Image Texture#
UI / Graphic / Raw Image / Set Raw Image Texture
Description#
Sets the Texture property of Raw Image component
Parameters#
| Name | Description |
|---|---|
| Raw Image | |
| Value |
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
{
[Title("Set Raw Image Texture")]
[Category("UI/Graphic/Raw Image/Texture")]
[Description("Sets the Texture property of Raw Image component")]
[Image(typeof(IconRawImage), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface")]
[Parameter("Raw Image")]
[Parameter("Value")]
[Serializable]
public class GenInstructionTexture_RawImage_SetTexture : Instruction
{
[SerializeField] private GetGameObject m_RawImage = new GetGameObject(
new GenTypeGameObject_RawImage()
);
[SerializeField] private GetTexture m_Value = new GetTexture();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Texture");
return $"{this.m_RawImage} {member} = {this.m_Value}";
}
protected override Awaitable Run(Args args)
{
RawImage component = this.m_RawImage.Get<RawImage>(args);
if (component == null) return Done;
component.texture = this.m_Value.Get(args) as Texture;
return Done;
}
}
}