Example #1
0
            private void OnShowNpc(long npcId)
            {
                ConfNpc confNpc = ConfNpc.Get(npcId);

                if (this.m_personTex == null || this.m_nameLab == null || this.m_exhibitImg == null)
                {
                    //TimeModule.Instance.RemoveTimeaction(OnChangeNpc);
                    return;
                }
                this.m_nameLab.Text = LocalizeModule.Instance.GetString(confNpc.name);
                if (confNpc.identityType == 4 || confNpc.identityType == 2)
                {
                    this.m_personTex.TextureName = confNpc.icon;
                    this.m_exhibitImg.Visible    = false;
                    this.m_personTex.Visible     = true;
                }
                else if (confNpc.identityType == 3)
                {
                    this.m_exhibitImg.Sprite  = confNpc.icon;
                    this.m_exhibitImg.Visible = true;
                    this.m_personTex.Visible  = false;
                    if (this.m_type == 2)
                    {
                        this.m_weaponLab.Text = LocalizeModule.Instance.GetString(confNpc.otherFeatures);
                    }
                }
            }
        public void SetInitData(PersuadeData persuadeData, int total, PresuadeChooseComponent chooseCom, Dictionary <int, PresuadeRecordData> serialIndexDic)
        {
            this.m_persuadeData   = persuadeData;
            this.m_chooseCom      = chooseCom;
            this.m_serialIndexDic = serialIndexDic;
            string npcIcon      = ConfNpc.Get(persuadeData.npcId).icon;
            string npcIconSpine = CommonData.GetSpineHead(npcIcon);

            npcIcon = string.IsNullOrEmpty(npcIconSpine) ? CommonData.GetBigPortrait(npcIcon) : npcIconSpine;

            string selfIcon      = "juzhang_laonianren_01_SkeletonData.asset";//GlobalInfo.MY_PLAYER_INFO.PlayerIcon;
            string selfIconSpine = CommonData.GetSpineHead(npcIcon);

            selfIcon = string.IsNullOrEmpty(selfIconSpine) ? CommonData.GetBigPortrait(selfIcon) : selfIconSpine;

            this.m_currentNpcIcon  = GetCurrentIcon(this.m_npcSpine, this.m_npcTex, npcIcon);
            this.m_currentSelfIcon = GetCurrentIcon(this.m_selfSpine, this.m_selfTex, selfIcon);

            this.m_npcTween = this.m_currentNpcIcon.GetComponent <TweenPosition>();
            this.m_serialIconGrid.EnsureSize <SerialToggle>(total);
            for (int i = 0; i < total; i++)
            {
                SerialToggle t = this.m_serialIconGrid.GetChild <SerialToggle>(i);
                t.SetIndex(i);
                t.Visible = true;
            }
        }
Example #3
0
        public void SetData(ConfSkyEye conSky, bool isUnLock, bool hasReward)
        {
            skyEyeId = conSky.id;
            ConfNpc npc = ConfNpc.Get(conSky.npcId);

            this.m_presuadeId         = conSky.refuteId;
            this.m_personNameLab.Text = isUnLock?LocalizeModule.Instance.GetString(npc.name):"?";
            this.m_detailLab.Text     = LocalizeModule.Instance.GetString(conSky.descs);
            this.m_personTex.Visible  = isUnLock;

            this.m_maskCom.Visible = !isUnLock;

            if (isUnLock)
            {
                this.m_personTex.TextureName = npc.icon;
            }
            int hasUnLockNumber = 0;

            this.m_resGrid.EnsureSize <SkyEyeProp>(conSky.collectorIds.Length);
            for (int i = 0; i < conSky.collectorIds.Length; i++)
            {
                SkyEyeProp    icon         = this.m_resGrid.GetChild <SkyEyeProp>(i);
                PlayerPropMsg playerProp   = GlobalInfo.MY_PLAYER_INFO.GetBagInfosByID(conSky.collectorIds[i]);
                bool          isPropUnLock = false;
                if (playerProp != null && playerProp.Count > 0)
                {
                    isPropUnLock = true;
                    hasUnLockNumber++;
                }
                icon.SetData(conSky.collectorIds[i], isPropUnLock);
                icon.Visible = true;
            }
            this.m_chatBtn.Visible = !hasReward && (hasUnLockNumber == conSky.collectorIds.Length);
        }
