ArabDesert/Assets/USharpVideo/Scripts/Utility/ObjectToggle.cs

26 lines
576 B
C#
Raw Normal View History

2024-05-25 09:10:35 +03:00

using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
namespace UdonSharp.Video.Internal
{
[AddComponentMenu("Udon Sharp/Video/Internal/Object Toggle")]
public class ObjectToggle : UdonSharpBehaviour
{
#pragma warning disable CS0649
[SerializeField]
GameObject[] toggleObjects;
#pragma warning restore CS0649
public void OnToggle()
{
foreach (GameObject toggleObject in toggleObjects)
{
toggleObject.SetActive(!toggleObject.activeSelf);
}
}
}
}