Exemplo n.º 1
0
    public void StartHud(
        SectionCustomizationManager secManager,
        System.Action <int> mainAction,
        System.Action <int, int> changeAction,
        System.Action <int> returnAction,
        CustomizationManagerMenu.EditableElements[] dasOpcoes,
        ResizeUiType tipoDeR = ResizeUiType.vertical,
        int selectIndex      = 0
        )
    {
        this.secManager = secManager;
        this.opcoes     = dasOpcoes;

        this.returnAction += returnAction;
        this.changeAction += changeAction;

        this.MainAction += (int x) =>
        {
            if (!estadoDeAcao)
            {
                estadoDeAcao = true;
                ChangeSelectionTo(x);


                SupportSingleton.Instance.InvokeInRealTime(() =>
                {
                    Debug.Log("Função chamada com delay para destaque do botão");
                    mainAction(x);
                    estadoDeAcao = false;
                }, .05f);
            }
        };
        StartHud(opcoes.Length, tipoDeR, selectIndex);
    }
Exemplo n.º 2
0
        public void StartHud(
            System.Action <int> acao,
            string[] txDeOpcoes,
            ResizeUiType tipoDeR = ResizeUiType.vertical,
            int selectIndex      = 0
            )
        {
            this.opcoes = txDeOpcoes;

            this.acao += (int x) =>
            {
                if (!estadoDeAcao)
                {
                    estadoDeAcao = true;
                    ChangeSelectionTo(x);

                    SupportSingleton.Instance.InvokeInRealTime(() =>
                    {
                        Debug.Log("Função chamada com delay para destaque do botão");
                        acao(x);
                        estadoDeAcao = false;
                    }, .05f);
                }
            };
            StartHud(opcoes.Length, tipoDeR, selectIndex);
        }