Esempio n. 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);
                    }
                }
            }
Esempio n. 2
0
        public static bool GetConfig(string fieldName, object fieldValue, out ConfNpc config)
        {
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhereCondition("conf_Npc", fieldName, fieldValue);

            if (sqReader != null)
            {
                try
                {
                    sqReader.Read();
                    if (sqReader.HasRows)
                    {
                        config = GetConfByDic(sqReader);
                    }
                    else
                    {
                        config = null;
                        return(false);
                    }
                    return(true);
                }
                catch (Exception ex)
                {
                    SqliteDriver.SQLiteHelper.OnError(string.Format("Npc 表找不到列={0} 值={1}的数据\n{2}", fieldName, fieldValue, ex));
                }
                config = null;
                return(false);
            }
            config = null;
            return(false);
        }
        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;
            }
        }
Esempio n. 4
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);
        }
Esempio n. 5
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);
        }
Esempio n. 6
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();
        }
Esempio n. 7
0
 private static void GetArrrayList()
 {
     if (cacheArray.Count <= 0)
     {
         DataTable sqReader = SQLiteHelper.Instance().GetReadFullTable("conf_Npc");
         if (sqReader != null)
         {
             while (sqReader.Read())
             {
                 ConfNpc _conf = GetConfByDic(sqReader);
                 cacheArray.Add(_conf);
                 dic[_conf.id] = _conf;
             }
             resLoaded = true;
         }
     }
 }
Esempio n. 8
0
        public static bool GetConfig(long id, out ConfNpc config)
        {
            if (dic.TryGetValue(id, out config))
            {
                return(config != null);
            }
            if (cacheLoaded)
            {
                config = null;
                return(false);
            }
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhere("conf_Npc", id);

            if (sqReader != null)
            {
                try
                {
                    sqReader.Read();
                    if (sqReader.HasRows)
                    {
                        config = GetConfByDic(sqReader);
                    }
                    else
                    {
                        dic[id] = null;
                        config  = null;
                        return(false);
                    }
                    dic[id] = config;
                    return(true);
                }
                catch (Exception ex)
                {
                    SqliteDriver.SQLiteHelper.OnError(string.Format("Npc 表找不到SN={0} 的数据\n{1}", id, ex));
                }
                config = null;
                return(false);
            }
            else
            {
                config = null;
                return(false);
            }
        }
Esempio n. 9
0
        private static ConfNpc GetConfByDic(DataTable reader)
        {
            long   id                      = reader.GetInt64(0);
            long   dialogueId4             = reader.GetInt64(1);
            long   branchDescsUnlockTaskId = reader.GetInt64(2);
            string branchDescs             = reader.GetString(3);
            long   dialogueId3             = reader.GetInt64(4);
            long   caseDescsUnlockTaskId   = reader.GetInt64(5);
            string caseDescs               = reader.GetString(6);
            long   dialogueId2             = reader.GetInt64(7);
            long   backgroundUnlockTaskId  = reader.GetInt64(8);
            string background              = reader.GetString(9);
            long   dialogueId              = reader.GetInt64(10);
            string otherFeatures           = reader.GetString(11);
            string race                    = reader.GetString(12);
            string profession              = reader.GetString(13);
            string eyeColor                = reader.GetString(14);
            string shoeSize                = reader.GetString(15);
            string shape                   = reader.GetString(16);
            string weight                  = reader.GetString(17);
            string height                  = reader.GetString(18);
            string horoscope               = reader.GetString(19);
            int    sex                     = reader.GetInt32(20);
            int    age                     = reader.GetInt32(21);
            string name                    = reader.GetString(22);
            string icon                    = reader.GetString(23);
            long   unlockTaskId            = reader.GetInt64(24);
            int    identityType            = reader.GetInt32(25);
            string identity                = reader.GetString(26);
            string remarks                 = reader.GetString(27);

            ConfNpc new_obj_ConfNpc = new ConfNpc(id,
                                                  dialogueId4,
                                                  branchDescsUnlockTaskId,
                                                  branchDescs,
                                                  dialogueId3,
                                                  caseDescsUnlockTaskId,
                                                  caseDescs,
                                                  dialogueId2,
                                                  backgroundUnlockTaskId,
                                                  background,
                                                  dialogueId,
                                                  otherFeatures,
                                                  race,
                                                  profession,
                                                  eyeColor,
                                                  shoeSize,
                                                  shape,
                                                  weight,
                                                  height,
                                                  horoscope,
                                                  sex,
                                                  age,
                                                  name,
                                                  icon,
                                                  unlockTaskId,
                                                  identityType,
                                                  identity,
                                                  remarks
                                                  );

            return(new_obj_ConfNpc);
        }
Esempio n. 10
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);
            }
        }
Esempio n. 11
0
 public static void Register()
 {
     ConfAchievement.Init();
     ConfActiveDrop.Init();
     ConfActivityBase.Init();
     ConfAssetManifest.Init();
     Confbranchtask.Init();
     ConfBuilding.Init();
     ConfCartoonScene.Init();
     ConfChapter.Init();
     ConfCharge.Init();
     ConfChat.Init();
     ConfChatItem.Init();
     ConfCheckIn.Init();
     ConfCombineFormula.Init();
     ConfDemoScene.Init();
     ConfDropOut.Init();
     ConfPropGiftItem0.Init();
     ConfPropGiftItem1.Init();
     ConfPropGiftItem2.Init();
     ConfDropOut2.Init();
     Confetl.Init();
     ConfEvent.Init();
     ConfEventAttribute.Init();
     ConfEventPhase.Init();
     Confexhibit.Init();
     ConfExpToLevel.Init();
     Conffailtips.Init();
     ConfFeedback.Init();
     ConfFind.Init();
     ConfFindClue.Init();
     ConfFindTypeIcon.Init();
     ConfGMCMD.Init();
     ConfGuid.Init();
     ConfGuidArt.Init();
     ConfGuidNew.Init();
     ConfGuidNewFunction.Init();
     Confinapppurchase.Init();
     ConfJigsawScene.Init();
     ConfKeyWords.Init();
     ConfLanguage.Init();
     ConfMsgCode.Init();
     ConfNode.Init();
     ConfNpc.Init();
     ConfOfficer.Init();
     ConfPath.Init();
     ConfPoliceRankIcon.Init();
     ConfProp.Init();
     ConfPropGift.Init();
     ConfPropGiftItem0.Init();
     ConfPropGiftItem1.Init();
     ConfPropGiftItem2.Init();
     ConfPush.Init();
     ConfReasoning.Init();
     ConfScene.Init();
     ConfSceneDifficulty.Init();
     ConfSceneSpecial.Init();
     ConfServiceConfig.Init();
     ConfSkill.Init();
     ConfSkyEye.Init();
     ConfSound.Init();
     ConfTask.Init();
     ConfTitle.Init();
 }