Exemple #1
0
        /// <summary>
        /// 此主线任务是否能完成
        /// </summary>
        private static void OnCheckMainTaskCanStart(NormalTask taskInfo)
        {
            ConfTask confTask = ConfTask.Get(taskInfo.TaskConfID);

            if (confTask == null)
            {
                return;
            }

            if (confTask.building != null && confTask.building.Length > 0)
            {
                ConfBuilding building = ConfBuilding.Get(confTask.building[0]);
                if (building == null)
                {
                    return;
                }

                if (!GameEvents.BigWorld_Event.OnCheckBuildStatusByID(building.id))
                {
                    PopUpManager.OpenNormalOnePop("task_unlock_tips", LocalizeModule.Instance.GetString(building.name));
                    return;
                }
            }

            GameEntryUILogic.S_CUR_EXCUTE_TASK_ID = taskInfo.TaskConfID;
            OnExcuteTask(taskInfo);
        }
Exemple #2
0
 public override void OnShow(object param)
 {
     base.OnShow(param);
     MessageHandler.RegisterMessageHandler(MessageDefine.SCBuildingUnlockResp, OnRes);
     this.m_btnClose.AddClickCallBack(BtnClose);
     this.m_btnLock.AddClickCallBack(BtnUnLock);
     if (param != null)
     {
         buildID = (long)param;
     }
     m_confBuild = ConfBuilding.Get(buildID);
     if (m_confBuild == null)
     {
         EngineCoreEvents.UIEvent.HideUIEvent.SafeInvoke(UIDefine.UI_UNLOCK);
         return;
     }
     ShowCashAndCoin(m_confBuild.cash != 0 & m_confBuild.coin != 0);
     this.m_ImgCashSingle.Sprite = m_confBuild.cash == 0 ? "icon_mainpanel_coin_2.png" : "icon_mainpanel_cash_2.png";
     this.m_labCashSingle.Text   = m_confBuild.cash == 0 ? m_confBuild.coin.ToString():m_confBuild.cash.ToString();
     m_labCashCost.Text          = m_confBuild.cash.ToString();
     m_labCoinCost.Text          = m_confBuild.coin.ToString();
     m_buildTex.TextureName      = m_confBuild.stateName;
     m_describe.Text             = LocalizeModule.Instance.GetString(m_confBuild.descs);
     m_labName.Text = LocalizeModule.Instance.GetString(m_confBuild.name);
     m_uiEffect.EffectPrefabName = "UI_jianzhujiesuo.prefab";
     //for (int i = 0; i < this.tweener.Length; i++)
     //{
     //    this.tweener[i].ResetAndPlay();
     //}
     // m_uiEffect.Visible = true;
 }
        public static bool GetConfig(string fieldName, object fieldValue, out ConfBuilding config)
        {
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhereCondition("conf_Building", 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("Building 表找不到列={0} 值={1}的数据\n{2}", fieldName, fieldValue, ex));
                }
                config = null;
                return(false);
            }
            config = null;
            return(false);
        }
Exemple #4
0
 public static void OnReponse(object obj, NormalTask taskInfo)
 {
     if (obj is SCCanTaskResponse)
     {
         SCCanTaskResponse res = (SCCanTaskResponse)obj;
         if (res.TaskId == taskInfo.TaskConfID)
         {
             if (res.CanTask)
             {
                 GameEntryUILogic.S_CUR_EXCUTE_TASK_ID = res.TaskId;
                 OnExcuteTask(taskInfo);
             }
             else
             {
                 ConfTask confTask = ConfTask.Get(res.TaskId);
                 if (confTask == null)
                 {
                     return;
                 }
                 if (confTask.building != null && confTask.building.Length > 0)
                 {
                     ConfBuilding building = ConfBuilding.Get(confTask.building[0]);
                     if (building == null)
                     {
                         return;
                     }
                     PopUpManager.OpenNormalOnePop("task_unlock_tips", LocalizeModule.Instance.GetString(building.name));
                 }
             }
         }
     }
 }
