Esempio n. 1
0
 private void GetTasteCardCallBack(UseVipExperienceRes res)
 {
     FlowText.ShowMessage(I18NManager.Get("Activity_UseVipCardSuccess"));
     GlobalData.PropModel.UpdateProps(new [] { res.UserItem });
     GlobalData.PlayerModel.PlayerVo.UserMonthCard = res.UserMonthCard;
 }
Esempio n. 2
0
 void OnDestroy()
 {
     print("OnDestroy");
     I18NManager.getInstance().deleteObserver(this);
 }
    public SevenSigninTemplateAwardVo(ActivityOptionalAwardRulePB pB)
    {
        ActivityId = GlobalData.ActivityModel.GetActivityVo(ActivityType.ActivitySevenDaySigninTemplate).ActivityId;
        DayId      = pB.Id;
        IsSelect   = pB.IsSelect;

        if (IsSelect == 0)
        {
            AddAwards(pB.FixedAward.ToList());
        }
        else if (IsSelect == 1)
        {
            AddAwards(pB.OptionalAward.ToList());
        }

        if (Rewards.Count == 0)
        {
            IsGiftbag   = true;
            IconPath    = "Prop/GiftPack/tongyong6";
            GiftbagName = I18NManager.Get("Common_GiftBag");
        }
        else if (Rewards.Count > 1)
        {
            IsGiftbag = true;
            var award = Rewards[0];
            if (award.Resource == ResourcePB.Item)
            {
                var prop = GlobalData.PropModel.GetPropBase(award.Id);
                if (prop != null)
                {
                    if (prop.ExpType == 8)
                    {
                        IconPath    = "Prop/GiftPack/dali";
                        GiftbagName = I18NManager.Get("Common_StarUpGiftBag");
                    }
                }
                else
                {
                    IconPath    = "Prop/GiftPack/tongyong6";
                    GiftbagName = I18NManager.Get("Common_GiftBag");
                }
            }
            else if (award.Resource == ResourcePB.Power)
            {
                IconPath    = "Prop/GiftPack/dati";
                GiftbagName = I18NManager.Get("Common_VitalityGiftBag");
            }
            else if (award.Resource == ResourcePB.Memories)
            {
                IconPath    = "Prop/GiftPack/tongyong2";
                GiftbagName = I18NManager.Get("Common_MemoriesGiftBag");
            }
            else if (award.Resource == ResourcePB.Gem)
            {
                IconPath    = "Prop/GiftPack/tongyong2";
                GiftbagName = I18NManager.Get("Common_GemGiftBag");
            }
        }
        else if (Rewards.Count == 1)
        {
            IsCardAward = Rewards[0].Resource == ResourcePB.Card;
            IsPuzzle    = Rewards[0].Resource == ResourcePB.Puzzle;
            IconPath    = Rewards[0].IconPath;
        }

        IsShowGetBtn  = false;
        IsShowGetMask = false;
        SetLastIconData();
    }
Esempio n. 4
0
        public void SetData(UserMissionVo vo, MissionRulePB missionPb)
        {
            _userMissionVo  = vo;
            _missionPb      = missionPb;              //missionModel.GetMissionById(vo.MissionId);
            _titleName.text = _missionPb.MissionName; //任务描述
//            _activityTime.text ="X"+missionPb.Award.Num.ToString();//这个应该是活力字段获取应该错误了。
//            _activity.text = _missionPb.Weight.ToString();

//            Debug.LogError(_missionPb.MissionDesc);
            _taskBtn.onClick.RemoveAllListeners();
            switch (vo.Status)
            {
            case    MissionStatusPB.StatusUnfinished:
                //未完成的状态
                _taskState.text = I18NManager.Get("Common_Goto");
                _taskBtn.onClick.AddListener(JumpToOnClick);
                _task.sprite = AssetManager.Instance.GetSpriteAtlas("UIAtlas_Task_gotoBottom");
                _taskBtn.gameObject.Show();
                _finished.Hide();
                break;

            case    MissionStatusPB.StatusUnclaimed:
                //未领取
                _taskState.text = I18NManager.Get("Common_GetReward");
                _taskBtn.onClick.AddListener(ReceiveGifts);
                _task.sprite = AssetManager.Instance.GetSpriteAtlas("UIAtlas_Task_receiveBottom");
                _taskBtn.gameObject.Show();
                _finished.Hide();
                break;

            case    MissionStatusPB.StatusBeRewardedWith:
                //已完成
                _taskBtn.gameObject.Hide();
                _finished.Show();
                break;
            }

            //Debug.LogError(missionPb.Award.Count);
            for (int i = 0; i < _missionPb.Award.Count; i++)
            {
//                Debug.LogError(_missionPb.MissionType+" "+_missionPb.Award[i]);
                RewardVo rewardVo = new RewardVo(_missionPb.Award[i]);
                if (rewardVo.Resource == ResourcePB.Gold)
                {
                    _reward.text       = _missionPb.Award[i].Num.ToString();
                    _rewardName.text   = rewardVo.Name;
                    _rewardimg.texture = ResourceManager.Load <Texture>(rewardVo.IconPath);
                }
                else
                {
                    _reward.text       = _missionPb.Award[i].Num.ToString();
                    _rewardName.text   = rewardVo.Name;
                    _rewardimg.texture = ResourceManager.Load <Texture>(rewardVo.IconPath);
                }

                //          Debug.LogError("?"+rewardVo.IconPath);
                _resourcePb = rewardVo.Resource;
                switch (rewardVo.Resource)
                {
                case ResourcePB.Power:
                    _resouceid = 20001;
                    break;

                case ResourcePB.Gem:
                    _resouceid = 30001;
                    break;

                case ResourcePB.Gold:
                    _resouceid = 10001;
                    break;

                default:
                    _resouceid = _missionPb.Award[i].ResourceId;
                    break;
                }
            }

            _desc.text                = _missionPb.MissionDesc;
            _progressText.text        = (vo.Progress > vo.Finish?vo.Finish:vo.Progress) + "/" + vo.Finish;
            _taskProgressBar.DeltaX   = 0;
            _taskProgressBar.Progress = (int)((float)vo.Progress / vo.Finish * 100);

            //根据Vo的状态来修改按钮的显示。
        }
Esempio n. 5
0
        public static string GetTimeFormat3(long time)
        {
            string result = "";
            int    t = Convert.ToInt32(time / 1000); //转换为秒
            int    day, hour, minute, second;
            string dayStr    = I18NManager.Get("Common_Hint7");
            string hourStr   = ":";
            string minuteStr = ":";
            string secondStr = "";

            if (t >= 86400) //天,
            {
                day    = Convert.ToInt32(t / 86400);
                hour   = Convert.ToInt32((t % 86400) / 3600);
                minute = Convert.ToInt32((t % 86400 % 3600) / 60);
                second = Convert.ToInt32(t % 86400 % 3600 % 60);
                result = day + dayStr + (hour > 0 ? hour + hourStr + minute + minuteStr + second : "");
            }
            else if (t >= 3600) //时,
            {
                hour   = Convert.ToInt32(t / 3600);
                minute = Convert.ToInt32((t % 3600) / 60);
                second = Convert.ToInt32(t % 3600 % 60);
                result = hour + hourStr
                         + (minute > 0 ? minute + minuteStr : "") + second;
            }
            else if (t >= 60) //分
            {
                minute = Convert.ToInt32(t / 60);
                second = Convert.ToInt32(t % 60);
                string seStr;
                if (second < 10)
                {
                    seStr = "0" + second.ToString();
                }
                else
                {
                    seStr = second.ToString();
                }

                result = minute + minuteStr
                         + (second > 0 ? seStr + secondStr : "");
            }
            else
            {
                second = Convert.ToInt32(t);
                string seStr;
                if (second < 10)
                {
                    seStr = "0" + second.ToString();
                }
                else
                {
                    seStr = second.ToString();
                }

                result = "00" + minuteStr + seStr + secondStr;
            }

            return(result);
        }
