Ejemplo n.º 1
0
    // 确认解锁
    public void OnUnlockConfirmBtn()
    {
        if (!IsEnough)
        {
            AddTip("当前积分余额不足!", 28);
            return;
        }

        var meInfo = GameCore.Instance.MeInfo;

        meInfo.Units[Type]      = true;
        meInfo.UUnlocks[Stage]  = true;
        meInfo.IntegrationCost += Need;

        UserManager.SyncUnits2Server();
        UserManager.SyncUUnlocks2Server();
        UserManager.SyncIntegrationCost2Server();

        AddTip(string.Format("解锁新单位{0}", UnitConfiguration.GetDefaultConfig(Type).DisplayName), 28);

        DUI.Refresh();
        MMUI.ShowUserInfo();

        ClearDescInfo();
        Hide();
    }
Ejemplo n.º 2
0
    public void OnClickAdsBtn()
    {
        if (!UnityAdsHelper.isSupported)
        {
            return;
        }
        if (!UnityAdsHelper.isInitialized)
        {
            return;
        }
        if (UnityAdsHelper.isShowing)
        {
            return;
        }

        UnityAdsHelper.ShowAd(null, () =>
        {
            GameCore.Instance.MeInfo.Integration += 1;
            UserManager.SyncIntegration2Server();

            AddTip("积分+1");
            MMUI.ShowUserInfo();
        });

        AdsBtn.gameObject.SetActive(false);
    }
Ejemplo n.º 3
0
    public void OnConfirmBtn()
    {
        var name = NameTxt.text;

        if (name.Contains(".") || name.Contains("&"))
        {
            AddTip("名称包含非法字符");
            return;
        }

        var meInfo = GameCore.Instance.MeInfo;

        meInfo.Name = name;
        UserManager.SyncName2Server();

        MMUI.ShowUserInfo();
        Hide();
    }
Ejemplo n.º 4
0
    private void OnValueChanged(GameObject go, bool isOn)
    {
        if (!isOn)
        {
            go.transform.Find("Mark").gameObject.SetActive(false);
            return;
        }
        else
        {
            go.transform.Find("Mark").gameObject.SetActive(true);

            // 修改头像
            var meInfo = GameCore.Instance.MeInfo;
            meInfo.CurAvator = go.name;

            // 同步服务器
            UserManager.SyncCurAvatar2Server();

            // 表现
            MMUI.ShowUserInfo();
        }
    }