Esempio n. 1
0
    public bool OnReceiveSeasonPassStepAck(ERandomwarsSeasonErrorCode errorCode, int rewardId, ItemBaseInfo useItemInfo, ItemBaseInfo rewardInfo, QuestData[] arrayQuestData)
    {
        UI_Main.Get().obj_IndicatorPopup.SetActive(false);

        UI_Popup.AllClose();

        if (errorCode == ERandomwarsSeasonErrorCode.Success)
        {
            switch (useItemInfo.ItemId)
            {
            case 1:
                UserInfoManager.Get().GetUserInfo().gold += useItemInfo.Value;
                break;

            case 2:
                UserInfoManager.Get().GetUserInfo().diamond += useItemInfo.Value;
                break;
            }

            UserInfoManager.Get().GetUserInfo().seasonPassRewardStep = rewardId;
            UserInfoManager.Get().GetUserInfo().seasonTrophy        += rewardInfo.Value;

            UI_Main.Get().RefreshUserInfoUI();
            UI_Popup_Quest.QuestUpdate(arrayQuestData);
            SendMessageUpwards("RefreshSeasonInfo", SendMessageOptions.DontRequireReceiver);

            transform.parent.BroadcastMessage("SetButton");
        }
        else
        {
            UI_ErrorMessage.Get().ShowMessage("재화가 부족합니다.");
        }

        return(true);
    }
Esempio n. 2
0
 void Start()
 {
     // there can be only one (0_0)
     CurrentInstance   = this;
     originalTextColor = ToWriteTo.color;
     cleanUp();
 }
Esempio n. 3
0
    public void CloseUI()
    {
        UI_Popup LastPopUp = Managers.UI.PeekUI();

        if (LastPopUp != null)
        {
            string temp = LastPopUp.PopUpName();
            if (LastPopUp.ClosePopupUI())
            {
                if (temp == "Inven")
                {
                    _Inven = null;
                }
                else if (temp == "Equip")
                {
                    _Equip = null;
                }

                else if (temp == "SkillTree")
                {
                    _SkillTree = null;
                }
            }
        }
    }
Esempio n. 4
0
 /// <summary> Prepares dictionary of child popups </summary>
 void InitChildPopups()
 {
     UI_Popup[] childPopups = GetComponentsInChildren <UI_Popup>(true);
     for (int i = 0; i < childPopups.Length; ++i)
     {
         UI_Popup popup = childPopups[i];
         popup.parentManager = this;
         popups.Add(popup.popupType, popup);
         popup.gameObject.SetActive(false);
     }
 }
Esempio n. 5
0
    public void ClosePopupUI()
    {
        if (_popupStack.Count == 0)
        {
            return;
        }

        UI_Popup popup = _popupStack.Pop();

        Managers.Resource.Destroy(popup.gameObject);
        popup = null;
    }
Esempio n. 6
0
    /// <summary> Populates the next popup and starts it animating in </summary>
    void ShowNextPopup()
    {
        currentPopupInfo = queuedPopups.Dequeue();
        currentPopup     = popups[currentPopupInfo._popupType];
        currentPopup.StartShowing(currentPopupInfo);
        gameObject.SetActive(true);

        // Set state
        animSpeed    = currentPopup.ShowAnimSpeed;
        animProgress = 0f;
        state        = States.PoppingUp;
    }
Esempio n. 7
0
 //특정한 팝업을 닫는 매서드
 public void ClosePopupUI(UI_Popup popup)
 {
     if (_popupStack.Count == 0)
     {
         return;
     }
     if (_popupStack.Peek() != popup) //원하는 팝업이 아닌 녀석이 닫히게 되는 경우를 방지
     {
         Debug.Log("Close Popup Failed");
         return;
     }
     ClosePopupUI();
 }