Esempio n. 6
0
 private void SetTitle()
 {
     _title.text = I18NManager.Get("ActivityMusicTemplate_storyTittle");
     _tips.text  = I18NManager.Get("ActivityMusicTemplate_storyTips", I18NManager.Get("ActivityMusicTemplate_storyName1"));
 }
        public void Init(LevelVo vo, RepeatedField <LevelBuyRulePB> levelBuyRules)
        {
            _levelVo       = vo;
            _levelBuyRules = levelBuyRules;

            transform.Find("DescBg/IntroductionTxt").GetComponent <Text>().text = vo.LevelDescription;
            // transform.Find("ScoreTxt").GetComponent<Text>().text = "应援热度:" + vo.Score;
            transform.Find("ScoreTxt").GetComponent <Text>().text =
                I18NManager.Get("MainLine_BattleIntroductionPopupScore", vo.Score);
            transform.Find("Title/Text").GetComponent <Text>().text = vo.LevelName;

            Text powerUseTxt = transform.Find("PowerUse/PowerUseTxt").GetComponent <Text>();

            //  powerUseTxt.text = "消耗体力:" + vo.CostEnergy;
            powerUseTxt.text = I18NManager.Get("MainLine_BattleIntroductionPopupPower", vo.CostEnergy);

            Image star1 = transform.Find("StarContainer/Star1").GetComponent <Image>();
            Image star2 = transform.Find("StarContainer/Star2").GetComponent <Image>();
            Image star3 = transform.Find("StarContainer/Star3").GetComponent <Image>();

            Color lightColor = Color.white;
            Color grayColor  = new Color(160 / 255.0f, 160 / 255.0f, 160 / 255.0f);

            _playOnceBtn.gameObject.SetActive(false);
            _playTimesBtn.gameObject.SetActive(false);
            _tipImage.gameObject.Hide();

            if (vo.CurrentStar == 0)
            {
//                _tipImage.gameObject.Show();

                star1.color = grayColor;
                star2.color = grayColor;
                star3.color = grayColor;
            }
            else if (vo.CurrentStar == 1)
            {
                star1.color = lightColor;
                star2.color = grayColor;
                star3.color = grayColor;
            }
            else if (vo.CurrentStar == 2)
            {
                star1.color = lightColor;
                star2.color = lightColor;
                star3.color = grayColor;
                _tipImage.gameObject.Hide();
                _playOnceBtn.gameObject.SetActive(true);
                _playTimesBtn.gameObject.SetActive(true);
            }
            else
            {
                _playOnceBtn.gameObject.SetActive(true);
                _playTimesBtn.gameObject.SetActive(true);
                _tipImage.gameObject.Hide();
            }


            HandleDrops();
            SetChanllangeTimes();
        }
Esempio n. 8
0
    public void SetData(WeiboVo data)
    {
        _data = data;
        // _blogName.text = _data.Blogger;
        if (_data.WeiboRuleInfo.weiboSceneInfo.NpcId < 5)
        {
            _blogName.text = PhoneData.GetNpcNameById(_data.WeiboRuleInfo.weiboSceneInfo.NpcId);
        }
        else
        {
            _blogName.text = _data.WeiboRuleInfo.weiboSceneInfo.NpcName;
        }

        _ContentTxt.text = _data.WeiboRuleInfo.weiboSceneInfo.TitleContent;

        string dateStr        = "";
        long   hasPassedStamp = ClientTimer.Instance.GetCurrentTimeStamp() - data.CreateTime;

        if (hasPassedStamp < 0)
        {
            dateStr = I18NManager.Get("Phone_Tips1");
        }
        else if (hasPassedStamp < 1000 * 60 * 60 * 24)
        {
            // long s = (smsVo.CreateTime / 1000) % 60;
            long m = (data.CreateTime / (60 * 1000)) % 60;
            long h = (data.CreateTime / (60 * 60 * 1000) + 8) % 24;
            // dateStr = string.Format("{0:D2}:{1:D2}:{2:D2}", h, m, s);
            dateStr = string.Format("{0:D2}:{1:D2}", h, m);
        }
        else
        {
            dateStr = I18NManager.Get("Phone_Tips2");
        }
        _lastTimeTxt.text = dateStr;

        string bgId = _data.WeiboRuleInfo.weiboSceneInfo.BackgroundId;

        if (bgId == "0" || bgId == "")
        {
            _bgImg.transform.parent.gameObject.Hide();
        }
        else
        {
            _bgImg.texture = ResourceManager.Load <Texture>("Phone/WeiboBackGround/" + bgId, ModuleConfig.MODULE_PHONE);
            //  _bgImg.SetNativeSize();
            _bgImg.transform.parent.gameObject.Show();
        }

        string headPath = WeiboVo.GetHeadPath(_data.WeiboRuleInfo.weiboSceneInfo.NpcId);

        transform.Find("Title/HeadMask/HeadIcon").GetComponent <RawImage>().texture = ResourceManager.Load <Texture>(headPath, ModuleConfig.MODULE_PHONE);

        transform.Find("Bottom/ShareNumTxt").GetComponent <Text>().text   = _data.WeiboRuleInfo.weiboSceneInfo.ReadNum;
        transform.Find("Bottom/CommentNumTxt").GetComponent <Text>().text = _data.WeiboRuleInfo.weiboSceneInfo.ConmentNum;
        int LikeNum = int.Parse(_data.WeiboRuleInfo.weiboSceneInfo.LikeNum);
        int likes   = _data.IsLike ? LikeNum + 1 : LikeNum;

        transform.Find("Bottom/LikeNumTxt").GetComponent <Text>().text = likes.ToString();
        _likeBtn.interactable = !_data.IsLike;
    }
