37 lines
759 B
C#
37 lines
759 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using WI;
|
|
|
|
public class Panel_Effect : MonoBehaviour, ISingle
|
|
{
|
|
public int activeCount;
|
|
|
|
private List<GameObject> activePanel = new();
|
|
|
|
public void ActivePanel(GameObject panelObject)
|
|
{
|
|
if (!activePanel.Contains(panelObject))
|
|
{
|
|
activePanel.Add(panelObject);
|
|
activeCount++;
|
|
}
|
|
|
|
gameObject.SetActive(true);
|
|
}
|
|
public void DeactivePanel(GameObject panelObject)
|
|
{
|
|
if (activeCount > 0)
|
|
{
|
|
activePanel.Remove(panelObject);
|
|
|
|
activeCount--;
|
|
|
|
if (activeCount <= 0)
|
|
{
|
|
gameObject.SetActive(false);
|
|
}
|
|
}
|
|
}
|
|
}
|