Light Cookie#
Rendering / Light / Light Cookie
Can Read
Can Write
Description#
The Cookie property of the Light 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("Light Cookie")]
[Category("Rendering/Light/Cookie")]
[Description("The Cookie property of the Light component")]
[Image(typeof(IconLight), ColorTheme.Type.Yellow)]
[Serializable]
public class GenTypeTexture_Light_Cookie : TypeTexture
{
[SerializeField] private GetGameObject m_Light = new GetGameObject(
new GenTypeGameObject_Light()
);
public override Texture GetPreview(GameObject source)
{
GameObject instance = this.m_Light.GetPreview(source);
if (instance == null) return default;
Light component = instance.GetComponent<Light>();
return component != null ? component.cookie : default;
}
public override Texture Get(Args args)
{
Light instance = this.m_Light.Get<Light>(args);
return instance != null
? instance.cookie
: default;
}
public override void Set(Texture value, Args args)
{
Light component = this.m_Light.Get<Light>(args);
if (component != null) component.cookie = (Texture) value;
}
public override string ToString()
{
return $"{this.m_Light} Cookie";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}