Esempio n. 9
0
    public void SetData(AirborneGameRunningItemVo vo)
    {
        Debug.Log(vo.ResourceId + " " + vo.Count + " " + vo.Resource);
        //transform.Find("ItemImg").GetComponent<Image>();
        //transform.Find("ItemNumTxt").GetComponent<Text>().text="X " + awardPB.Num;

        string path = "";
        string name = "";

        if (vo.Resource == ResourcePB.Item)
        {
            name = GlobalData.PropModel.GetPropBase(vo.ResourceId).Name;
        }
        else
        {
            name = ViewUtil.ResourceToString(vo.Resource);
        }

        if (vo.Resource == ResourcePB.Gold)
        {
            //  vo.OwnedNum = (int)GlobalData.PlayerModel.PlayerVo.Gold;
            path = "Prop/particular/" + PropConst.GoldIconId;
        }
        else if (vo.Resource == ResourcePB.Gem)
        {
            path = "Prop/particular/" + PropConst.GemIconId;
        }
        else if (vo.Resource == ResourcePB.Power)
        {
            path = "Prop/particular/" + PropConst.PowerIconId;
        }
        else if (vo.Resource == ResourcePB.Card)
        {
            path = "Head/" + vo.ResourceId;

            CardPB pb = GlobalData.CardModel.GetCardBase(vo.ResourceId);
            name = CardVo.SpliceCardName(pb.CardName, pb.Player);
        }
        else if (vo.Resource == ResourcePB.Memories)
        {
            path = "Prop/particular/123456789";
        }
        else
        {
            path = "Prop/" + vo.ResourceId;
        }
        _propImage   = transform.Find("PropImage").GetComponent <RawImage>();
        _propNameTxt = transform.Find("PropNameTxt").GetComponent <Text>();
        _ownTxt      = transform.Find("ObtainText").GetComponent <Text>();



        _propImage.texture = ResourceManager.Load <Texture>(path);
        _propNameTxt.text  = name;
        _ownTxt.text       = I18NManager.Get("GameMain_ActivityAwardItemObtainText", vo.Count);
        // _propImage.SetNativeSize();


        if (vo.Resource != ResourcePB.Card)
        {
            GameObject clickObj = transform.Find("ItemBg").gameObject;
            clickObj.transform.GetComponent <Image>().raycastTarget = true;
            PointerClickListener.Get(clickObj).onClick = go => { FlowText.ShowMessage(ClientData.GetItemDescById(vo.ResourceId, vo.Resource).ItemDesc); };
        }
    }
Esempio n. 10
0
    public static void JumpTo(string jumpTarget, Action callBack = null, PlayerPB pb = PlayerPB.None)
    {
        //Debug.LogError("跳转字段===>"+jumpTarget);

        if (jumpTarget.Contains("music"))
        {
            callBack?.Invoke();
            return;
        }

        if (jumpTarget.Contains("Activity") && jumpTarget != "SupporterActivity")
        {
            //int activityId = int.Parse(jumpTarget.Replace("Activity", null));
            ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITY, false, false, jumpTarget);
            callBack?.Invoke();
            return;
        }

        switch (jumpTarget)
        {
        case "BuyEnergy":
        case "BuyGold":
        case "BuyEncouragePower":
            OnJumpToBuyWindow(jumpTarget);
            break;

        case "SupporterActivity":
            var openLevel = GuideManager.GetOpenUserLevel(ModulePB.EncourageAct, FunctionIDPB.EncourageActEntry);
            if (GlobalData.PlayerModel.PlayerVo.Level < openLevel)
            {
                FlowText.ShowMessage(I18NManager.Get("Task_Levellimit", openLevel));
                return;
            }
            ModuleManager.Instance.EnterModule(jumpTarget, false, true);
            break;

        case "GameMain":
            ModuleManager.Instance.DestroyAllModuleBackToCommon();
            break;

        case "CardResolve":
            ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_CARD, false, false, jumpTarget);
            break;

        case "DrawCard_Gold":
            ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_DRAWCARD, false, false, jumpTarget);
            break;

        case "DrawCard_Gem":
            ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_DRAWCARD);
            break;

        case "SendGift":
            var    openmainline = GlobalData.LevelModel.FindLevel("1-9").IsPass;
            string levelmark    = GuideManager.GetOpenMainStory(ModulePB.Favorability, FunctionIDPB.FavorabilityGifts);
            if (!openmainline)
            {
                FlowText.ShowMessage(I18NManager.Get("Guide_Battle6", levelmark));
                return;
            }
            ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_FAVORABILITYMAIN, false, false, jumpTarget, pb);
            break;

//			case "FavorabilityPhoneEvent":
//				ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_FAVORABILITYMAIN,false,false,jumpTarget,pb);
//				break;
        case "Reloading":
            GlobalData.FavorabilityMainModel.CurrentRoleVo = GlobalData.FavorabilityMainModel.GetUserFavorabilityVo((int)pb);
            ModuleManager.Instance.EnterModule(jumpTarget, false, true);
            break;

        case "Recollection":
            openLevel = GuideManager.GetOpenUserLevel(ModulePB.CardMemories, FunctionIDPB.CardMemoriesEntry);
            if (GlobalData.PlayerModel.PlayerVo.Level < openLevel)
            {
                FlowText.ShowMessage(I18NManager.Get("Task_Levellimit", openLevel));
                return;
            }
            ModuleManager.Instance.EnterModule(jumpTarget, false, true);
            break;

        case ModuleConfig.MODULE_VISIT:
            openLevel = GuideManager.GetOpenUserLevel(ModulePB.Visiting, FunctionIDPB.VisitingEntry);
            if (GlobalData.PlayerModel.PlayerVo.Level < openLevel)
            {
                FlowText.ShowMessage(I18NManager.Get("Task_Levellimit", openLevel));
                return;
            }
            ModuleManager.Instance.EnterModule(jumpTarget, false, true);
            break;

        case "Shop":
            ModuleManager.Instance.EnterModule(jumpTarget, false, true);
            break;

        case "Shopping":
            ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_GAME_PLAY, false, true, "Shopping");
            break;

        default:
            ModuleManager.Instance.EnterModule(jumpTarget, false, true);
            break;
        }

        callBack?.Invoke();
    }
Esempio n. 11
0
 private ViewModelDescriptor(I18NManager i18NManager, Type type)
 {
     _i18NManager = i18NManager;
     _type        = type;
 }
Esempio n. 12
0
 private void OnClickLockBtn()
 {
     FlowText.ShowMessage(I18NManager.Get("ActivityMusicTemplate_MusicTaskNoPassTitle"));
 }
