Exemple #1
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);
        }
Exemple #2
0
        public static bool GetConfig(string fieldName, object fieldValue, out ConfGuid config)
        {
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhereCondition("conf_Guid", 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("Guid 表找不到列={0} 值={1}的数据\n{2}", fieldName, fieldValue, ex));
                }
                config = null;
                return(false);
            }
            config = null;
            return(false);
        }
Exemple #3
0
        public override void Update()
        {
            base.Update();

            for (int i = 0; i < m_cacheGuidUI.Count; i++)
            {
                GuidUI guidUI = m_cacheGuidUI[i];
                string uiName = guidUI.GetUIName();
                if (m_OpenUI.ContainsKey(uiName))
                {
                    ConfGuid confguid = guidUI.GetCurrentConf();
                    if (confguid.hideUINode.Length > 0)
                    {
                        for (int j = 0; j < confguid.hideUINode.Length; j++)
                        {
                            if (m_OpenUI.ContainsKey(confguid.hideUINode[j]))
                            {
                                GUIFrame frame = m_OpenUI[confguid.hideUINode[j]];
                                frame.LogicHandler.OnGuidShow();
                            }
                        }
                    }
                    guidUI.OnOpenUIAction(m_OpenUI[uiName]);
                    m_removeGuidUI.Add(guidUI);
                }
            }
            for (int i = 0; i < m_removeGuidUI.Count; i++)
            {
                m_cacheGuidUI.Remove(m_removeGuidUI[i]);
            }
            m_removeGuidUI.Clear();
        }
 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;
     }
 }
Exemple #5
0
 protected bool CheckFinish()
 {
     if (m_CurConf != null && m_CurConf.nextId != 0)
     {
         ConfGuid nextConf = ConfGuid.Get(m_CurConf.nextId);
         if (nextConf != null && nextConf.isMain)
         {
             Debug.Log("start next root : " + m_CurConf.nextId);
             GuidFactory.Instance.RemoveGuidByID(m_CurConf.id);
             GuidFactory.Instance.CreateRootGuid(m_CurConf.nextId);
             return(true);
         }
         return(false);
     }
     return(true);
 }
Exemple #6
0
 private static void GetArrrayList()
 {
     if (cacheArray.Count <= 0)
     {
         DataTable sqReader = SQLiteHelper.Instance().GetReadFullTable("conf_Guid");
         if (sqReader != null)
         {
             while (sqReader.Read())
             {
                 ConfGuid _conf = GetConfByDic(sqReader);
                 cacheArray.Add(_conf);
                 dic[_conf.id] = _conf;
             }
             resLoaded = true;
         }
     }
 }
Exemple #7
0
 //即将触发的根节点
 public long GetNextRootID()
 {
     if (IsRoot())
     {
         long     nextId   = m_CurConf.nextId;
         ConfGuid nextConf = ConfGuid.Get(nextId);
         while (nextConf != null && !nextConf.isMain)
         {
             nextConf = ConfGuid.Get(nextConf.nextId);
         }
         if (nextConf != null && nextConf.isMain)
         {
             return(nextConf.id);
         }
     }
     return(-1);
 }
