Esempio n. 1
0
        public void OnDetailClick()
        {
            UMengPlugin.UMengEvent(EventId.VEGETABLE_EXPLAIN, new Dictionary <string, object> {
                { "code", _userVegetable.VegetableCode }, { "level", _userVegetable.CurrentLevel }
            });

            //这个复杂了,每个技能的介绍或许还不一样
            var vegetableIntroTextConfig =
                ConfigManager.GetConfig(ConfigManager.ConfigType.VegetableIntroTextConfig) as VegetableIntroTextConfig;

            if (vegetableIntroTextConfig == null)
            {
                Debug.LogError("没有VegetableIntroTextConfig");
                return;
            }
            var vegetableIntro =
                vegetableIntroTextConfig.IntroList.Find(x => x.VegetableCode == _userVegetable.VegetableCode);

            if (vegetableIntro == null)
            {
                Debug.LogError("没有vegetableIntro.Code:" + _userVegetable.VegetableCode);
                return;
            }
            MorlnTooltip.Show(vegetableIntro.IntroContent, MainRoot.InverseTransformPoint(VegetableArtContentContainer.position));
        }
Esempio n. 2
0
        public void ConfirmReinforce()
        {
            UMengPlugin.UMengEvent(EventId.ADD_TEAM,
                                   new Dictionary <string, object>
            {
                { "rand", _reinforce1 != null },
                { "frie", _reinforce2 != null }
            });

            GameData.Reinforce1         = _reinforce1;                                                      //应用选择的玩家
            GameData.Reinforce1Portrait = _reinforce1 == null ? null : FriendSlot1.TxrHeadIcon.mainTexture; //TODO:陌生人的头像怎么办
            GameData.Reinforce2         = _reinforce2;
            GameData.Reinforce2Portrait = _reinforce2 == null ? null : FriendSlot2.TxrHeadIcon.mainTexture;
            if (MatchUI.Instance)
            {
                MatchUI.Instance.DidAddFriend();
            }
            base.OnConfirmClick();

            var friendIdList = new List <string>();

            if (GameData.Reinforce1 != null)
            {
                friendIdList.Add(GameData.Reinforce1.UserId);
            }
            if (GameData.Reinforce2 != null)
            {
                friendIdList.Add(GameData.Reinforce2.UserId);
            }
            Requester.Instance.Send(new RequestStartChallenge(GameData.LastChallengeID)
            {
                FriendUserIdList = friendIdList
            });
        }
Esempio n. 3
0
        public override void Pay(UserSelectedTrade trade)
        {
            Debug.Log("开始支付宝支付。price:" + trade.Price);
            //var refill = CommonData.RefillList.Find(x => x.Name == re.Trade.PrepaymentName); //通过支付包名称找到支付包
            //if (refill == null)
            //{
            //    Toast.CreateErrorToast("无法找到对应的充值包,name:" + re.Trade.PrepaymentName);
            //    return;
            //}

            //if (!re.HasExtra || string.IsNullOrEmpty(re.Extra))
            //{
            //    LoadingMask.EndLoading();
            //    Toast.CreateErrorToast("解析订单数据失败!");
            //    Debug.LogError("没有找到extra数据。");
            //    return;
            //}


            try
            {
                // Android支付宝的参数为
                // {"notifyUrl":"支付宝插件中用到的NotifyUrl"};
                // 不再使用PayChannel.channel_url
                //var json = re.Extra;

                //var rootNode = JsonNode.FromJson(json);

                //const string key = "notifyUrl";
                //var value = "";
                //if (rootNode.SubNodeNames.Contains(key))
                //{
                //    value = rootNode[key].Value.ToString();
                //}
                //else
                //{
                //    Debug.LogWarning("没有找到" + key + "的内容。");
                //}

                var subject     = trade.DisplayName;
                var body        = trade.DisplayName;
                var price       = trade.Price.ToString("0.00");
                var outTradeNum = Guid.NewGuid().ToString();
                var notifyUrl   = ClientInfoHolder.Instance.AliNotifyUrl;

                PayTrades.Add(outTradeNum, trade);

                UMengPlugin.Event("alipay_pay_start", new Dictionary <string, object> {
                    { "price", trade.Price }
                });

                AlipayPlugin.Pay(subject, body, price, outTradeNum, notifyUrl);
            }
            catch (Exception e)
            {
                //LoadingMask.EndLoading();
                //Toast.CreateErrorToast("解析订单数据失败!");
                Debug.LogError("解析TradeNoResult中的extra失败:" + e.StackTrace);
            }
        }
