void OnTimeLineFinish(CEventBaseArgs data)
        {
            uint        timelineId = (uint)data.arg;
            List <uint> ids        = GameConstHelper.GetUintList("GAME_PICK_BOSS_CLIP_TIMELINE_ID");

            if (ids.Contains(timelineId))
            {
                FinishPickImmediately();
            }
        }
Esempio n. 2
0
    /// <summary>
    ///  初始化角色职业id等信息
    /// </summary>
    private void SetData()
    {
        var role_ids = GameConstHelper.GetUintList("GAME_AVAILABLE_ROLE_ID");

        mActorNum = role_ids.Count;

        mRoleData = new List <PkgPlayerBrief>();
        for (int i = 0; i < mActorNum; ++i)
        {
            PkgPlayerBrief roleBrief = new PkgPlayerBrief();
            roleBrief.rid   = role_ids[i];
            roleBrief.uuid  = 0;
            roleBrief.name  = new byte[0];
            roleBrief.level = 0;

            mRoleData.Add(roleBrief);
        }
    }
Esempio n. 3
0
    void UpdateUI()
    {
        if (mTimer != null)
        {
            mTimer.Destroy();
            mTimer = null;
        }

        if (mActivityIds == null)
        {
            return;
        }
        Transform timerTextTrans = this.transform.Find("SysBtn").Find("TimerText");

        if (timerTextTrans == null)
        {
            GameDebug.LogError("UIGuildLeagueSysBtn UpdateTimerText error!!! Can not find TimerText!!!");
            return;
        }

        UISysConfigBtn btn = this.gameObject.GetComponent <UISysConfigBtn>();


        //当预告开启的时候  预备和资格的  icon不允许显示
        if (ActivityHelper.IsActivityOpen(GameConst.SYS_OPEN_LEAGUE_PRE_SHOW))
        {
            btn.SetSysBtnState(UISysConfigBtn.SysState.NotOpen);
            return;
        }


        // 系统是否开放
        bool sysIsOpen = false;

        foreach (uint activityId in mActivityIds)
        {
            if (SysConfigManager.Instance.CheckSysHasOpenIgnoreActivity(activityId))
            {
                sysIsOpen = true;
                break;
            }
        }

        if (sysIsOpen == false)
        {
            btn.SetSysBtnState(UISysConfigBtn.SysState.NotOpen);
            return;
        }

        bool todayIsOpen = false;

        foreach (uint activityId in mActivityIds)
        {
            if (ActivityHelper.GetActivityInfo <bool>(activityId, "TodayIsOpen") == true)
            {
                todayIsOpen = true;
                break;
            }
        }
        if (todayIsOpen == false)
        {
            //this.gameObject.SetActive(false);
            btn.SetSysBtnState(UISysConfigBtn.SysState.NotOpen);
        }
        else
        {
            DateTime curDateTime = Game.Instance.GetServerDateTime();
            uint     serverTime  = Game.Instance.ServerTime;

            List <uint> startShowBtnTimeStr = GameConstHelper.GetUintList("GAME_GUILD_LEAGUE_START_SHOW_BTN_TIME"); // 开始显示系统按钮时间(5点)
            List <uint> confirmTimeStr      = GameConstHelper.GetUintList("GAME_GUILD_LEAGUE_CONFIRM_TIME");        // 确认对战表时间(19点)
            List <uint> openTimeStr         = GameConstHelper.GetUintList("GAME_GUILD_LEAGUE_OPEN_TIME");           // 活动开启时间(21点)
            List <uint> closeTimeStr        = GameConstHelper.GetUintList("GAME_GUILD_LEAGUE_CLOSE_TIME");          // 活动关闭时间(22点)

            uint startShowBtnTimeHour   = startShowBtnTimeStr[0];
            uint startShowBtnTimeMinute = startShowBtnTimeStr[1];
            uint confirmTimeHour        = confirmTimeStr[0];
            uint confirmTimeMinute      = confirmTimeStr[1];
            uint openTimeHour           = openTimeStr[0];
            uint openTimeMinute         = openTimeStr[1];
            uint closeTimeHour          = closeTimeStr[0];
            uint closeTimeMinute        = closeTimeStr[1];

            long startShowBtnTimestamp = DateHelper.GetTimestamp(new DateTime(curDateTime.Year, curDateTime.Month, curDateTime.Day, (int)startShowBtnTimeHour, (int)startShowBtnTimeMinute, 0));
            long confirmTimestamp      = DateHelper.GetTimestamp(new DateTime(curDateTime.Year, curDateTime.Month, curDateTime.Day, (int)confirmTimeHour, (int)confirmTimeMinute, 0));
            long openTimestamp         = DateHelper.GetTimestamp(new DateTime(curDateTime.Year, curDateTime.Month, curDateTime.Day, (int)openTimeHour, (int)openTimeMinute, 0));
            long roundTwoOpenTimestamp = openTimestamp + GameConstHelper.GetUint("GAME_GUILD_LEAGUE_ROUND_TWO_AFTER") * 60;
            long closeTimestamp        = DateHelper.GetTimestamp(new DateTime(curDateTime.Year, curDateTime.Month, curDateTime.Day, (int)closeTimeHour, (int)closeTimeMinute, 0));

            long endTimestamp = 0;

            if (serverTime < startShowBtnTimestamp) // 5点前
            {
                //this.gameObject.SetActive(false);
                btn.SetSysBtnState(UISysConfigBtn.SysState.NotOpen);
            }
            else if (serverTime < confirmTimestamp) // 确认参赛资格前
            {
                //this.gameObject.SetActive(true);
                btn.SetSysBtnState(UISysConfigBtn.SysState.Open);
                endTimestamp = openTimestamp;
            }
            else if (serverTime < openTimestamp)                         // 第一轮比赛开启前
            {
                if (GuildLeagueManager.Instance.CanJoinLeague() == true) // 有参赛资格
                {
                    //this.gameObject.SetActive(true);
                    btn.SetSysBtnState(UISysConfigBtn.SysState.Open);
                    endTimestamp = openTimestamp;
                }
                else // 没有参赛资格
                {
                    //this.gameObject.SetActive(true);
                    btn.SetSysBtnState(UISysConfigBtn.SysState.Open);
                }
            }
            else if (serverTime < roundTwoOpenTimestamp)                   // 第二轮比赛开启前
            {
                if (GuildLeagueManager.Instance.RoundOneIsOver() == false) // 第一轮还没结束
                {
                    //this.gameObject.SetActive(true);
                    btn.SetSysBtnState(UISysConfigBtn.SysState.Open);
                }
                else  // 第一轮已经结束
                {
                    //this.gameObject.SetActive(true);
                    btn.SetSysBtnState(UISysConfigBtn.SysState.Open);
                    endTimestamp = roundTwoOpenTimestamp;
                }
            }
            else if (serverTime < closeTimestamp)   // 22点前
            {
                //this.gameObject.SetActive(true);
                btn.SetSysBtnState(UISysConfigBtn.SysState.Open);
            }
            else // 22点后
            {
                //this.gameObject.SetActive(false);
                btn.SetSysBtnState(UISysConfigBtn.SysState.NotOpen);
            }

            Text timerText = this.transform.Find("SysBtn").Find("TimerText").GetComponent <Text>();
            if (endTimestamp > 0)
            {
                timerText.gameObject.SetActive(true);
                if (endTimestamp > serverTime)
                {
                    long timeOffset = endTimestamp - serverTime;
                    timerText.text = Utils.Timer.GetFMTTime2(1000f * timeOffset);
                    mTimer         = new Utils.Timer(timeOffset * 1000, false, 1000,
                                                     (remainTime) =>
                    {
                        if (remainTime > 0)
                        {
                            timerText.text = Utils.Timer.GetFMTTime2(remainTime);
                        }
                        else
                        {
                            timerText.text = "";
                            timerText.gameObject.SetActive(false);

                            UpdateUI();
                        }
                    });
                }
                else
                {
                    GameDebug.LogError("Init UIGuildLeagueSysBtn error, end timestamp is early then cur time!!!");
                }
            }
            else
            {
                timerText.gameObject.SetActive(false);
            }
        }

        ShowEffect(RedPointDataMgr.Instance.GetRedPointVisible(70));
    }