Example #4
0
        public bool SetData(ConfSkyEye skyeye, int index, SkyeyePersonDetailComponent detailUI)
        {
            this.m_detailUI = detailUI;
            m_confSkyeye    = skyeye;
            this.SkyEyeID   = skyeye.id;
            int num = 0;

            this.m_hasReward = GlobalInfo.MY_PLAYER_INFO.IsSkyEyeRewardContainId(skyeye.id);
            //this.m_alphaTweener.Delay = Mathf.Sqrt(index * 0.9f);// index * SkyeyeUILogic.PERSONTIME;
            this.m_scaleTweener.Delay = Mathf.Sqrt(index * 0.9f);; // index * SkyeyeUILogic.PERSONTIME;

            this.m_alphaText.Delay = this.m_scaleTweener.Delay + this.m_scaleTweener.Duration;
            this.m_posText.Delay   = this.m_scaleTweener.Delay + this.m_scaleTweener.Duration;
            isLock = true;
            for (int i = 0; i < m_confSkyeye.collectorIds.Length; i++)
            {
                PlayerPropMsg playerProp = GlobalInfo.MY_PLAYER_INFO.GetBagInfosByID(m_confSkyeye.collectorIds[i]);
                if (playerProp != null && playerProp.Count > 0)
                {
                    num++;
                    if (m_confSkyeye.collectorIds[i] == m_confSkyeye.keyCollectorId)
                    {
                        isLock = false;
                    }
                }
            }

            this.m_personName.Visible = !isLock;
            this.m_lockCom.Visible    = isLock;
            this.m_personCom.Visible  = !isLock;
            m_progress             = num / (float)m_confSkyeye.collectorIds.Length;
            this.m_tipsLab.Visible = false;
            if (m_progress == 1 && !m_hasReward)
            {
                this.m_tipsLab.Text    = "(" + LocalizeModule.Instance.GetString("theeye_tips") + ")";
                this.m_tipsLab.Visible = true;
            }

            if (m_hasReward)
            {
                this.m_progressFillImg.Color = m_targetColor;
                this.m_personName.color      = m_targetColor;
            }
            else
            {
                this.m_progressFillImg.Color = m_srcColor;
                this.m_personName.color      = m_srcColor;
            }
            //this.m_progressBar.Value = m_progress;
            if (!isLock)
            {
                ConfNpc npc = ConfNpc.Get(m_confSkyeye.npcId);
                this.m_personName.Text       = LocalizeModule.Instance.GetString(npc.name);
                this.m_personImg.TextureName = npc.icon;
            }
            return(m_hasReward);
        }
Example #5
0
        public void SetNpcID(long npcId, ChapterNpcInfo npcInfo, Transform scaleTran)
        {
            this.m_itemStatus     = 0;
            this.m_scaleChatTrans = scaleTran;
            this.m_npcID          = npcId;
            this.m_npcData        = ConfNpc.Get(npcId);
            this.npcInfo          = npcInfo;
            if (this.m_npcData == null)
            {
                Debug.LogError($"{npcId} npc config not found");
            }

            RefreshNpcIntro();
        }
Example #6
0
        public void SetTaskList(IList <ChapterTaskInfo> taskInfos, long currentChapterId)
        {
            //只显示完成的及正在做的
            List <ChapterTaskInfo> taskInfoList = new List <ChapterTaskInfo>();

            for (int i = 0; i < taskInfos.Count; ++i)
            {
                ChapterTaskInfo taskInfo = taskInfos[i];
                if (taskInfo.Status == 1 || taskInfo.Status == 2)
                {
                    taskInfoList.Add(taskInfo);
                }
            }

            //排序
            taskInfoList = taskInfoList.OrderByDescending(chapterTaskInfo => - chapterTaskInfo.Status).ToList();

            this.m_taskContainer.EnsureSize <ChapterTaskIntroComponent>(taskInfoList.Count);
            for (int i = 0; i < taskInfoList.Count; ++i)
            {
                ChapterTaskIntroComponent introComponent = this.m_taskContainer.GetChild <ChapterTaskIntroComponent>(i);
                introComponent.SetTaskIntro(taskInfoList[i].TaskId, taskInfoList[i].Status == 2);
                introComponent.Visible = true;
            }

            //m_lastChapterId = currentChapterId;
            ConfChapter chapter  = ConfChapter.Get(currentChapterId);
            List <long> deadBody = new List <long>();
            List <long> suspect  = new List <long>();
            List <long> weapon   = new List <long>();

            for (int i = 0; i < chapter.actorIds.Length; i++)
            {
                ConfNpc confNpc = ConfNpc.Get(chapter.actorIds[i]);
                if (confNpc == null)
                {
                    UnityEngine.Debug.LogError("chapter npc not exist : " + chapter.actorIds[i]);
                    continue;
                }
                bool isTaskComplete = taskInfoList.Find(s => s.TaskId == confNpc.unlockTaskId && s.Status == 2) != null || confNpc.unlockTaskId == 0;
                if (confNpc.identityType == 4 && isTaskComplete) //凶手
                {
                    suspect.Add(chapter.actorIds[i]);
                }
                else if (confNpc.identityType == 2 && isTaskComplete) //死者
                {
                    deadBody.Add(chapter.actorIds[i]);
                }
                else if (confNpc.identityType == 3 && isTaskComplete) //凶器
                {
                    weapon.Add(chapter.actorIds[i]);
                }
            }
            if (this.m_taskDead.Visible)
            {
                this.m_taskDead.SetNpcData(deadBody, 0);
            }
            if (this.m_taskSuspect.Visible)
            {
                this.m_taskSuspect.SetNpcData(suspect, 1);
            }
            if (this.m_taskWeapon.Visible)
            {
                this.m_taskWeapon.SetNpcData(weapon, 2);
            }
        }