Ejemplo n.º 1
0
    /// <summary>
    /// Funzione che setta il menù corrente a quello del tipo passato.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <returns>Ritorna la conferma dell'azione eseguita</returns>
    public bool SetCurrentMenuAnimation <T>(string _animationID, Action _animationCallback = null) where T : UIControllerBase
    {
        UIControllerBase menuToSet = GetMenu <T>();

        if (menuToSet == null)
        {
            // non ho trovato il tipo del menù
            return(false);
        }
        else
        {
            // cambio effettivamente menù
            for (int i = 0; i < menus.Count; i++)
            {
                menus[i].ToggleMenu(false);
            }

            currentMenu              = menuToSet;
            currentAnimPanel         = currentMenu;
            currentAnimPanelCallback = _animationCallback;
            anim.SetTrigger(_animationID);
            currentMenu.ToggleMenu(true);
            currentAnimPanel.Enable(false);
            OnCurrentMenuChange(currentMenu);
            return(true);
        }
    }
Ejemplo n.º 2
0
    public void EndAnimationCallback()
    {
        currentAnimPanel.Enable(true);
        anim.SetTrigger("GoToEmpty");
        currentAnimPanel = null;

        currentAnimPanelCallback?.Invoke();
        currentAnimPanelCallback = null;
    }