Exemple #8
0
        public static bool GetConfig(long id, out ConfGuid config)
        {
            if (dic.TryGetValue(id, out config))
            {
                return(config != null);
            }
            if (cacheLoaded)
            {
                config = null;
                return(false);
            }
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhere("conf_Guid", 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("Guid 表找不到SN={0} 的数据\n{1}", id, ex));
                }
                config = null;
                return(false);
            }
            else
            {
                config = null;
                return(false);
            }
        }
        //初始化加载Guid数据
        public void LoadGuid()
        {
            GuidFactory.Instance.ClearGuid();
            m_ExpireGuid.Clear();
            Debug.Log("Init Guid");
            GetCurrentProgress();

            if (m_isFinish)
            {
                Debug.Log("Guid Finish");
                return;
            }

            ModuleMgr.Instance.AddModule <GuidModule>((byte)GameModuleTypes.GUID_MODULE, true);
            List <ConfGuid> guidArray = ConfGuid.array;

            for (int i = 0; i < guidArray.Count; i++)
            {
                ConfGuid confGuid = guidArray[i];
                if (confGuid.isMain)
                {
                    bool progressStatus = GetProgressByIndex(i);
                    if (!progressStatus)
                    {
                        if (!GuidFactory.Instance.RootGuid.ContainsKey(confGuid.id))
                        {
                            AbsGuid guid = GuidFactory.Instance.CreateGuidByID((GuidEnum)confGuid.type, i, confGuid.id, confGuid.id);
                            GuidFactory.Instance.RootGuid.Add(confGuid.id, guid);
                        }
                    }
                    else
                    {
                        AbsGuid guid = GuidFactory.Instance.CreateExpireGuid((GuidEnum)confGuid.type, i, confGuid.id, confGuid.id);
                        m_ExpireGuid.Add(confGuid.id, guid);
                    }
                }
            }
            foreach (var kv in m_ExpireGuid)
            {
                GuidFactory.Instance.StartCacheGuid(kv.Value.GetNextRootID());
            }
            m_ExpireGuid.Clear();
        }
Exemple #10
0
 protected void MoveToNext()
 {
     Destory();
     if (!CheckFinish())
     {
         long     rootID   = m_RootID;
         ConfGuid confGuid = ConfGuid.Get(m_CurConf.nextId);
         if (!string.IsNullOrEmpty(confGuid.uiName))
         {
             rootID = confGuid.id;
         }
         GuidFactory.Instance.CreateGuidByID((GuidEnum)confGuid.type, m_keyID, rootID, m_CurConf.nextId);
     }
     else
     {
         //整条完成
         Debug.Log(m_RootID + "已完成" + m_CurID);
         GuidFactory.Instance.RemoveGuidByID(m_CurConf.id);
         GuidManager.Instance.SetProgressByIndex(m_keyID);
     }
 }
Exemple #11
0
        private static ConfGuid GetConfByDic(DataTable reader)
        {
            long   id            = reader.GetInt64(0);
            bool   isMain        = reader.GetBoolean(1);
            int    triggerMethod = reader.GetInt32(2);
            string uiName        = reader.GetString(3);

            int[]    maskType      = (int[])reader.GetArrayData(4, 11);
            string[] maskName      = (string[])reader.GetArrayData(5, 12);
            string[] btnName       = (string[])reader.GetArrayData(6, 12);
            int      eventPassType = reader.GetInt32(7);
            int      type          = reader.GetInt32(8);
            string   typeValue     = reader.GetString(9);
            long     nextId        = reader.GetInt64(10);

            long[] artIDs   = (long[])reader.GetArrayData(11, 17);
            bool   canBreak = reader.GetBoolean(12);
            bool   isSkip   = reader.GetBoolean(13);

            string[] hideUINode = (string[])reader.GetArrayData(14, 12);

            ConfGuid new_obj_ConfGuid = new ConfGuid(id,
                                                     isMain,
                                                     triggerMethod,
                                                     uiName,
                                                     maskType,
                                                     maskName,
                                                     btnName,
                                                     eventPassType,
                                                     type,
                                                     typeValue,
                                                     nextId,
                                                     artIDs,
                                                     canBreak,
                                                     isSkip,
                                                     hideUINode
                                                     );

            return(new_obj_ConfGuid);
        }
Exemple #12
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();
 }
Exemple #13
0
 private void SetRootID(long rootID)
 {
     this.m_RootID = rootID;
     m_RootConf    = ConfGuid.Get(this.m_RootID);
 }
Exemple #14
0
 private void SetCurrentID(long curID)
 {
     this.m_CurID = curID;
     m_CurConf    = ConfGuid.Get(this.m_CurID);
 }