Esempio n. 8
0
    /// <summary> Called once per frame </summary>
    void Update()
    {
        switch (state)
        {
        case States.Idle:
            gameObject.SetActive(false);
            break;

        case States.PoppingUp:
            animProgress += animSpeed * Time.deltaTime;
            if (animProgress > 1f)
            {
                animProgress = 1f;
                state        = States.PopupShown;
            }
            currentPopup.UpdateShowAnim(animProgress);
            break;

        case States.PopupShown:
            break;

        case States.Dismissing:
            animProgress += animSpeed * Time.deltaTime;
            if (animProgress < 1f)
            {
                currentPopup.UpdateHideAnim(animProgress);
            }
            else
            {
                if (dismissCallback != null)
                {
                    dismissCallback();
                }

                currentPopup.gameObject.SetActive(false);
                currentPopup = null;
                if (queuedPopups.Count > 0)
                {
                    ShowNextPopup();
                }
                else
                {
                    state = States.Idle;
                }
            }
            break;

        default:
            throw new UnityException("Unhandled state " + state);
        }
    }
Esempio n. 9
0
    public void ClosePopupUI()
    {
        if (m_popupStack.Count == 0)
        {
            return;
        }

        UI_Popup popup = m_popupStack.Pop();

        Debug.Log(popup.name);
        GameObject.Destroy(popup.gameObject);
        popup = null;
        m_order--;
    }
Esempio n. 10
0
    public void DisactivatePopupUI()
    {
        if (m_popupStack.Count == 0)
        {
            return;
        }

        UI_Popup popup = m_popupStack.Pop();

        Debug.Log(popup.name);
        popup.gameObject.SetActive(false);
        popup = null;
        m_order--;
    }
Esempio n. 11
0
    public void ClosePopupUI(UI_Popup popup)
    {
        if (_popupStack.Count == 0)
        {
            return;
        }
        if (_popupStack.Peek() != popup)
        {
            Debug.Log("Close Popup Failed!");
            return;
        }

        ClosePopupUI();
    }
Esempio n. 12
0
    public void ClosePopupUI()
    {
        //팝업이 하나도 노출되어 있지 않으면 실행
        if (_popupStack.Count == 0)
        {
            return;
        }


        UI_Popup popup = _popupStack.Pop();

        Managers.Resource.Destory(popup.gameObject);
        popup = null;
    }
Esempio n. 13
0
    //팝업이 다른 방법으로 닫혔을때.
    public bool ClosePopupUI(UI_Popup popup)
    {
        if (_popupStack.Count == 0)
        {
            return(false);
        }

        //가장 위에있는게 닫아주고 싶은 팝업이 아니라면.
        if (_popupStack.Peek() != popup)
        {
            Debug.Log("Close Popup Fail!");
            return(false);
        }

        ClosePopupUI();
        return(true);
    }
Esempio n. 14
0
    public void OnClick()
    {
        GameObject go    = UI_Tools.Instance.ShowUI(eUIType.PF_UI_POPUP);
        UI_Popup   popup = go.GetComponent <UI_Popup>();

        popup.Set(
            () =>
        {
            Debug.Log(INFO.NAME + " 입장");
            GameManager.Instance.SelectStage = int.Parse(INFO.KEY);
            // 여기에 맵 지웠다 다시 만드는 함수 실행.
            GameManager.Instance.ResetMap();
            UI_Tools.Instance.HideUI(eUIType.PF_UI_POPUP);
            UI_Tools.Instance.HideUI(eUIType.PF_UI_STAGE);
        },
            () =>
        {
            UI_Tools.Instance.HideUI(eUIType.PF_UI_POPUP);
        },
            "단계 선택",
            INFO.NAME + "에 입장 하시겠습니까?");
    }
Esempio n. 15
0
    public void ClosePopUp()
    {
        if (m_StackUI.Count == 0)
        {
            return;
        }

        UI_Popup popUp = m_StackUI.Pop();

        ResourceManager.Instance.DestroyObject(popUp.gameObject);

        if (m_StackUI.Count == 0)
        {
            m_currentLayerOrder = 0;
        }
        else
        {
            UI_Popup peekUI = m_StackUI.Peek();
            Canvas   canvas = Common.GetOrAddComponent <Canvas>(peekUI.gameObject);

            m_currentLayerOrder = canvas.sortingOrder;
        }
    }
Esempio n. 16
0
 private void Start()
 {
     popup = UI_Popup.Instance;
 }
Esempio n. 17
0
 void Start()
 {
     // there can be only one (0_0)
     CurrentInstance = this;
 }