public void OpenSortMenu() { if (m_SortPrefab == null || m_DrowDownAnchor == null || _dropDownParent == null) { return; } _dropDown = Instantiate(m_SortPrefab); _dropDown.gameObject.SetActive(true); _dropDown.transform.SetParent(m_DrowDownAnchor, false); _dropDown.Initialize(_sortInterface, this); _dropDown.transform.SetParent(_dropDownParent, true); }
public void ToggleSortMenu(bool isOn) { if (isOn) { if (_dropDown != null) { _dropDown.gameObject.SetActive(false); DestroyImmediate(_dropDown.gameObject); _dropDown = null; } OpenSortMenu(); } else { CloseSortMenu(); } }
public void CloseSortMenu() { if (_dropDown != null) { _dropDown.gameObject.SetActive(false); Destroy(_dropDown.gameObject); _dropDown = null; } UpdateSortButton(); _loaded = false; if (m_SortToggle != null) { m_SortToggle.isOn = false; } _loaded = true; }