Tanoda
EnableDisable.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using UnityEngine;
5
6public class EnableDisable : MonoBehaviour
7{
8 public GameObject go;
9
10 public UnityEvent onChanged;
11
12 public void ChangeState(bool value)
13 {
14 go.SetActive(value);
15 onChanged?.Invoke();
16 }
17
18 public void Toggle()
19 {
20 go.SetActive(!go.activeSelf);
21 }
22}
UnityEvent onChanged
GameObject go
Definition: EnableDisable.cs:8
void ChangeState(bool value)