Esempio n. 13
0
    private void ConnetToServer()
    {
        //版本控制逻辑
        GameServerReq req = new GameServerReq();

        req.Version     = AppConfig.Instance.version;
        req.Game        = AppConfig.Instance.gameType;
        req.Channel     = AppConfig.Instance.channel;
        req.ChannelInfo = AppConfig.Instance.channelInfo;

        req.Language     = AppConfig.Instance.language;
        req.GameProperty = AppConfig.Instance.gameProperty; //现在测试阶段我在game_config文件里写死的是1。

        req.Idfa = GalaSDKBaseFunction.GetDeviceId();

        Debug.Log("DeviceId=> " + req.Idfa);

        var dataBytes = NetWorkManager.GetByteData(req);

        HttpMessage <GameServerRes> http = NetWorkManager.Instance.Send <GameServerRes>(CMD.GAMESERVERC_GAMESERVER,
                                                                                        dataBytes, res =>
        {
            GlobalData.VersionData.ForceUpdateAddr = res.MainVersion.Addr;
            _gameServerRes   = res;
            StringBuilder sb = new StringBuilder("<color='#007891'>缓存版本号:</color>\n");
            //初始化缓存数据版本号
            foreach (var v in res.CacheVersion)
            {
                sb.AppendLine("Context:" + v.Context + "  Version:" + v.Version);

                if (GlobalData.VersionData.VersionDic.ContainsKey(v.Context))
                {
                    GlobalData.VersionData.VersionDic[v.Context] = v.Version.ToString();
                }
            }
            Debug.Log(sb.ToString());

            if (res.SwitchControl == null)
            {
                res.SwitchControl = new SwitchControlPB();
            }

            AppConfig.Instance.SwitchControl = new SwitchControlData();
            AppConfig.Instance.SwitchControl.Init(res.SwitchControl);

            SdkHelper.InitAccount();

            if (res.ImgServerInfo != null)
            {
                AppConfig.Instance.assetsServer = res.ImgServerInfo.Addr + ":" + res.ImgServerInfo.Port + "/" +
                                                  res.ImgServerInfo.Folder;
            }

            //获取公告信息
            GlobalData.NoticeData.InitData(res.Notice);

            var serverInfoPb = NetWorkManager.Instance.SetServerDatas(res.GameServerInfo);
            AppConfig.Instance.logicServer = "http://" + serverInfoPb.Addr + ":" + serverInfoPb.Port + "/";

            NetWorkManager.Instance.SetServer(AppConfig.Instance.logicServer);

            AppConfig.Instance.serverId   = serverInfoPb.ServerId;
            AppConfig.Instance.serverName = serverInfoPb.Name;

            //foreach (var serverInfoPb in res.GameServerInfo)
            //{
            //    AppConfig.Instance.logicServer = "http://" + serverInfoPb.Addr + ":" + serverInfoPb.Port + "/";

            //    NetWorkManager.Instance.SetServer(AppConfig.Instance.logicServer);

            //    AppConfig.Instance.serverId = serverInfoPb.ServerId;
            //    AppConfig.Instance.serverName = serverInfoPb.Name;
            //    break;
            //}
            EventDispatcher.TriggerEvent(Common.EventConst.OnConnetToServer);

            if (AppConfig.Instance.version < _gameServerRes.MainVersion.MinVersion)
            {
                View.SetText("");
                GlobalData.VersionData.ForceUpdateAddr = _gameServerRes.MainVersion.Addr;
                SendMessage(new Message(MessageConst.CMD_UPDATE_SHOW_FORCE_UPDATE, Message.MessageReciverType.DEFAULT,
                                        _gameServerRes.MainVersion.Addr));
                return;
            }

            if (DownloadAppStart() == false)
            {
                HandleVersion();
            }
        },
                                                                                        httpError =>
        {
            View.SetText(I18NManager.Get("Update_Hint1"));
            FlowText.ShowMessage(I18NManager.Get("Update_Hint1"));
        }, false, "", false, AppConfig.Instance.versionServer);

        http.AutoRetry = true;
    }
Esempio n. 14
0
    public void SetData(EveryDayPowerVO vO)
    {
        _num.text = vO.Awards[0].Num.ToString();


        switch (vO.State)
        {
        case EveryDaySignState.Retroactive:

            SetState(_retroactive.gameObject.name);
            _des.text = I18NManager.Get("Activity_Retroactive", vO.Gem);
            _gem.SetActive(true);

            IsShowBigIcon(false);

            PointerClickListener.Get(_retroactive.gameObject).onClick = go =>
            {
                EventDispatcher.TriggerEvent <EveryDayPowerVO>(EventConst.OpenEverydayPowerAwardRetroactiveWindow, vO);
            };

            break;

        case EveryDaySignState.AlreadyGet:

            SetState(_alreadyGet.gameObject.name);
            _gem.SetActive(false);
            _des.text = I18NManager.Get("Activity_EverydayPowerAlreadyGet");

            var small = _icon.GetChild(1).GetComponent <Image>();
            var color = small.color;
            color       = new Color(1, 1, 1, color.a);
            color       = new Color(color.r * 0.435f, color.g * 0.376f, color.b * 0.376f, color.a);
            small.color = color;

            transform.Find("Top/NumBg").gameObject.SetActive(false);

            IsShowBigIcon(false);
            break;

        case EveryDaySignState.NotGet:
            _icon.GetChild(1).GetComponent <Image>().color = new Color(1, 1, 1);

            IsShowBigIcon(false);
            SetState(_noGet.gameObject.name);
            _gem.SetActive(false);
            _des.text = I18NManager.Get("Activity_EverydayPowerTime", vO.StarTime, vO.EndTime);
            PointerClickListener.Get(_noGet.gameObject).onClick = go =>
            {
                FlowText.ShowMessage(I18NManager.Get("Activity_NoTimeTo"));    //"还没有到时间哦"
            };
            break;

        case EveryDaySignState.CurMayGet:


            IsShowBigIcon(true);
            _gem.SetActive(false);
            SetState(_curMayGet.gameObject.name);
            _des.text = I18NManager.Get("Activity_EverydayPowerTime", vO.StarTime, vO.EndTime);
            PointerClickListener.Get(_curMayGet.gameObject).onClick = go =>
            {
                EventDispatcher.TriggerEvent <EveryDayPowerVO>(EventConst.GetEverydayPowerAward, vO);
            };
            break;
        }
    }
Esempio n. 15
0
    void Start()
    {
        string playerProfilesCsv = SceneData.SelectedPlayerProfiles.Select(it => it.Name).ToCsv();

        Debug.Log($"{playerProfilesCsv} start (or continue) singing of {SongMeta.Title} at {SceneData.PositionInSongInMillis} ms.");

        // Prepare columns and rows for player UI
        PlayerUiArea.SetupPlayerUiGrid(SceneData.SelectedPlayerProfiles.Count, playerUiArea.GetComponent <GridLayoutGroupCellSizer>());

        // Handle players
        List <PlayerProfile> playerProfilesWithoutMic = new List <PlayerProfile>();

        foreach (PlayerProfile playerProfile in SceneData.SelectedPlayerProfiles)
        {
            SceneData.PlayerProfileToMicProfileMap.TryGetValue(playerProfile, out MicProfile micProfile);
            if (micProfile == null)
            {
                playerProfilesWithoutMic.Add(playerProfile);
            }
            PlayerController playerController = CreatePlayerController(playerProfile, micProfile);

            if (SceneData.PlayerProfileToScoreDataMap.TryGetValue(playerProfile, out PlayerScoreControllerData scoreData))
            {
                playerController.PlayerScoreController.ScoreData = scoreData;
            }

            // Handle crown display
            if (SceneData.SelectedPlayerProfiles.Count > 1)
            {
                playerController.PlayerScoreController.NoteScoreEventStream.Subscribe(noteScoreEvent => { RecomputeCrowns(); });
                playerController.PlayerScoreController.SentenceScoreEventStream.Subscribe(sentenceScoreEvent => { RecomputeCrowns(); });
            }
            playerController.PlayerUiController.PlayerCrownDisplayer.ShowCrown(false);
        }

        // Handle dummy singers
        if (Application.isEditor)
        {
            DummySingers = FindObjectsOfType <AbstractDummySinger>().ToList();
            foreach (AbstractDummySinger dummySinger in DummySingers)
            {
                if (dummySinger.playerIndexToSimulate < PlayerControllers.Count)
                {
                    dummySinger.SetPlayerController(PlayerControllers[dummySinger.playerIndexToSimulate]);
                }
                else
                {
                    Debug.LogWarning("DummySinger cannot simulate player with index " + dummySinger.playerIndexToSimulate);
                    dummySinger.gameObject.SetActive(false);
                }
            }
        }

        // Create warning about missing microphones
        string playerNameCsv = string.Join(",", playerProfilesWithoutMic.Select(it => it.Name).ToList());

        if (!playerProfilesWithoutMic.IsNullOrEmpty())
        {
            UiManager.Instance.CreateWarningDialog(
                I18NManager.GetTranslation(R.String.singScene_missingMicrophones_title),
                I18NManager.GetTranslation(R.String.singScene_missingMicrophones_message, "playerNameCsv", playerNameCsv));
        }

        // Associate LyricsDisplayer with one of the (duett) players
        InitLyricsDisplayers();

        //Save information about the song being started into stats
        Statistics stats = StatsManager.Instance.Statistics;

        stats.RecordSongStarted(SongMeta);

        songVideoPlayer.Init(SongMeta, songAudioPlayer);

        StartCoroutine(StartMusicAndVideo());

        // Rebuild whole UI
        LayoutRebuilder.ForceRebuildLayoutImmediate(CanvasUtils.FindCanvas().GetComponent <RectTransform>());
    }
