|
|
|
|
|
|
public GameObject arrowOpened; |
|
|
|
public GameObject arrowClosed; |
|
|
|
|
|
|
|
protected override void Awake() |
|
|
|
protected override void Start() |
|
|
|
base.Awake(); |
|
|
|
base.Start(); |
|
|
|
onValueChanged.AddListener(SetState); |
|
|
|
SetState(isOn); |
|
|
|
} |
|
|
|
|
|
|
if (arrowOpened == null || arrowClosed == null || content == null) |
|
|
|
return; |
|
|
|
|
|
|
|
arrowOpened.SetActive(state); |
|
|
|
arrowClosed.SetActive(!state); |
|
|
|
content.SetActive(state); |
|
|
|
if (arrowOpened.activeSelf != state) |
|
|
|
arrowOpened.SetActive(state); |
|
|
|
|
|
|
|
if (arrowClosed.activeSelf == state) |
|
|
|
arrowClosed.SetActive(!state); |
|
|
|
|
|
|
|
if (content.activeSelf != state) |
|
|
|
content.SetActive(state); |
|
|
|
|
|
|
|
if (rebuildLayout) |
|
|
|
LayoutRebuilder.ForceRebuildLayoutImmediate(transform.parent as RectTransform); |
|
|
|