TextureCombiner/Assets/Scripts/UI/ToggleInvoke.cs
max 1165a4e4a8 Init.
P4 -> GitHub sync.
2020-11-01 03:54:32 +01:00

23 lines
443 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace TextureCombiner
{
[RequireComponent(typeof(Toggle))]
public class ToggleInvoke : MonoBehaviour
{
private Toggle m_toggle = null;
private void Awake()
{
m_toggle = GetComponent<Toggle>();
}
private void OnEnable()
{
m_toggle.onValueChanged.Invoke(m_toggle.isOn);
}
}
}