Esempio n. 16
0
        private void ShowGift()
        {
            ClientData.LoadItemDescData(null);
            ClientData.LoadSpecialItemDescData(null);

            var npcId  = GlobalData.PlayerModel.PlayerVo.NpcId;
            var npcImg = transform.GetRawImage("window/RoleImage" + npcId);

            npcImg.texture = ResourceManager.Load <Texture>("Background/PersonIcon/Npc" + npcId, null, true);
            npcImg.gameObject.Show();



            _triggerGiftVo = _list[_currentIndex];

            _titleText.text = _triggerGiftVo.Rule.MallName;
            _desc.text      = _triggerGiftVo.Rule.MallDesc;

            List <RewardVo> rewardList = _triggerGiftVo.GetRewardList();

            for (int i = 0; i < _content.childCount; i++)
            {
                Transform child = _content.GetChild(i);
                if (i < rewardList.Count)
                {
                    child.GetRawImage("Image").texture = ResourceManager.Load <Texture>(rewardList[i].IconPath, null, true);
                    child.GetText("NumText").text      = rewardList[i].Num.ToString();
                }

                if (i < rewardList.Count)
                {
                    RewardVo vo = rewardList[i];
                    PointerClickListener.Get(child.gameObject).onClick = go =>
                    {
                        FlowText.ShowMessage(ClientData.GetItemDescById(vo.Id, vo.Resource).ItemDesc);
                    };
                }
                child.gameObject.SetActive(i < rewardList.Count);
            }

            // RectTransform rect = _buyBtnText.transform.GetRectTransform();

            if (_triggerGiftVo.IsFree)
            {
                _buyBtnText.gameObject.Hide();
                _freeBtnText.gameObject.Show();
                _freeBtnText.text = I18NManager.Get("RandowEventWindow_Free");


                _originalPriceText.gameObject.Hide();
                // rect.sizeDelta = new Vector2(920, rect.sizeDelta.y);
            }
            else
            {
                ProductVo product = GlobalData.PayModel.GetProduct(_triggerGiftVo.MallId);
                _buyBtnText.text = product.AreaPrice;//product.Curreny + " " +

                _buyBtnText.gameObject.Show();
                _freeBtnText.gameObject.Hide();
                _originalPriceText.gameObject.Show();

                if (AppConfig.Instance.isChinese == "true" || product?.Curreny == Constants.CHINACURRENCY)
                {
                    _originalPriceText.text = I18NManager.Get("RandowEventWindow_OriginalPrice") +
                                              _triggerGiftVo.Rule.OriginalPrice + "元";
                }
                else
                {
                    _originalPriceText.text = I18NManager.Get("RandowEventWindow_OriginalPrice") + product.Curreny + " " +
                                              product.GetOriginalPrice(_triggerGiftVo.Rule.OriginalPrice);
                }


                // rect.sizeDelta = new Vector2(920-100, rect.sizeDelta.y);
            }

            ClientTimer.Instance.RemoveCountDown(_countName);

            _timeText.text = I18NManager.Get("RandowEventWindow_Time",
                                             DateUtil.GetTimeFormat4(_triggerGiftVo.MaturityTime -
                                                                     ClientTimer.Instance.GetCurrentTimeStamp()))
                             + I18NManager.Get("RandowEventWindow_Later");

            ClientTimer.Instance.AddCountDown(_countName, long.MaxValue, 1, tick =>
            {
                if (_triggerGiftVo.MaturityTime - ClientTimer.Instance.GetCurrentTimeStamp() <= 0)
                {
                    Close();
                    GlobalData.RandomEventModel.Delete(new RepeatedField <long>()
                    {
                        _triggerGiftVo.Id
                    });
                    RandomEventManager.ShowGiftWindow(_currentIndex);
                    return;
                }

                _timeText.text =
                    I18NManager.Get("RandowEventWindow_Time",
                                    DateUtil.GetTimeFormat4(
                                        _triggerGiftVo.MaturityTime - ClientTimer.Instance.GetCurrentTimeStamp())) +
                    I18NManager.Get("RandowEventWindow_Later");
            }, null);

            _leftBtn.gameObject.SetActive(_list.Count > 1);
            _rightBtn.gameObject.SetActive(_list.Count > 1);
        }
Esempio n. 17
0
    public void SetData(RepeatedField <GameResultPB> result, CapsuleLevelVo customerSelectedLevel, int exp)
    {
        transform.Find("Title/Text").GetComponent <Text>().text = customerSelectedLevel.LevelName;
        _total = 0;
        _drawActivityDropItemDict = new Dictionary <string, DrawActivityDropItemVo>();

        for (int i = 0; i < result.Count; i++)
        {
            GameResultPB pb = result[i];
            Dictionary <int, RewardVo> rewardDict = new Dictionary <int, RewardVo>();
            for (int j = 0; j < pb.Awards.Count; j++)
            {
                RewardVo vo = new RewardVo(pb.Awards[j], true);
                if (rewardDict.ContainsKey(vo.Id))
                {
                    rewardDict[vo.Id].Num += vo.Num;
                }
                else
                {
                    rewardDict.Add(vo.Id, vo);
                }
            }
            RectTransform listItem = _content.GetChild(i).GetComponent <RectTransform>();
            var           isOnVip  = GlobalData.PlayerModel.PlayerVo.IsOnVip;
            if (isOnVip)
            {
                listItem.Find("Title/Text2").GetComponent <Text>().text = "+" + exp + I18NManager.Get("Common_VIPExp");
            }
            else
            {
                listItem.Find("Title/Text2").GetComponent <Text>().text = "+" + exp + I18NManager.Get("Common_Exp");
            }
            listItem.gameObject.Show();
            List <RewardVo> arr  = rewardDict.Values.ToList();
            var             prop = arr[arr.Count - 1];
            if (prop.Resource == ResourcePB.Item && prop.Id >= PropConst.CardUpgradePropSmall && prop.Id <= PropConst.CardUpgradePropLarge)
            {
                arr.Insert(1, prop);
                arr.RemoveAt(arr.Count - 1);
            }

            if (pb.DroppingItem != null && pb.DroppingItem.Count > 0)
            {
                for (int k = 0; k < pb.DroppingItem.Count; k++)
                {
                    DrawActivityDropItemVo vo = new DrawActivityDropItemVo(pb.DroppingItem[k], arr, HolidayModulePB.ActivityCareer);
                    _drawActivityDropItemDict.Add(i + "_" + vo.DisplayIndex, vo);
                    if (vo.TotalNum > _total)
                    {
                        _total = vo.TotalNum;
                    }
                }
            }

            SetItemReward(listItem, arr, _drawActivityDropItemDict);

            float height = 440;
            if (arr.Count > 3)
            {
                //2行的情况
                height = 766;
            }
            float lineY = -height + 5;

            listItem.sizeDelta = new Vector2(listItem.sizeDelta.x, height);
            RectTransform linePos = listItem.Find("Line").GetComponent <RectTransform>();
            linePos.anchoredPosition = new Vector2(linePos.anchoredPosition.x, lineY);
        }
        //显示最终值
        foreach (var dropItemVo in _drawActivityDropItemDict)
        {
            dropItemVo.Value.TotalNum = _total;
        }
    }
