DismissImmediate() public méthode

Same as Dismiss(...), but skips the panel's transition, fast-forwarding it instantly to its end state. See the corresponding Dismiss() entry for more details.
public DismissImmediate ( ) : void
Résultat void
Exemple #1
0
    public override void OnInput(ref POINTER_INFO ptr)
    {
        if (deleted)
        {
            return;
        }

        if (!m_controlIsEnabled || IsHidden())
        {
            base.OnInput(ref ptr);
            return;
        }

        if (ptr.evt == whenToInvoke)
        {
            if (panelManager == null)
            {
                if (UIPanelManager.instance == null)
                {
                    base.OnInput(ref ptr);
                    return;
                }
                else
                {
                    panelManager = UIPanelManager.instance;
                }

                // If we still have nothing, return:
                if (panelManager == null)
                {
                    base.OnInput(ref ptr);
                    return;
                }
            }


            if (detargetAllOthers)
            {
                UIManager.instance.DetargetAllExcept(ptr.id);
            }


            switch (changeType)
            {
            case ChangeType.BringIn:
                panelManager.BringIn(panel);
                break;

            case ChangeType.BringInImmediate:
                panelManager.BringInImmediate(panel);
                break;

            case ChangeType.BringInForward:
                panelManager.BringIn(panel, UIPanelManager.MENU_DIRECTION.Forwards);
                break;

            case ChangeType.BringInBack:
                panelManager.BringIn(panel, UIPanelManager.MENU_DIRECTION.Backwards);
                break;

            case ChangeType.Dismiss:
                if (panelManager.CurrentPanel != null)
                {
                    if (string.Equals(panelManager.CurrentPanel.name, panel, System.StringComparison.CurrentCultureIgnoreCase))
                    {
                        panelManager.Dismiss(UIPanelManager.MENU_DIRECTION.Forwards);
                    }
                }
                break;

            case ChangeType.DismissCurrent:
                panelManager.Dismiss(UIPanelManager.MENU_DIRECTION.Forwards);
                break;

            case ChangeType.DismissImmediate:
                panelManager.DismissImmediate(UIPanelManager.MENU_DIRECTION.Forwards);
                break;

            case ChangeType.Toggle:
                if (panelManager != null &&
                    panelManager.CurrentPanel != null &&
                    string.Equals(panelManager.CurrentPanel.name, panel, System.StringComparison.CurrentCultureIgnoreCase))
                {
                    panelManager.Dismiss(UIPanelManager.MENU_DIRECTION.Forwards);
                }
                else
                {
                    panelManager.BringIn(panel);
                }
                break;

            case ChangeType.Forward:
                panelManager.MoveForward();
                break;

            case ChangeType.Back:
                panelManager.MoveBack();
                break;
            }
        }

        base.OnInput(ref ptr);
    }