Esempio n. 4
0
            protected override void InitUI()
            {
                base.InitUI();

                mEnterGameButton    = FindChild("EnterGameButton").GetComponent <Button>();
                mExitButton         = FindChild("ExitButton").GetComponent <Button>();
                mGenerateNameButton = FindChild("GenerateNameButton").GetComponent <Button>();
                mNameInputField     = FindChild("NameInputField").GetComponent <InputField>();
                mVocationDesc       = FindChild("VocationDesc").transform;
                mRightButtom        = FindChild("RightButtom");
                mRight      = FindChild("Right");
                mHealthTips = FindChild("HealthTips");
                mHealthTips.SetActive(false);
                mCreateNewRoleButton = FindChild("CreateNewRoleButton").GetComponent <Button>();
                mCreateNewRoleButton.gameObject.SetActive(false);

                // 获取最大可创建角色数量
                var role_ids = GameConstHelper.GetUintList("GAME_AVAILABLE_ROLE_ID");

                mActorNum = role_ids.Count;
                // 获取创角按钮
                mActorButtons.Clear();



                if (AuditManager.Instance.AuditAndIOS())
                {
                    for (int i = 0; i < mActorNum; ++i)
                    {
                        var btn_game_object = FindChild(string.Format("VocationButton{0}", i + 1));
                        if (btn_game_object != null)
                        {
                            btn_game_object.gameObject.SetActive(false);
                        }
                    }
                    //int[] actorList = new int[] { 2, 1 ,3 };
                    List <uint> actorList = SDKHelper.GetRoleList();
                    if (actorList != null)
                    {
                        bool isShowActorBtn = actorList.Count > 1;

                        for (int i = 0; i < actorList.Count; i++)
                        {
                            int career          = (int)actorList[i];
                            var btn_game_object = FindChild(string.Format("VocationButton{0}", career));
                            if (btn_game_object != null)
                            {
                                btn_game_object.gameObject.SetActive(isShowActorBtn);
                                btn_game_object.transform.Find("CheckMask").gameObject.SetActive(false);
                                btn_game_object.transform.Find("Background").gameObject.SetActive(true);
                                mActorButtons.Add((uint)career, btn_game_object.GetComponent <Button>());
                            }
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < mActorNum; ++i)
                    {
                        var btn_game_object = FindChild(string.Format("VocationButton{0}", i + 1));
                        if (btn_game_object != null)
                        {
                            mActorButtons.Add((uint)(i + 1), btn_game_object.GetComponent <Button>());
                        }
                    }
                }
                mEnterGameButton.onClick.AddListener(OnClickEnterGameBtn);
                mExitButton.onClick.AddListener(OnClickExitBtn);
                mGenerateNameButton.onClick.AddListener(OnClickNameBtn);
                foreach (var kv in mActorButtons)
                {
                    var btn = kv.Value;
                    if (btn != null)
                    {
                        btn.onClick.AddListener(() => { OnClickActorBtn(kv.Key); });
                    }
                }
                mCreateNewRoleButton.onClick.AddListener(OnClickCreateNewRoleButton);


                if (AuditManager.Instance.AuditAndIOS() && SDKHelper.GetSwitchModel())
                {
                    for (int i = 0; i < 3; i++)
                    {
                        GameObject go = FindChild("ActorPic" + (i + 1).ToString());
                        if (go != null)
                        {
                            LoadMaJiaImage majia   = go.AddComponent <LoadMaJiaImage>();
                            var            picName = string.Format("ActorPic{0}.png", (i + 1));
                            majia.mPath = ResNameMapping.Instance.GetMappingName(picName);
                            majia.SetFailCallBack(() =>
                            {
                                RawImage image = majia.GetComponent <RawImage>();
                                if (image != null)
                                {
                                    image.color = new Color(0, 0, 0, 0);
                                }
                            });
                            mActorPic.Add(go);
                        }
                    }
                }



                Game.GetInstance().SubscribeNetNotify(NetMsg.MSG_CREATE_ROLE, HandleCreateRole);
                ClientEventMgr.GetInstance().SubscribeClientEvent((int)ClientEvent.CE_RANDNAME_UPDATE, OnRandNameUpdate);
            }
    public void Awake()
    {
        if (SceneHelp.Instance.IsInWeddingInstance == true) // 婚宴副本外面使用第二套模型
        {
            mModelIds = GameConstHelper.GetUintList("GAME_WEDDING_DRAMA_TIMELINE_COUPLE_MODEL_IDS");
        }
        else
        {
            mModelIds = GameConstHelper.GetUintList("GAME_WEDDING_DRAMA_TIMELINE_COUPLE_MODEL_IDS_2");
        }

        PlayableDirector playableDirector = gameObject.GetComponent <PlayableDirector>();

        if (playableDirector != null)
        {
            uint rid1 = 0;
            uint rid2 = 0;
            MarryHelper.GetWeddingCoupleJobs(out rid1, out rid2);

            TimelineAsset asset = playableDirector.playableAsset as TimelineAsset;
            foreach (TrackAsset track in asset.GetOutputTracks())
            {
                GroupTrack group = track.GetGroup();
                if (group != null)
                {
                    if (group.name.Equals("Mate") == true)
                    {
                        foreach (PlayableBinding output in track.outputs)
                        {
                            if (output.sourceObject != null)
                            {
                                Object binding = playableDirector.GetGenericBinding(output.sourceObject);
                                if (binding == null)
                                {
                                    GameDebug.LogError("Player wedding chapel timeline " + this.name + " error!!! " + output.sourceObject.name + " 's binding object is null!!!");
                                    continue;
                                }
                                GameObject bindingObj = binding as GameObject;

                                // 根据职业显示主角的模型
                                if (bindingObj != null)
                                {
                                    if (bindingObj.name.Equals("Mate_R") == true)
                                    {
                                        if (rid1 > 0)
                                        {
                                            bindingObj.SetActive(false);
                                            ReplaceActorModel(playableDirector, output, bindingObj, rid1, bindingObj.name);
                                        }
                                    }
                                    if (bindingObj.name.Equals("Mate_L") == true)
                                    {
                                        if (rid2 > 0)
                                        {
                                            bindingObj.SetActive(false);
                                            ReplaceActorModel(playableDirector, output, bindingObj, rid2, bindingObj.name);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        // 跳过按钮
        Transform skipButtonTrans = gameObject.transform.Find("UI/Canvas/SkipButton");

        if (skipButtonTrans != null)
        {
            Button skipButton = skipButtonTrans.GetComponent <Button>();
            if (skipButton != null)
            {
                skipButton.onClick.RemoveAllListeners();
                skipButton.onClick.AddListener(() =>
                {
                    TimelineManager.Instance.StopAll();
                });
            }
        }

        GameInput.Instance.EnableInput(true, true);
    }