Esempio n. 18
0
 public void UpdatePowerData()
 {
     SumGoodsPower();
     transform.Find("Container/SupporterNum").GetComponent <Text>().text =
         I18NManager.Get("Battle_SupportHeatAdd", _funsPower + _itemPower);
 }
Esempio n. 19
0
        private void SetChanllangeTimes()
        {
            _playTimesBtn.transform.Find("Text").GetComponent <Text>().text =
                I18NManager.Get("MainLine_BattleIntroductionPopupPlayTimes1");

            //简单
            Transform tips = transform.Find("Tips");

            tips.gameObject.Hide();
//            if (_levelVo.Hardness == GameTypePB.Ordinary)
//            {
//                tips.gameObject.Hide();
//                if (GlobalData.PlayerModel.PlayerVo.Energy < _levelVo.CostEnergy * 5)
//                {
//                    _playTimesBtn.gameObject.SetActive(false);
//                }
//            }

//            int curTimes = _levelVo.MaxChallangeTimes - _levelVo.ChallangeTimes;


            int chanllangeTimes = GlobalData.PlayerModel.PlayerVo.Energy / _levelVo.CostEnergy;

            if (chanllangeTimes > 5)
            {
                chanllangeTimes = 5;
            }

            _playTimesBtn.gameObject.SetActive(chanllangeTimes > 1 && _levelVo.CurrentStar > 1);

//            _playTimesBtn.gameObject.SetActive(chanllangeTimes > 1 && _levelVo.CurrentStar > 1 && GlobalData.PlayerModel.PlayerVo.Energy >= _levelVo.CostEnergy * 2 );

            if (chanllangeTimes > 0)
            {
//                string[] timeArr = new[]
//                {
//                    I18NManager.Get("Common_One"), I18NManager.Get("Common_Two"), I18NManager.Get("Common_Three"),
//                    I18NManager.Get("Common_Four"), I18NManager.Get("Common_Five")
//                };

                _playTimesBtn.transform.Find("Text").GetComponent <Text>().text =
                    I18NManager.Get("MainLine_BattleIntroductionPopupPlayTimes", chanllangeTimes);
            }

//            tips.gameObject.Show();

            //tips.Find("Text").GetComponent<Text>().text =
            //    "今日剩余应援次数:" + curTimes + "/" +
            //    _levelVo.MaxChallangeTimes;
//            tips.Find("Text").GetComponent<Text>().text = I18NManager.Get("MainLine_BattleIntroductionPopupTips", curTimes, _levelVo.MaxChallangeTimes);


//            PointerClickListener.Get(tips.gameObject).onClick = go =>
//            {
//                if (curTimes == 0)
//                {
//                    BuyCount();
//                }
//                else
//                {
//                    FlowText.ShowMessage(I18NManager.Get("MainLine_BattleIntroductionPopupHint2"));
//                    //FlowText.ShowMessage("还有未使用的应援机会");
//                }
//            };
        }
Esempio n. 20
0
 /// <summary>
 /// 更新星卡Text文本
 /// </summary>
 public void UpdateTicke(int num)
 {
     transform.Find("Ticket/TicketTxt").GetComponent <Text>().text = I18NManager.Get("Common_StarCard") + num.ToString() + I18NManager.Get("Common_Num");
 }
Esempio n. 21
0
        //public static void BuyGold(string content = "是否花费10星钻购买1000金币?", Action<WindowEvent> callback = null,
        //    string title = "购买金币", string okBtnText = "确定", string cancelBtnText = "取消")
        //{
        //    PopupManager.ShowConfirmWindow(content, title, okBtnText, cancelBtnText).WindowActionCallback = evt =>
        //    {
        //        if (evt != WindowEvent.Ok)
        //        {
        //            callback?.Invoke(evt);
        //            return;
        //        }

        //        GemExchangeReq req = new GemExchangeReq
        //        {

        //            BuyType = BuyGemTypePB.BuyGold
        //        };
        //        byte[] data = NetWorkManager.GetByteData(req);
        //        NetWorkManager.Instance.Send<GemExchangeRes>(CMD.USERC_GEMEXCHANGE, data, res =>
        //        {
        //            GlobalData.PlayerModel.UpdateUserMoney(res.UserMoney);
        //            FlowText.ShowMessage("购买成功");
        //            callback?.Invoke(evt);
        //        });
        //    };
        //}
        #endregion


        /// <summary>
        /// 购买金币或体力或星源体力
        /// </summary>
        /// <param name="buyItemId">要购买道具的Id</param>
        public static void BuyGlodOrPorwer(int buyItemId, int costItemId)
        {
            PopupManager.ShowBuyWindow(buyItemId, costItemId).WindowActionCallback = evt =>
            {
                if (evt != WindowEvent.Ok)
                {
                    return;
                }

                GemExchangeReq req = new GemExchangeReq();
                switch (buyItemId)
                {
                case PropConst.GoldIconId:
                    req.BuyType = BuyGemTypePB.BuyGold;
                    break;

                case PropConst.PowerIconId:
                    req.BuyType = BuyGemTypePB.BuyPower;
                    break;

                case PropConst.EncouragePowerId:
                    req.BuyType = BuyGemTypePB.BuyEncouragePower;
                    break;
                }

                byte[] data = NetWorkManager.GetByteData(req);
                NetWorkManager.Instance.Send <GemExchangeRes>(CMD.USERC_GEMEXCHANGE, data, res =>
                {
                    // 统计消耗钻石的数量(要在更新购买次数前获取购买消耗钻石量)
                    switch (buyItemId)
                    {
                    case PropConst.GoldIconId:
                        SdkHelper.StatisticsAgent.OnPurchase("货币栏金币购买",
                                                             GlobalData.PlayerModel.GetBuyGemRule(BuyGemTypePB.BuyGold, GlobalData.PlayerModel.PlayerVo.GoldNum).Gem);

                        break;

                    case PropConst.PowerIconId:
                        SdkHelper.StatisticsAgent.OnPurchase("货币栏体力购买",
                                                             GlobalData.PlayerModel.GetBuyGemRule(BuyGemTypePB.BuyPower, GlobalData.PlayerModel.PlayerVo.PowerNum).Gem);
                        break;

                    case PropConst.EncouragePowerId:
                        SdkHelper.StatisticsAgent.OnPurchase("货币栏探班行动力购买",
                                                             GlobalData.PlayerModel.GetBuyGemRule(BuyGemTypePB.BuyEncouragePower, GlobalData.PlayerModel.PlayerVo.EncourageNum).Gem);
                        break;
                    }


                    GlobalData.PlayerModel.UpDataBuyNum(res.UserBuyGemInfo);
                    GlobalData.PlayerModel.UpdateUserMoney(res.UserMoney);
                    GlobalData.PlayerModel.UpdateUserPower(res.UserPower);

                    //
                    EventDispatcher.TriggerEvent(EventConst.UpdateEnergy);
                    EventDispatcher.TriggerEvent(EventConst.BuyGoldSuccess);
                    EventDispatcher.TriggerEvent(EventConst.RefreshPoint);
                    FlowText.ShowMessage(I18NManager.Get("Common_BuySucceed"));// ("购买成功");
                    AudioManager.Instance.PlayEffect(buyItemId == PropConst.GoldIconId?"buyGold":"buypower");
                });
            };
        }
