public void Open(int sortOrder, CUIViewBase originUI, CUIInteractable originButton, bool canCloseByReturnButton = true) { Debug.Log($"Open UI {this.gameObject.name}"); this._previousUI = originUI; this._previousButton = originButton; this._canCloseByReturnButton = canCloseByReturnButton; this._onOpen?.Invoke(); this._canvas.sortingOrder = sortOrder; if (this._shouldPlayOpenAndCloseMenuSound) { #if FMOD RuntimeManager.PlayOneShot(this._gameSettings.SoundOpenMenu); #else Debug.LogError("'Play Open menu sound' not implemented without FMOD"); #endif } UpdateCTime(); }
public T OpenMenu <T>(AssetReference uiReference, CUIViewBase originUI, CUIInteractable originButton, bool canCloseByReturnButton = true) { var openedMenu = this.OpenMenu(uiReference, originUI, originButton, canCloseByReturnButton); return(openedMenu != null?openedMenu.GetComponent <T>() : default);