Пример #1
0
    public IEnumerator SuggestContinue(Action <ContinueRequestType> onSelected)
    {
        //コンテニューする場合
        //コンテニューボタンが押された

        //コンテニューしない場合
        //NoThanksボタンを押された、タイムアップした

        bool isEnd = false;

        continueButton.gameObject.SetActive(true);

        continueButton.OnClickEvent.RemoveAllListeners();
        continueButton.AddListener(() =>
        {
            isEnd = true;
            onSelected.SafeInvoke(ContinueRequestType.Continue);
        });


        continueButton.StartCountDown(() =>
        {
            isEnd = true;
            onSelected.SafeInvoke(ContinueRequestType.TimeOut);
        },
                                      () =>
        {
            isEnd = true;
            onSelected.SafeInvoke(ContinueRequestType.NoThanks);
        });

        yield return(new WaitUntil(() => isEnd));

        continueButton.gameObject.SetActive(false);
    }