Esempio n. 22
0
    public void SetData(int gemnum, int gemtotal, int[] costNum, int dropGemNum)
    {
        _qualifyCountTxt.GetComponent <Text>().text = I18NManager.Get("DrawCard_Hint8"); // + gemnum + "/" + gemtotal;
        _gemTenBtn.transform.Find("CostImage/Text").GetComponent <Text>().text = "x " + costNum[(int)DrawTypePB.ByGem10].ToString();
        transform.Find("Ticket/TicketTxt").GetComponent <Text>().text          = I18NManager.Get("Common_StarCard") + dropGemNum + I18NManager.Get("Common_Num");

        _gemOnceBtn.transform.Find("CostImage/Image").gameObject.SetActive(true);
        _gemOnceBtn.transform.Find("CostImage/Text").GetComponent <Text>().text = "x " + costNum[(int)DrawTypePB.ByGem].ToString();
    }
Esempio n. 23
0
 public void Showview(bool enable = false)
 {
     _downloadText.text = I18NManager.Get("Download_CheckFiles");
     gameObject.Show();
     _downloadtran.gameObject.SetActive(enable);
 }
Esempio n. 24
0
 private void OnLockClick(GameObject go)
 {
     FlowText.ShowMessage(I18NManager.Get("Common_Underdevelopment"));
 }
Esempio n. 25
0
 private void OnGetOrderError(HttpErrorVo vo)
 {
     Debug.LogError("Android创建订单失败回调---》" + vo.ErrorCode);
     LoadingOverlay.Instance.Hide();
     FlowText.ShowMessage(I18NManager.Get("Shop_Hint2", vo.ErrorCode)); // ("创建订单失败" + "->" + vo.ErrorCode);
 }
Esempio n. 26
0
        private string GetPushContent(PushType pushType)
        {
            string content = "";

            switch (pushType)
            {
            case PushType.PowerMax:
                content = I18NManager.Get("Push_HintPowerMax" + UnityEngine.Random.Range(0, 3));
                break;

            case PushType.OldPlayer:
                content = I18NManager.Get("Push_HintOldPlayer" + UnityEngine.Random.Range(0, 3));
                break;

            case PushType.Supporter:
                content = I18NManager.Get("Push_HintGetEncAct" + UnityEngine.Random.Range(0, 3));
                break;

            case PushType.MonthCard:
                content = I18NManager.Get("Push_HintMonthCardGem" + UnityEngine.Random.Range(0, 3));
                break;

            case PushType.DrawGem:
            case PushType.DrawGold:
                content = I18NManager.Get("Push_HintFreeDraw" + UnityEngine.Random.Range(0, 3));
                break;

            case PushType.PowerReceiverTime0:
            case PushType.PowerReceiverTime1:
            case PushType.PowerReceiverTime2:
            case PushType.PowerReceiverTime3:
            case PushType.PowerReceiverTime4:
            case PushType.PowerReceiverTime5:
                content = I18NManager.Get("Push_HintGetPower" + UnityEngine.Random.Range(0, 3));
                break;

            case PushType.CreateMsg1:
            case PushType.CreateMsg2:
            case PushType.CreateMsg3:
            case PushType.CreateMsg4:
            case PushType.CreateMsg5:
            case PushType.CreateMsg6:
            case PushType.CreateMsg7:
            case PushType.CreateMsg8:
            case PushType.CreateMsg9:
            case PushType.CreateMsg10:
            case PushType.CreateMsg11:
            case PushType.CreateMsg12:
            case PushType.CreateMsg13:
            case PushType.CreateMsg14:
            case PushType.CreateMsg15:
            case PushType.CreateMsg16:
            case PushType.CreateMsg17:
            case PushType.CreateMsg18:
            case PushType.CreateMsg19:
            case PushType.CreateMsg20:
            case PushType.CreateMsg21:
            case PushType.CreateMsg22:
            case PushType.CreateMsg23:
            case PushType.CreateMsg24:
            case PushType.CreateMsg25:
            case PushType.CreateMsg26:
            case PushType.CreateMsg27:
            case PushType.CreateMsg28:
            case PushType.CreateMsg29:
            case PushType.CreateMsg30:
                if (GlobalData.PlayerModel != null && GlobalData.PlayerModel.PlayerVo != null)
                {
                    int role_id = GlobalData.PlayerModel.PlayerVo.NpcId;
                    var vo      = GlobalData.FavorabilityMainModel.GetUserFavorabilityVo(role_id);
                    if (vo != null)
                    {
                        string name = GlobalData.FavorabilityMainModel.GetPlayerName(vo.Player);
                        content = string.Format(I18NManager.Get("Push_CreateMsg"), name);
                        //Debug.LogWarning("pushType:" + pushType + " content:" + content);
                    }
                }
                break;

            default:
                content = I18NManager.Get("Push_HintOldPlayer" + UnityEngine.Random.Range(0, 3));
                break;
            }
            return(content);
        }