Esempio n. 4
0
 protected override void Initialize()
 {
     base.Initialize();
     UMengPlugin.Event("pause_show", new Dictionary <string, object> {
         { "level", RoundData.Level }
     });
 }
Esempio n. 5
0
    protected override void Initialize()
    {
        base.Initialize();

        var level = -1;//(修改MainData大力丸条件时记得修改这里的距离下一个大力丸的信息)

        if (RoundData.Level <= 4 && !ForeverDataHolder.ForeverData.ChangshengwanEatenList[0])
        {
            level = 4;
        }
        else if (RoundData.Level <= 7 && !ForeverDataHolder.ForeverData.ChangshengwanEatenList[1])
        {
            level = 7;
        }
        else if (RoundData.Level <= 9 && !ForeverDataHolder.ForeverData.ChangshengwanEatenList[1])
        {
            level = 9;
        }
        LblTitle.text      = level > 0 ? string.Format("击败第{0}关BOSS可以使生命值上限永久+1", level) : null;
        LblReviveCost.text = "" + RoundData.NextRevivePrice;

        UMengPlugin.Event("revive_show", new Dictionary <string, object> {
            { "level", RoundData.Level }
        });
    }
Esempio n. 6
0
 public void OnBuyUnlockClick()
 {
     UMengPlugin.UMengEvent(EventId.BUY_CHARACTER, new Dictionary <string, object> {
         { "code", CurCharacterCode }
     });                                                                                                        //发送统计事件
     Requester.Instance.Send(new BuyCharacter(CurCharacterCode));
 }
Esempio n. 7
0
 public void FinishEditIuput()
 {
     UMengPlugin.UMengEvent(EventId.NICKNAME_EDIT,
                            new Dictionary <string, object> {
         { "name_length", IptNickname.text.Length }
     });
 }
Esempio n. 8
0
 public void OnChuzhanClick()
 {
     UMengPlugin.UMengEvent(EventId.USE_CHARACTER, new Dictionary <string, object> {
         { "code", CurCharacterCode }
     });                                                                                                            //发送统计事件
     Requester.Instance.Send(new ChangeCharacter(CurCharacterCode));
 }
Esempio n. 9
0
 public void OnSettingsClick()
 {
     SettingsPanel.Load();
     UMengPlugin.UMengEvent(EventId.HOME_SETTING, new Dictionary <string, object> {
         { "exp", CommonData.MyUser.Exp }
     });
 }
Esempio n. 10
0
 public void OnResumeClick()
 {
     Time.timeScale = 1f;
     UnloadInterface();
     UMengPlugin.Event("pause_resume", new Dictionary <string, object> {
         { "level", RoundData.Level }
     });
 }
Esempio n. 11
0
        public override void OnBuyClick()
        {
            UMengPlugin.UMengEvent(EventId.BUY_DIAMOND, new Dictionary <string, object> {
                { "name", _recharge.Name }
            });

            AlertDialog.Load("充值功能尚未开放");
        }
Esempio n. 12
0
        public void OnUpgradeClick()
        {
            UMengPlugin.UMengEvent(EventId.VEGETABLE_UPGRADE, new Dictionary <string, object> {
                { "code", _userVegetable.VegetableCode }, { "level", _userVegetable.CurrentLevel }
            });

            Requester.Instance.Send(new UpgradeVegetable(_userVegetable.VegetableCode));
        }
Esempio n. 13
0
 public void OnRestartClick()
 {
     Time.timeScale = 1f;
     GameManager.Instance.RestartGame();
     UnloadInterface();
     UMengPlugin.Event("pause_restart", new Dictionary <string, object> {
         { "level", RoundData.Level }
     });
 }
Esempio n. 14
0
        public void OnGardenClick()
        {
            UMengPlugin.UMengEvent(EventId.HOME_CAIYUAN,
                                   new Dictionary <string, object> {
                { "level", CommonData.MyUser.Level }
            });

            GardenPanel.Load();
        }
Esempio n. 15
0
        public void OnEquipmentClick()
        {
            UMengPlugin.UMengEvent(EventId.HOME_EQUIP,
                                   new Dictionary <string, object> {
                { "level", CommonData.MyUser.Level }
            });

            EquipPanel.Load();
        }
Esempio n. 16
0
        public void OnSkillClick()
        {
            UMengPlugin.UMengEvent(EventId.HOME_SKILL,
                                   new Dictionary <string, object> {
                { "level", CommonData.MyUser.Level }
            });

            ManageSkillPanel.Load();
        }
