29 lines
610 B
C#
29 lines
610 B
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class ObjsSyncActive : MonoBehaviour
|
|
{
|
|
public List<GameObject> objects;
|
|
public bool isReverse;
|
|
private void OnEnable()
|
|
{
|
|
foreach (var item in objects)
|
|
{
|
|
if (!isReverse)
|
|
item.SetActive(true);
|
|
else
|
|
item.SetActive(false);
|
|
}
|
|
}
|
|
private void OnDisable()
|
|
{
|
|
foreach (var item in objects)
|
|
{
|
|
if (!isReverse)
|
|
item.SetActive(false);
|
|
else
|
|
item.SetActive(true);
|
|
}
|
|
}
|
|
}
|