Exemple #5
0
        public void InitCameraManager(string openUIName, bool needShowMainUI, long buildID = 1)
        {
            Transform    target       = null;
            ConfBuilding confBuilding = ConfBuilding.Get(buildID);

            if (confBuilding == null)
            {
                target = m_rootObj.transform.Find("Group001");
            }
            else
            {
                target = m_rootObj.transform.Find(confBuilding.lockResource);
            }
            SetTarget(target, openUIName, needShowMainUI);
        }
 private static void GetArrrayList()
 {
     if (cacheArray.Count <= 0)
     {
         DataTable sqReader = SQLiteHelper.Instance().GetReadFullTable("conf_Building");
         if (sqReader != null)
         {
             while (sqReader.Read())
             {
                 ConfBuilding _conf = GetConfByDic(sqReader);
                 cacheArray.Add(_conf);
                 dic[_conf.id] = _conf;
             }
             resLoaded = true;
         }
     }
 }
        public static bool GetConfig(long id, out ConfBuilding config)
        {
            if (dic.TryGetValue(id, out config))
            {
                return(config != null);
            }
            if (cacheLoaded)
            {
                config = null;
                return(false);
            }
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhere("conf_Building", 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("Building 表找不到SN={0} 的数据\n{1}", id, ex));
                }
                config = null;
                return(false);
            }
            else
            {
                config = null;
                return(false);
            }
        }
        private static ConfBuilding GetConfByDic(DataTable reader)
        {
            long   id          = reader.GetInt64(0);
            string sceneIds    = reader.GetString(1);
            string taskIds     = reader.GetString(2);
            string anchors     = reader.GetString(3);
            string descs       = reader.GetString(4);
            int    accessibles = reader.GetInt32(5);
            int    propNum     = reader.GetInt32(6);
            long   propId      = reader.GetInt64(7);
            int    coin        = reader.GetInt32(8);
            int    cash        = reader.GetInt32(9);
            long   unlockTask  = reader.GetInt64(10);
            int    unlockLevel = reader.GetInt32(11);

            string[] unlockMaterial = (string[])reader.GetArrayData(12, 12);
            string[] unlockResource = (string[])reader.GetArrayData(13, 12);
            string   lockResource   = reader.GetString(14);
            string   stateName      = reader.GetString(15);
            string   name           = reader.GetString(16);

            ConfBuilding new_obj_ConfBuilding = new ConfBuilding(id,
                                                                 sceneIds,
                                                                 taskIds,
                                                                 anchors,
                                                                 descs,
                                                                 accessibles,
                                                                 propNum,
                                                                 propId,
                                                                 coin,
                                                                 cash,
                                                                 unlockTask,
                                                                 unlockLevel,
                                                                 unlockMaterial,
                                                                 unlockResource,
                                                                 lockResource,
                                                                 stateName,
                                                                 name
                                                                 );

            return(new_obj_ConfBuilding);
        }
Exemple #9
0
        public void SetTarget(long buildID)
        {
            ConfBuilding building = ConfBuilding.Get(buildID);

            if (building == null)
            {
                return;
            }
            Transform target = m_rootObj.transform.Find(building.lockResource);

            if (target == null)
            {
                return;
            }
            Transform tranCenter = target.Find("center");

            if (tranCenter == null)
            {
                return;
            }
            BigWorldCameraManager.Instance.AddCamera();
            BigWorldCameraManager.Instance.SetTargetCamera(tranCenter);
        }
Exemple #10
0
        public BigWorldBuild(long buildId, GameObject buildObj, ParticleScale wallEffectMaterial)
        {
            this.m_BuildID        = buildId;
            this.m_buildObj       = buildObj;
            this.m_unlockMaterial = BigWorldGameObject.GetBuildCommonMatByName("UnLock.mat");
            //this.m_cacheMaterial = cacheMaterial;
            this.m_confBuild = ConfBuilding.Get(buildId);
            long[] m_sceneIDs        = CommonTools.StringToLongArray(m_confBuild.sceneIds);
            long[] m_completeTaskIDs = CommonTools.StringToLongArray(m_confBuild.taskIds);
            m_achorData   = new BuidAchorData(buildId, m_sceneIDs, m_completeTaskIDs);
            this.status   = 0;
            this.m_srcPos = buildObj.transform.position;
            //this.m_unlockMaterial = unLockMaterial;
            this.m_unLockEffect = wallEffectMaterial;
            //this.m_dimianEffectMat = dimainEffectMat;
            //Transform wallTran = buildObj.transform.Find("wall");

            //if (wallTran != null)
            //{
            //    this.m_buildWall = wallTran.gameObject;
            //    this.m_buildWall.SetActive(false);
            //}
        }
Exemple #11
0
        public void SetData(BuidAchorData achordata, bool isGuid)
        {
            //this.m_buidID = buildID;
            this.m_isGuid    = isGuid;
            this.m_achorData = achordata;
            if (this.m_achorData != null)
            {
                this.m_normalIcon.Sprite = "icon_position_type4.png";
                this.m_confBuilding      = ConfBuilding.Get(this.m_achorData.m_buidID);
                SetBuildStatus(this.m_achorData.BuildStatus);
            }
            else if (isGuid)
            {
                this.m_normalIcon.Sprite  = "icon_position_type2.png";
                this.m_normalIcon.Visible = true; //已解锁

                //this.m_lockIcon.Visible = false;  //加锁
                //this.m_canLockIcon.Visible = false; //可解锁
            }
            List <BuidTopSceneIcon> buildTopIcon = new List <BuidTopSceneIcon>();

            if (achordata != null)
            {
                for (int i = 0; i < achordata.m_enterData.Count; i++)
                {
                    this.m_sceneImg[i].SetData(achordata.m_enterData[i], i);
                    buildTopIcon.Add(this.m_sceneImg[i]);
                    //this.m_sceneImg[i].Visible = true;
                }
                buildTopIcon.Sort(SortSceneIcon);
                for (int i = 0; i < buildTopIcon.Count; i++)
                {
                    buildTopIcon[i].SetIndex(i, Mathf.Lerp(0.2f, 0.05f, i / (float)buildTopIcon.Count));
                }
            }
        }
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();
 }