Exemplo n.º 1
0
        public static bool GetConfig(string fieldName, object fieldValue, out ConfGuidArt config)
        {
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhereCondition("conf_GuidArt", 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("GuidArt 表找不到列={0} 值={1}的数据\n{2}", fieldName, fieldValue, ex));
                }
                config = null;
                return(false);
            }
            config = null;
            return(false);
        }
Exemplo n.º 2
0
        //根据挂点获取特效位置
        public static List <Vector2> getArtPos(Transform tran, ConfGuid confguid)
        {
            List <Vector2> artPos = new List <Vector2>();

            if (confguid.artIDs == null || confguid.artIDs.Length == 0)
            {
                return(artPos);
            }
            for (int i = 0; i < confguid.artIDs.Length; i++)
            {
                ConfGuidArt guidArt = ConfGuidArt.Get(confguid.artIDs[i]);

                string    btnStr  = guidArt.artAnchor.Replace(":", "/");
                Transform artTran = tran.Find(btnStr);
                if (artTran != null)
                {
                    Vector2 pos = artTran.position;
                    if (guidArt.artShift.Length == 2)
                    {
                        pos += new Vector2(guidArt.artShift[0], guidArt.artShift[1]);
                    }
                    artPos.Add(pos);
                }
            }
            return(artPos);
        }
Exemplo n.º 3
0
 private void InitArt(List <Vector2> pos, ConfGuid confGuid) //, List<string> path
 {
     m_artGrid.EnsureSize <GameUIEffect>(pos.Count);
     for (int i = 0; i < pos.Count; i++)
     {
         ConfGuidArt  guidArt  = ConfGuidArt.Get(confGuid.artIDs[i]);
         GameUIEffect uiEffect = m_artGrid.GetChild <GameUIEffect>(i);
         //uiEffect.SetRealScale(new Vector3(guidArt.artScale[0],guidArt.artScale[1],1));
         uiEffect.EffectPrefabName = guidArt.artPath;
         Vector3 localPos = GuidTools.WordToLocalPos(m_RectRoot, pos[i]);
         uiEffect.gameObject.transform.localPosition = new Vector3(localPos.x, localPos.y, 0);
         uiEffect.Visible = true;
     }
 }
Exemplo n.º 4
0
 private static void GetArrrayList()
 {
     if (cacheArray.Count <= 0)
     {
         DataTable sqReader = SQLiteHelper.Instance().GetReadFullTable("conf_GuidArt");
         if (sqReader != null)
         {
             while (sqReader.Read())
             {
                 ConfGuidArt _conf = GetConfByDic(sqReader);
                 cacheArray.Add(_conf);
                 dic[_conf.id] = _conf;
             }
             resLoaded = true;
         }
     }
 }
Exemplo n.º 5
0
        private static ConfGuidArt GetConfByDic(DataTable reader)
        {
            long   id        = reader.GetInt64(0);
            string artAnchor = reader.GetString(1);
            string artPath   = reader.GetString(2);

            float[] artShift = (float[])reader.GetArrayData(3, 13);
            float[] artScale = (float[])reader.GetArrayData(4, 13);

            ConfGuidArt new_obj_ConfGuidArt = new ConfGuidArt(id,
                                                              artAnchor,
                                                              artPath,
                                                              artShift,
                                                              artScale
                                                              );

            return(new_obj_ConfGuidArt);
        }
Exemplo n.º 6
0
        public static bool GetConfig(long id, out ConfGuidArt config)
        {
            if (dic.TryGetValue(id, out config))
            {
                return(config != null);
            }
            if (cacheLoaded)
            {
                config = null;
                return(false);
            }
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhere("conf_GuidArt", 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("GuidArt 表找不到SN={0} 的数据\n{1}", id, ex));
                }
                config = null;
                return(false);
            }
            else
            {
                config = null;
                return(false);
            }
        }
Exemplo n.º 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();
 }