Beispiel #1
0
        public static bool GetConfig(string fieldName, object fieldValue, out ConfReasoning config)
        {
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhereCondition("conf_Reasoning", 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("Reasoning 表找不到列={0} 值={1}的数据\n{2}", fieldName, fieldValue, ex));
                }
                config = null;
                return(false);
            }
            config = null;
            return(false);
        }
Beispiel #2
0
        private static ConfReasoning GetConfByDic(DataTable reader)
        {
            long id = reader.GetInt64(0);

            long[] nodes = (long[])reader.GetArrayData(1, 17);
            string descs = reader.GetString(2);
            string name  = reader.GetString(3);

            ConfReasoning new_obj_ConfReasoning = new ConfReasoning(id,
                                                                    nodes,
                                                                    descs,
                                                                    name
                                                                    );

            return(new_obj_ConfReasoning);
        }
Beispiel #3
0
 private static void GetArrrayList()
 {
     if (cacheArray.Count <= 0)
     {
         DataTable sqReader = SQLiteHelper.Instance().GetReadFullTable("conf_Reasoning");
         if (sqReader != null)
         {
             while (sqReader.Read())
             {
                 ConfReasoning _conf = GetConfByDic(sqReader);
                 cacheArray.Add(_conf);
                 dic[_conf.id] = _conf;
             }
             resLoaded = true;
         }
     }
 }
        public void InitData(ConfReasoning confReason)
        {
            this.m_confReason = confReason;
            int nodesLength = confReason.nodes.Length;

            m_centerPos = this.m_container.ContainerTemplate.GetComponent <RectTransform>().anchoredPosition;
            this.m_container.EnsureSize <ReasoningIcon>(nodesLength);
            for (int i = 0; i < nodesLength; i++)
            {
                if (i == 0)
                {
                    this.reasonContentCom.SetData(ConfNode.Get(confReason.nodes[i]));
                }
                ReasoningIcon reasonIcon = this.m_container.GetChild <ReasoningIcon>(i);
                reasonIcon.SetData(ConfNode.Get(confReason.nodes[i]), i, i == nodesLength - 1);
                reasonIcon.Visible = true;
            }
        }
Beispiel #5
0
        public static bool GetConfig(long id, out ConfReasoning config)
        {
            if (dic.TryGetValue(id, out config))
            {
                return(config != null);
            }
            if (cacheLoaded)
            {
                config = null;
                return(false);
            }
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhere("conf_Reasoning", 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("Reasoning 表找不到SN={0} 的数据\n{1}", id, ex));
                }
                config = null;
                return(false);
            }
            else
            {
                config = null;
                return(false);
            }
        }
        public override void OnShow(object param)
        {
            base.OnShow(param);
            GameEvents.UIEvents.UI_Reason_Event.OnCheckReasonItem      += OnNextReasonItem;
            GameEvents.UIEvents.UI_Reason_Event.OnGetReasonItemPosition = OnGetReasonItemPosition;
            GameEvents.UIEvents.UI_Reason_Event.OnReasonIconVisible    += OnReasonIconVisible;
            this.m_btnClose.AddClickCallBack(OnClose);
            m_currentIndex = 0;
            long          currentReasonId = (long)param;
            ConfReasoning confReason      = ConfReasoning.Get(currentReasonId);

            this.m_titleLab.Text           = LocalizeModule.Instance.GetString(confReason.name);
            this.m_currentProgressLab.Text = (m_currentIndex + 1) + "/" + confReason.nodes.Length;
            InitData(confReason);
            TimeModule.Instance.SetTimeout(() =>
            {
                reasonContentCom.PlayTween(true);
            }, 0.8f);
        }
Beispiel #7
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();
 }