Esempio n. 17
0
 public void DisConnectToServer()
 {
     Debug.LogError("DisConnectToServer");
     UMengPlugin.UMengEvent(EventId.DIS_CONNECT_SERVER,
                            new Dictionary <string, object> {
         { "net", (int)Application.internetReachability }
     });
     AlertDialog.Load("网络已经断开,请重试", "确定", ReLogin);
 }
Esempio n. 18
0
    private void OnClick()
    {
        switch (ButtonType)
        {
        case ButtonTypeEnum.BuyHeart:

            UMengPlugin.UMengEvent(EventId.GOTO_HEART,
                                   new Dictionary <string, object>
            {
                { "from", MainRoot.Instance.CurrentViewStateName },
                { "heart", CommonData.HeartData.Count }
            });

            ShopPanel.Load();
            if (ShopPanel.Instance != null)
            {
                ShopPanel.Instance.RefreshToState(ShopPanel.ShopState.ExchangeHeart);
            }
            break;

        case ButtonTypeEnum.BuyCoin:

            UMengPlugin.UMengEvent(EventId.GOTO_COIN,
                                   new Dictionary <string, object>
            {
                { "from", MainRoot.Instance.CurrentViewStateName },
                { "coin", CommonData.MyUser.Money10 }
            });

            ShopPanel.Load();
            if (ShopPanel.Instance != null)
            {
                ShopPanel.Instance.RefreshToState(ShopPanel.ShopState.ExchangeMoney10);
            }
            break;

        case ButtonTypeEnum.BuyDiamond:

            UMengPlugin.UMengEvent(EventId.GOTO_DIAMOND,
                                   new Dictionary <string, object>
            {
                { "from", MainRoot.Instance.CurrentViewStateName },
                { "diamond", CommonData.MyUser.Money1 }
            });

            ShopPanel.Load();
            if (ShopPanel.Instance != null)
            {
                ShopPanel.Instance.RefreshToState(ShopPanel.ShopState.Recharge);
            }
            break;

        default:
            Debug.LogError("超出范围", this);
            break;
        }
    }
Esempio n. 19
0
    public void PaySuccess(AlipayPlugin.Trade trade)
    {
        UserSelectedTrade selectTrade;

        if (AlipayPayStrategy.PayTrades.ContainsKey(trade.OutTradeNo))
        {
            selectTrade = AlipayPayStrategy.PayTrades[trade.OutTradeNo];
            AlipayPayStrategy.PayTrades.Remove(trade.OutTradeNo);
        }
        else
        {
            selectTrade = null;
        }
        if (selectTrade != null)
        {
            //TODO:查询充值目的,比如复活、充金币等
            if (selectTrade.Name == "revive") //以复活为目的
            {
                if (RevivePanel.Instance)
                {
                    RevivePanel.Instance.OnRevivePayOk();
                }
            }
        }
        else
        {
            //估计是上一次充值后程序挂了,那我也不知道玩家的目的,就只能折算成金币了。
        }
        int paychannel;

        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            paychannel = PayChannelHelper.CHANNEL_ANDROID_ALIPAY;
            break;

        case RuntimePlatform.IPhonePlayer:
            paychannel = PayChannelHelper.CHANNEL_IOS_ALIPAY;
            break;

        default:
            paychannel = PayChannelHelper.CHANNEL_WEB_ALIPAY;
            break;
        }
        float price;

        float.TryParse(trade.TotalFee, out price);
        UMengPlugin.Event("alipay_pay_success",
                          new Dictionary <string, object>
        {
            //{"name", selectTrade != null ? selectTrade.Name : "(noname)"},
            //{"paychannel", paychannel},
            { "price", price },
        });
        UMengPlugin.Pay(price, "revive", 1, price, 2);//如果不是支付宝,记得修改
    }
Esempio n. 20
0
 public void OnMailBoxClick()
 {
     MailBoxPanel.Load();
     UMengPlugin.UMengEvent(EventId.HOME_MAIL,
                            new Dictionary <string, object>
     {
         { "all", CommonData.MailList.Count },
         { "unread", CommonData.MailList.Count(x => !x.IsRead) }
     });
 }
Esempio n. 21
0
        public void OnShopClick()
        {
            UMengPlugin.UMengEvent(EventId.HOME_SHOP, null);

            ShopPanel.Load();
            if (ShopPanel.Instance != null)
            {
                ShopPanel.Instance.RefreshToState(ShopPanel.ShopState.Recharge);
            }
        }
