Reflection Probe Realtime Texture#
Rendering / Reflection Probe / Reflection Probe Realtime Texture
Can Read
Can Write
Description#
The Realtime Texture property of the Reflection Probe 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.Rendering;
namespace VisualScript.Runtime
{
[Get]
[Set]
[Title("Reflection Probe Realtime Texture")]
[Category("Rendering/Reflection Probe/Realtime Texture")]
[Description("The Realtime Texture property of the Reflection Probe component")]
[Image(typeof(IconReflectionProbe), ColorTheme.Type.Blue)]
[Serializable]
public class GenTypeTexture_ReflectionProbe_RealtimeTexture : TypeTexture
{
[SerializeField] private GetGameObject m_ReflectionProbe = new GetGameObject(
new GenTypeGameObject_ReflectionProbe()
);
public override Texture GetPreview(GameObject source)
{
GameObject instance = this.m_ReflectionProbe.GetPreview(source);
if (instance == null) return default;
ReflectionProbe component = instance.GetComponent<ReflectionProbe>();
return component != null ? component.realtimeTexture : default;
}
public override Texture Get(Args args)
{
ReflectionProbe instance = this.m_ReflectionProbe.Get<ReflectionProbe>(args);
return instance != null
? instance.realtimeTexture
: default;
}
public override void Set(Texture value, Args args)
{
ReflectionProbe component = this.m_ReflectionProbe.Get<ReflectionProbe>(args);
if (component != null) component.realtimeTexture = (RenderTexture) value;
}
public override string ToString()
{
return $"{this.m_ReflectionProbe} Realtime Texture";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}