Files
Ultimate-Fishing-Simulator-…/Assets/Scripts/Assembly-CSharp/Battlehub/RTEditor/Expander.cs
2026-03-04 09:37:33 +08:00

59 lines
991 B
C#

using UnityEngine;
namespace Battlehub.RTEditor
{
public class Expander : MonoBehaviour
{
public GameObject Expanded;
public GameObject Collapsed;
public GameObject EditorPanel;
public bool m_isExpanded;
public bool IsExpanded
{
get
{
return m_isExpanded;
}
set
{
m_isExpanded = value;
Expanded.SetActive(m_isExpanded);
Collapsed.SetActive(!m_isExpanded);
}
}
private void Start()
{
if (!IsExpanded)
{
if ((bool)EditorPanel)
{
EditorPanel.gameObject.SetActive(m_isExpanded);
}
Expanded.SetActive(m_isExpanded);
Collapsed.SetActive(!m_isExpanded);
}
else
{
if ((bool)EditorPanel)
{
EditorPanel.gameObject.SetActive(m_isExpanded);
}
Expanded.SetActive(m_isExpanded);
Collapsed.SetActive(!m_isExpanded);
}
}
public void ShowPanel(bool value)
{
EditorPanel.gameObject.SetActive(value);
Expanded.SetActive(value);
Collapsed.SetActive(!value);
}
}
}