blob: dde8ad6018e378a71c8953130b1cbf8560480b58 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
using UnityEngine;
public class HasControl : MonoBehaviour
{
public bool hasControl = true;
public GameObject[] objectsToRemove;
private void Awake()
{
UpdateControl();
}
private void UpdateControl()
{
GameObject[] array = objectsToRemove;
foreach (GameObject gameObject in array)
{
gameObject.SetActive(hasControl);
}
}
public void ChangeControl(bool control)
{
hasControl = control;
UpdateControl();
}
}
|