Esempio n. 22
0
        public override void OnBuyClick()
        {
            UMengPlugin.UMengEvent(
                (CurrencyType)_exchange.ToType == CurrencyType.Coin ? EventId.BUY_COIN : EventId.BUY_HEART,
                new Dictionary <string, object> {
                { "name", _exchange.Name }
            });

            Requester.Instance.Send(new RequestExchange(_exchange.Name, 1));
        }
Esempio n. 23
0
        public void OnRealTimeFightingClick()
        {
            CommonData.RivalUser     = null;
            GameData.LastChallengeID = null;
            Requester.Instance.Send(new NewMatch());//发送消息
            MainRoot.Goto(MainRoot.UIStateName.Match);
            MatchUI.Instance.RefreshBeforeMatch();

            UMengPlugin.UMengEvent(EventId.HOME_MULTI, null);
        }
Esempio n. 24
0
 public void OnReturnToEntranceClick()
 {
     Time.timeScale = 1f;
     GameManager.Instance.Clear();
     //MainRoot.Goto(MainRoot.UIStateName.Entrance);
     UnloadInterface();
     UMengPlugin.Event("pause_quit", new Dictionary <string, object> {
         { "level", RoundData.Level }
     });
 }
Esempio n. 25
0
        /// <summary>
        /// 可利用ButtonMessage脚本向此组件发送OnDescriptionClick事件,通知上层显示大关描述
        /// </summary>
        public void OnDescriptionClick()
        {
            UMengPlugin.UMengEvent(EventId.PUSHLEVEL_CLICK_ME,
                                   new Dictionary <string, object> {
                { "major", Island.MajorLevelId }
            });

            if (Island)
            {
                Island.ShowDescription();
            }
        }
Esempio n. 26
0
        public void Prompt()
        {
            UMengPlugin.UMengEvent(EventId.VEGETABLE_ACCELERATE, new Dictionary <string, object> {
                { "code", _userVegetable.VegetableCode }, { "level", _userVegetable.CurrentLevel }
            });

            if (_userVegetable != null)
            {
                AlertDialog.Load("确定使用" + new Currency(1, 1).GetCurrencyLabelWithIcon() + "立即完成培育吗", "确认",
                                 () => Requester.Instance.Send(
                                     new SpeedUpVegetableUpgrade(_userVegetable.VegetableCode)), "不了", null,
                                 true);
            }
        }
Esempio n. 27
0
 public void GotoPreviousCharacter()
 {
     UMengPlugin.UMengEvent(EventId.SWITCH_CHARACTER_VIEW,
                            new Dictionary <string, object> {
         { "from_ind", _index }, { "to_ind", (_index - 1) }
     });                                                                                                   //发送统计事件
     if (_index <= 0)
     {
         BtnLeft.SetActive(false);
         return;
     }
     _index--;
     UpperSetAndRefresh(_index);
 }
Esempio n. 28
0
 public void GotoNextCharacter()
 {
     UMengPlugin.UMengEvent(EventId.SWITCH_CHARACTER_VIEW,
                            new Dictionary <string, object> {
         { "from_ind", _index }, { "to_ind", (_index + 1) }
     });                                                                                                         //发送统计事件
     if (_index >= _characterList.Count - 1)
     {
         BtnRight.SetActive(false);
         return;
     }
     _index++;
     UpperSetAndRefresh(_index);
 }
Esempio n. 29
0
    public override void OnConfirmClick()
    {
        //放弃复活

        GameManager.Instance.Clear();
        //MainRoot.Goto(MainRoot.UIStateName.EndRound);
        //if (EndRoundUI.Instance)
        //    EndRoundUI.Instance.Refresh();
        base.OnConfirmClick();

        UMengPlugin.Event("revive_close", new Dictionary <string, object> {
            { "level", RoundData.Level }
        });
    }
Esempio n. 30
0
        void OnDoubleClick()
        {
            UMengPlugin.UMengEvent(!_worn ? EventId.EQUIP_WEAR : EventId.EQUIP_UNWEAR, new Dictionary <string, object> {
                { "code", _equip.EquipCode }
            });                                                                                                                                         //发送统计事件

            var userCharacter = CommonData.MyCharacterList.Find(x => x.CharacterCode == EquipPanel.CurCharacterCode);

            if (userCharacter != null)
            {
                var worn = userCharacter.WearEquipList.Exists(x => x == _equip.EquipCode);
                Requester.Instance.Send(new UseEquip(EquipPanel.CurCharacterCode, _equip.EquipCode, !worn));
            }
            MorlnTooltip.ForceHide();//竟然会触发两次OnClick,可以理解
        }