Esempio n. 27
0
    public void SetShowInfo()
    {
        Transform chouka = transform.parent.Find("chouka");

        if (chouka != null)
        {
            chouka.gameObject.SetActive(false);
        }

        if (_drawCardResultVo.Resource == ResourcePB.Signature)
        {
            _signatureImg = transform.GetRawImage("ImageCard/RawImage/Signature");
            _signatureImg.gameObject.SetActive(true);
        }

        Texture texture = null;
        string  markRes = "";

        if (_drawCardResultVo.Resource == ResourcePB.Fans)
        {
            _credit.gameObject.SetActive(false);
            _cardShadowImg.gameObject.SetActive(false);
            markRes = "UIAtlas_DrawCard2_Star";

            texture = ResourceManager.Load <Texture>(CardUtil.GetBigFunsCardPath(_drawCardResultVo.CardId), ModuleConfig.MODULE_DRAWCARD);
            ShowLapiao(false);
        }
        else if (_drawCardResultVo.Resource == ResourcePB.Card ||
                 _drawCardResultVo.Resource == ResourcePB.Puzzle ||
                 _drawCardResultVo.Resource == ResourcePB.Signature)
        {
            _credit.gameObject.SetActive(true);
            _cardShadowImg.gameObject.SetActive(true);
            markRes = _drawCardResultVo.Resource == ResourcePB.Card ? "UIAtlas_DrawCard2_Star" : "UIAtlas_DrawCard2_Puzzle";
            texture = ResourceManager.Load <Texture>(CardUtil.GetBigCardPath(_drawCardResultVo.CardId), ModuleConfig.MODULE_DRAWCARD);

            _credit.sprite = AssetManager.Instance.GetSpriteAtlas("UIAtlas_DrawCard2_07-" + _drawCardResultVo.Credit.ToString());
            _credit.SetNativeSize();
            if (_signatureImg != null)
            {
                _signatureImg.texture = ResourceManager.Load <Texture>(CardUtil.GetCardSignaturePath(_drawCardResultVo.CardId), ModuleConfig.MODULE_DRAWCARD);
                _signatureImg.GetComponent <RectTransform>().sizeDelta = new Vector2(_signatureImg.texture.width, _signatureImg.texture.height);
            }

            if (isCanShowLapiao && (_drawCardResultVo.Resource == ResourcePB.Card || _drawCardResultVo.Resource == ResourcePB.Signature))
            {
                ShowLapiao(true);
            }
        }
        else
        {
            return;
        }

        transform.Find("suipian").GetComponent <Image>().sprite           = AssetManager.Instance.GetSpriteAtlas(markRes);
        transform.Find("suipian/Image (1)").GetComponent <Image>().sprite = AssetManager.Instance.GetSpriteAtlas(markRes);
        _cardFrontImg.gameObject.SetActive(_drawCardResultVo.Resource == ResourcePB.Puzzle ? true : false);

        _name.text = _drawCardResultVo.Resource == ResourcePB.Puzzle ?$"{_drawCardResultVo.Name}({I18NManager.Get("Card_PuzzleTap")})":_drawCardResultVo.Name;
        if (texture == null)
        {
            Debug.LogError("SetShowInfo sprite is null");
            _cardImg.texture = ResourceManager.Load <Texture>("Card/Image/1000", ModuleConfig.MODULE_DRAWCARD);
            _cardImg.gameObject.SetActive(true);
            return;
        }

        _cardImg.texture = texture;
        if (_drawCardResultVo.Resource == ResourcePB.Fans)
        {
            transform.Find("ImageCard").GetComponent <Canvas>().sortingOrder = 786;
            _cardImg.transform.GetComponent <RectTransform>().SetSize(new Vector2(1080, 1920));
        }
        else
        {
            transform.Find("ImageCard").GetComponent <Canvas>().sortingOrder = 789;
            _cardImg.transform.GetComponent <RectTransform>().SetSize(new Vector2(1440, 1920));
        }
        _cardImg.gameObject.SetActive(true);
        //暂时放这里
        //  AudioManager.Instance.PlayEffect("draw_ssr", 1);
    }
Esempio n. 28
0
    public void JumpTo(int id, int neenum, CardModel cardModel, LevelModel model, int cardId = -1, Action action = null)
    {
        for (int i = 0; i < 2; i++)
        {
            Transform child = _btnGroup.GetChild(i);
            if (_jumpDataList == null || _jumpDataList.Length <= i)
            {
                child.gameObject.Hide();
                continue;
            }

            child.gameObject.Show();

            if (_jumpDataList[i].Module == ModuleConfig.MODULE_RECOLLECTION)
            {
                _jumpDataList[i].PostData = cardId;
            }

            _jumpDataList[i].RequireId  = id;
            _jumpDataList[i].RequireNum = neenum;

            //要新增一个逻辑:未解锁的关卡不能显示关卡名字,并且不能跳转。
            var levelVo = model.FindLevel(_jumpDataList[i]);
            if (levelVo != null && !levelVo.IsOpen)
            {
                //颜色变得灰掉。
                child.Find("Text").GetComponent <Text>().text = I18NManager.Get("Card_UnLock", _jumpDataList[i].DisplayText);
                //$"<color=#808080>{_jumpDataList[i].DisplayText + "(未解锁)"}</color>";
                child.GetComponent <Button>().onClick.AddListener(() => { FlowText.ShowMessage(I18NManager.Get("Card_UnLockMainline")); });
            }
            else
            {
                child.Find("Text").GetComponent <Text>().text = _jumpDataList[i].DisplayText;
                child.GetComponent <Button>().onClick.AddListener(() =>
                {
                    int index = EventSystem.current.currentSelectedGameObject.transform.GetSiblingIndex();
//                        Close();
                    if (action != null)
                    {
                        action.Invoke();
                    }

//                        Debug.LogError(_jumpDataList[index].DisplayText + " " + _jumpDataList[index].Data + " " +
//                                       _jumpDataList[index].Module);
                    int openLevel = GuideManager.GetOpenUserLevel(ModulePB.CardMemories, FunctionIDPB.CardMemoriesEntry);
                    if (_jumpDataList[index].Module == ModuleConfig.MODULE_RECOLLECTION &&
                        GlobalData.PlayerModel.PlayerVo.Level < openLevel)
                    {
                        FlowText.ShowMessage(I18NManager.Get("Card_UpToLevel", openLevel));
                    }
                    else
                    {
                        ModuleManager.Instance.EnterModule(_jumpDataList[index]);
                    }
                });
            }
        }
    }
Esempio n. 29
0
 static void Main(string[] args)
 {
     I18NManager.getInstance().push(1, "注册成功,您的账号是{0},密码是{1},价格是{2:F0}");
     System.Console.WriteLine("I18N:" + I18NManager.getInstance().getString(1, 'a', 2, 25.69));
     System.Console.ReadKey();
 }
Esempio n. 30
0
        public void OnPointerClick(PointerEventData eventData)
        {
            //要根据_itemvo.MallSortPb来打开不同的窗口!
//            Debug.LogError("OnPointerClick");
            if (_canEnter)
            {
                FlowText.ShowMessage(I18NManager.Get("Shop_BuyMax"));
                return;
            }

            switch (_curmallSortPB)
            {
            case MallSortPB.MallGift:
                if (_itemvo != null)
                {
                    EventDispatcher.TriggerEvent(EventConst.BuyMallGift, _userBuyGameMallVo);
                }
                else
                {
                    EventDispatcher.TriggerEvent(EventConst.BuyRmbMallGift, _userBuyRmbMallVo);
                }

                break;

            case MallSortPB.MallItem:
                EventDispatcher.TriggerEvent(EventConst.BuyMallItem, _itemvo, _userBuyGameMallVo);
                break;

            case MallSortPB.MallBatchItem:
                EventDispatcher.TriggerEvent(EventConst.BuyMallBatchItem, _itemvo, _userBuyGameMallVo);
                break;

            case MallSortPB.MallRebateGift:
                FlowText.ShowMessage(I18NManager.Get("Shop_Hint3"));    // ("暂无返利礼包");
                break;

            case MallSortPB.MallOrdinary:
                if (_itemvo != null)
                {
                    EventDispatcher.TriggerEvent(EventConst.BuyMallGift, _itemvo);
                }
                else
                {
                    EventDispatcher.TriggerEvent(EventConst.BuyGemMall, _itemRmbVo);
                }
                break;

            default:
                if (_itemvo != null)
                {
                    FlowText.ShowMessage(I18NManager.Get("Shop_Hint4", _itemvo.MallSortPb));    // ("枚举错误?" + _itemvo.MallSortPb);
                }
                else
                {
                    FlowText.ShowMessage(I18NManager.Get("Shop_Hint4", _itemRmbVo.MallSortPb));    // ("枚举错误?" + _itemvo.MallSortPb);
                }


                break;
            }
        }