Exemple #1
0
    public void OnBackBtnClick(Util.NoneParamCallBack callBack)
    {
        switch (curPage)
        {
        case -1:
            gameObject.SetActive(false);
            GameController.manager.accountMan.UpdateAccount(GameController.manager.accountMan.selfInfo);
            callBack?.Invoke();
            break;

        case 0:
            SetPageIdx(-1);
            break;

        case 1:
            if (nameInput.text.Trim().Length == 0)
            {
                GameController.manager.infoAlert.ShowWithText("请输入昵称", null);
                return;
            }
            GameController.manager.accountMan.selfInfo.name = nameInput.text.Trim();
            shouldUpdate = true;
            SetPageIdx(-1);
            break;

        case 2:
            shouldUpdate = true;
            SetPageIdx(-1);
            break;

        case 3:
            if (yearInput.text.Trim().Length == 0 || monthInput.text.Trim().Length == 0 || dayInput.text.Trim().Length == 0)
            {
                GameController.manager.infoAlert.ShowWithText("请完善数据", null);
                return;
            }
            GameController.manager.accountMan.selfInfo.birthday = yearInput.text.Trim() + "-" + monthInput.text.Trim() + "-" + dayInput.text.Trim();
            shouldUpdate = true;
            SetPageIdx(-1);
            break;

        case 4:
            shouldUpdate = true;
            SetPageIdx(-1);
            break;

        default:
            break;
        }
    }
Exemple #2
0
 public void SetContent(int idx, Util.NoneParamCallBack c)
 {
     avatarIdx  = idx;
     img.sprite = Resources.Load <Sprite>("Avatar/avatar" + avatarIdx);
     callBack   = c;
 }
Exemple #3
0
 public void ShowWithText(string t, Util.NoneParamCallBack _callBack = null)
 {
     callBack      = _callBack;
     showText.text = t;
     gameObject.SetActive(true);
 }