Stratasys-450mc-VR/Assets/Scripts/GameObjectToggler.cs

24 lines
507 B
C#
Raw Normal View History

2023-11-01 10:51:29 -04:00
using System;
using System.Collections;
using System.Collections.Generic;
using Sirenix.OdinInspector;
using UnityEngine;
public class GameObjectToggler : MonoBehaviour
{
[SerializeField] private GameObject goToToggle;
[SerializeField] private bool defaultActiveState = true;
private void OnEnable()
{
goToToggle.SetActive(defaultActiveState);
}
[Button]
public void Toggle()
{
goToToggle.SetActive(!goToToggle.activeSelf);
}
}