Exemplo n.º 1
0
        protected void ArrivedVisitorCar(FollowPathRightAngles followPath, EntityFuncType entityFuncType)
        {
            DebugFile.GetInstance().WriteKeyFile(followPath.ownerEntity.entityID, "{0} {1} ArrivedVisitorCar",
                                                 followPath.ownerEntity.entityID, entityFuncType);

            var entity = followPath.ownerEntity as EntityVisitorCar;

            EntityManager.GetInstance().RemoveFromEntityMovables(entity);

            // 生成游客
            LogWarp.Log("car -> visistor");
            switch (entityFuncType)
            {
            case EntityFuncType.VisitorCar_EnterZoo:
                //车到了,刷下游客停车场数量
                numShowParking--;
                ShowLeftParkingNum(numShowParking);
                SpawnVisitorFromCar.Send(VisitorStage.GotoZoo, EntityFuncType.Visitor_From_Car);
#if DEBUG_VISIT
                BroadcastNum.Send((int)GameMessageDefine.BroadcastVisitorNum, numGroundParkingCar + numUnderParkingCar, 0f, 0);
                BroadcastNum.Send((int)GameMessageDefine.BroadcastMaxVisitorNum, numMaxParking, 0f, 0);
#endif
                break;

            case EntityFuncType.VisitorCar_LeaveZoo:
                break;
            }
        }
        public static PlayerData Load()
        {
            LogWarp.Log("PlayerData.Load");
            var playerData = GlobalDataManager.GetInstance().playerData;

            if (playerData == null)
            {
                LogWarp.Log("PlayerData.LoadFromPlayerPrefs");
                playerData = LoadFromPlayerPrefs();
                GlobalDataManager.GetInstance().playerData = playerData;
            }

            //playerData.playerZoo.currSceneID = GetcurrSceneIDByStar(playerData);

            //单场景数据迁移到多场景数据
            SingleSceneDataToMultiSceneData(playerData);

            //多场景数据迁移到多场景多布局
            MultiSceneDataToMultiStyleSceneData(playerData);

            //多场景多布局迁移到多种金币
            MultiStyleSceneDataToMultiCoinSceneData(playerData);

            //设置最后解锁的场景
            SetLastOpenScene(playerData);

            NewAnimalDataToPlayerAnimal_MSS_15(playerData);

            return(playerData);
        }
Exemplo n.º 3
0
        public void Start()
        {
            var pd = GlobalDataManager.GetInstance().playerData;

            if (pd.isFirstInstall)
            {
                //ThirdPartTA.Identify();
                //ThirdPartTA.StartTrack();
                //ThirdPartTA.Track(TAEventsMonitorEnum.register);
            }
            else
            {
                //ThirdPartTA.StartTrack();
            }

            //ThirdPartTA.Track(TAEventsMonitorEnum.gamestart);

            //ThirdPartTA.TrackAppInstall();
            //每次登录写last_login_time
            //LogWarp.Log("ThirdPartTA.UserSet.last_login_time");
            //var taParam = new Dictionary<string, object>();
            //taParam.Add("last_login_time", DateTime.Now);
            //ThirdPartTA.UserSet(taParam);

            LogWarp.Log("LoadingMgr.Inst.isRunning = true");
            LoadingMgr.Inst.isRunning = true;
        }
        protected void OnArrived(Message msg)
        {
            var _msg = msg as MessageArrived;

            var entity = (this.fsmCtr as FSMMachineVisitor).ownerEntity;

            //自己的entity
            if (_msg.followPath.ownerEntity.entityID != entity.entityID)
            {
                return;
            }

            //先判断走到起点
            if (_msg.followPath.isArrivedEnd && !isArrivedStartOfPath)
            {
                isArrivedStartOfPath = true;
                EntityVisitor.GodownPath(entity, pathOfGotoLittleZoo);
                return;
            }

            if (_msg.followPath.isArrivedEnd && !isArrivedLittleZoo)
            {
                LogWarp.Log("到达动物栏,准备走向等待位");
                isArrivedLittleZoo      = true;
                entity.stayBuildingID   = this.stayBuildingID;
                entity.stayGroupID      = this.stayGroupID;
                isToEnterLittleZooApply = true;
                return;
            }
        }
Exemplo n.º 5
0
        public override void Init()
        {
            mapModel.Init();
            RegistMessages();

            LogWarp.Log("-->WordlMapModule init.");
        }
Exemplo n.º 6
0
        protected void TickEnterCar(int deltaTimeMS)
        {
            if ((numUnderParkingCar + numGroundParkingCar) >= this.numMaxParking)
            {
                return;
            }

            ParkingSpace parkingSpace = null;

            this.enterCarAccumulativeTime += deltaTimeMS;
            if (this.enterCarAccumulativeTime >= this.enterCarSpawnInterval || !isSpawnEnterCar)
            {
                //保留超出部分
                this.enterCarAccumulativeTime -= this.enterCarSpawnInterval;
                //生成
                LogWarp.Log("SpawnEnterZooCar");
                parkingSpace = groundParking.GetFreeParkingSpace();
                if (parkingSpace == null)
                {
                    int currGround = GetGroundParkingNumber(playerData.GetParkingCenterDataIDIndexOfDataIdx().parkingSpaceLevel);
                    if (this.numMaxParking > currGround)
                    {
                        SpawnVisitorCar(EntityFuncType.VisitorCar_EnterZoo);
                        ++numUnderParkingCar;
                        this.isSpawnEnterCar = true;
                    }
                }
                else
                {
                    SpawnInGroundParkingCar(EntityFuncType.GroundParkingCar, parkingSpace);
                    ++numGroundParkingCar;
                    this.isSpawnEnterCar = true;
                }
            }
        }
Exemplo n.º 7
0
 public void FinishTrace()
 {
     //for (int i = 0; i < otherCtrs.Count; i++)
     //{
     //    otherCtrs[i].enabled = true;
     //}
     LogWarp.Log("相机跟随结束");
     isTrace = false;
 }
        protected void OnAddVisitorToEntryQueuePlaceHolderReply(Message msg)
        {
            var _msg = msg as AddVisitorToEntryQueuePlaceHolderReply;

            var entity = (this.fsmCtr as FSMMachineVisitor).ownerEntity;

            if (_msg.entityID != entity.entityID)
            {
                return;
            }

            //无论成功失败,都有入口ID
            entity.zooEntryID = _msg.entryID;

            DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} 在VisitorGotoZooEntry状态 收到{1}", entity.entityID, msg);
            if (!_msg.result)
            {
                LogWarp.Log("入口所有排队满了, 准备离开, 转离开");
                DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} 在VisitorGotoZooEntry状态 收到{1}入口所有排队满了, 准备离开, 转离开", entity.entityID, msg);
                this.isToVisitorStateLeaveZooEntryQueueFull = true;
                return;
            }

            isHold = true;
            Vector3        endPos         = UnityEngine.Vector3.zero;
            EntityFuncType entityFuncType = (EntityFuncType)(entity.entityFuncType);

            switch (entityFuncType)
            {
            case EntityFuncType.Visitor_From_Ship:
                entity.pathList.Clear();
                entity.pathList.Add(entity.position);
                endPos = UnityEngine.Vector3.zero;
                PathManager.GetInstance().GetPathLastPos(_msg.pathName, ref endPos);
                entity.pathList.Add(endPos);
                EntityVisitor.GodownPath(entity, entity.pathList);
                break;

            case EntityFuncType.Visitor_From_Car:
                EntityVisitor.GodownPath(entity, _msg.pathName, true);
                break;

            case EntityFuncType.Visitor_From_GroundParking:
                entity.pathList.Clear();
                entity.pathList.Add(entity.position);
                endPos = Vector3.zero;
                PathManager.GetInstance().GetPathLastPos(_msg.pathName, ref endPos);
                entity.pathList.Add(endPos);
                EntityVisitor.GodownPath(entity, entity.pathList, true);

                break;

            default:
                string e = string.Format("没有这种游客类型{0}", entityFuncType);
                throw new System.Exception(e);
            }
        }
Exemplo n.º 9
0
 public static void GotoNextPos(EntityVisitor entity, Vector3 pos)
 {
     entity.pathList.Clear();
     entity.pathList.Add(entity.position);
     entity.pathList.Add(pos);
     entity.followPath.Init(entity, entity.pathList, entity.pathList[0], 0, entity.moveSpeed, false);
     entity.followPath.Run();
     LogWarp.Log("GotoNextPos ");
 }
Exemplo n.º 10
0
    protected void InitPlayerData()
    {
        if (isUsedData)
        {
            return;
        }

        LogWarp.Log("DeleteKey");
        PlayerPrefs.DeleteKey("PlayerData");
    }
        protected void PrepareLeaveZoo(EntityVisitor entity)
        {
            LogWarp.Log("PrepareLeaveZoo");
            if (this.preStateName == (int)VisitorState.StayFirstPosInEntryQueue)
            {
                isToStateVisitorLeaveFromZooEntry = true;
                return;
            }

            isToStateVisitorLeaveNonLittleZoo = true;
        }
        public static void LoadLittleZoo(int sceneID, int littleZooID, int idx, Transform partnet, bool isUpLevelShow = true)
        {
            GlobalDataManager.GetInstance().zooGameSceneData.RemoveLoadLittleZoo(littleZooID);

            var cellBuild = Config.buildupConfig.getInstace().getCell(littleZooID);

            var cellRes = Config.resourceConfig.getInstace().getCell(cellBuild.loadresource[idx]);

            LogWarp.Log(cellRes.prefabpath);
            var goLittleZoo = ResourceManager.GetInstance().LoadGameObject(cellRes.prefabpath);

            goLittleZoo.name = littleZooID.ToString();

            if (partnet == null)
            {
                partnet = GlobalDataManager.GetInstance().zooGameSceneData.littleZooParentNode;
            }

            goLittleZoo.transform.SetParent(partnet, false);
            var pos = LittleZooPosManager.GetInstance().GetPos(littleZooID);

            goLittleZoo.transform.position = pos;
            if (idx > 0 && isUpLevelShow == true)
            {
                PlayerSimpleParticle(goLittleZoo.transform.Find("effect_node"));
                IsGuidOpenUIBuildShowPage(goLittleZoo, littleZooID);
            }
            GlobalDataManager.GetInstance().zooGameSceneData.AddLoadLittleZoo(littleZooID, goLittleZoo);

            if (littleZooID == 1001 && idx == 1)
            {
                return;
            }


            //if (idx == 1 && isUpLevelShow == true)
            //{
            //    GlobalDataManager.GetInstance().playerData.playerZoo.BuildShowTransform = goLittleZoo.transform;

            //    //PageMgr.ClosePage<UIMainPage>();
            //    MessageString.Send((int)GameMessageDefine.UIMessage_ActiveButHidePart, "UIMainPage");
            //    PageMgr.ShowPage<UIBuildShowPage>(littleZooID);  //旋转视角UI
            //    System.Action action = null;
            //    action?.Invoke();
            //    var anim = goLittleZoo.GetComponentInChildren<Animation>();
            //    if (anim != null)
            //    {
            //        SimpleAnimation buildingClickSa = new SimpleAnimation();
            //        buildingClickSa.Init(anim);
            //        buildingClickSa.Play(Config.globalConfig.getInstace().BuildClickAnim);
            //    }
            //}
        }
Exemplo n.º 13
0
        public static void ApplyPrefab(GameObject instanceRoot)
        {
            if (!Application.isPlaying)
            {
                PrefabUtility.ApplyPrefabInstance(instanceRoot, InteractionMode.AutomatedAction);
                return;
            }
            LogWarp.Log(instanceRoot.name);
            bool   retCode  = false;
            string savePath = string.Format("{0}/Resources/prefabs/{1}.prefab", Application.dataPath, instanceRoot.name);

            PrefabUtility.SaveAsPrefabAsset(instanceRoot, savePath, out retCode);
        }
        //刷新出口人数:
        void AlterValue(int number)
        {
            int idx = 0;

            for (int i = 0; i < sortEntryGateIDs.Count; i++)
            {
                if (sortEntryGateIDs[i] == number)
                {
                    idx = i;
                }
            }
            var maxnumofperqueue = Config.ticketConfig.getInstace().getCell(sortEntryGateIDs[idx]).maxnumofperqueue;
            int surplus          = maxnumofperqueue - entryGates[number].numOfQueue;//当前口剩余人数
            //LogWarp.LogError("测试  当前售票口为:"+number +"   ,当前剩余空位置为= "+ surplus);
            GameObject gewei = GlobalDataManager.GetInstance().zooGameSceneData.entryGateSenceData.EntrySubscriptGB[idx].Find("damen_shoufei/gewei").gameObject;

            //GameObject shiwei = GlobalDataManager.GetInstance().EntrySubscriptGB[number].Find("damen_shoufei/shiwei").gameObject;
            //当前count不为0   则十位隐藏
            if (entryGates[number].numOfQueue > 0)
            {
                ////十位全部隐藏  只显示0
                //for (int i = 0; i < shiwei.transform.childCount; i++)
                //{
                //    shiwei.transform.GetChild(i).gameObject.SetActive(false);
                //}
                //shiwei.transform.GetChild(0).gameObject.SetActive(true);
                //
                for (int i = 0; i < gewei.transform.childCount; i++)
                {
                    gewei.transform.GetChild(i).gameObject.SetActive(false);
                }
                if (surplus > -1 || surplus < maxnumofperqueue + 1)
                {
                    gewei.transform.GetChild(surplus).gameObject.SetActive(true);
                }
            }
            else  //没有排队的
            {
                LogWarp.Log("//没有排队的");
                //for (int i = 0; i < shiwei.transform.childCount; i++)
                //{
                //    shiwei.transform.GetChild(i).gameObject.SetActive(false);
                //}
                for (int i = 0; i < gewei.transform.childCount; i++)
                {
                    gewei.transform.GetChild(i).gameObject.SetActive(false);
                }
                //shiwei.transform.GetChild(1).gameObject.SetActive(true);
                gewei.transform.GetChild(8).gameObject.SetActive(true);
            }
        }
Exemplo n.º 15
0
        protected void GotoVisitSeat(EntityVisitor entity, int littleZooID, int indexInVisitQueue)
        {
            LogWarp.Log("GotoVisitSeat");
            DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} Play {1}", entity.entityID, Config.globalConfig.getInstace().VisitorWalk);
            entity.PlayActionAnim(Config.globalConfig.getInstace().VisitorWalk);
            var littleZooBuildinPos = LittleZooBuildinPosManager.GetInstance().GetLittleZooBuildinPos(littleZooID);
            var endPos = littleZooBuildinPos.visitPosList[indexInVisitQueue];

            entity.pathList.Clear();
            entity.pathList.Add(entity.position);
            entity.pathList.Add(endPos);
            entity.followPath.Init(entity, entity.pathList, entity.position, 0, entity.moveSpeed, false);
            entity.followPath.Run();
        }
Exemplo n.º 16
0
        protected void OnArrived(Message msg)
        {
            var _msg = msg as MessageArrived;

            //自己的entity
            if (_msg.followPath.ownerEntity.entityID != (this.fsmCtr as FSMMachineVisitor).ownerEntity.entityID)
            {
                return;
            }

            if (_msg.followPath.isArrivedEnd)
            {
                LogWarp.Log("到达观光位,准备转下一个状态,观光位 StateVisitorStayVisitSeat");
                isToStateVisitorStayVisitSeat = true;
            }
        }
        public override void Init()
        {
            freeItemAdConfig = Resources.Load <FreeItemAdConfig>("configs/free_item_ad_config");
            miscModel.Init();

            if (miscModel.freeItemAdState == FreeItemAdState.Opened ||
                miscModel.freeItemAdState == FreeItemAdState.Opening) // 热气球之前已经出现或者正在出现过程中
            {
                ShowFreeItemAdButton(true);
            }
            else
            {
                clocking = true;
            }

            LogWarp.Log("-->MiscModule init.");
        }
Exemplo n.º 18
0
        public static PlayerData Load()
        {
            LogWarp.Log("PlayerData.Load");
            var playerData = GlobalDataManager.GetInstance().playerData;

            if (playerData == null)
            {
                LogWarp.Log("PlayerData.LoadFromPlayerPrefs");
                playerData = LoadFromPlayerPrefs();
                GlobalDataManager.GetInstance().playerData = playerData;
            }

            //playerData.leftNumResetPoker = GameConst.Default_LeftNumResetPoker;
            //playerData.leftNumTips = GameConst.Default_LeftNumTips;

            return(playerData);
        }
    static void CopyEditorConfig()
    {
        string filepath = "./EditorConfig/";
        string destDir  = Application.dataPath + "/Scripts/Joyfort/Config/";
        string destPath = "";

        if (Directory.Exists(filepath))
        {
            DirectoryInfo dir = new DirectoryInfo(filepath);
            foreach (var file in dir.GetFiles())
            {
                LogWarp.Log(file.FullName);
                destPath = Path.GetFileName(file.FullName);
                destPath = destDir + destPath;
                file.CopyTo(destPath, true);
            }
        }
    }
        public void Start()
        {
            var pd = GlobalDataManager.GetInstance().playerData;

            if (pd.isFirst)
            {
            }
            else
            {
            }


            //登陆游戏时星级数量 的打点事件

            //每次登录写last_login_time
            LogWarp.Log("ThirdPartTA.UserSet.last_login_time");


            LogWarp.Log("LoadingMgr.Inst.isRunning = true");
            LoadingMgr.Inst.isRunning = true;
        }
Exemplo n.º 21
0
        public override void Init()
        {
            missionModel.Init();

            if (missionModel.isFirstGuide)
            {
                missionModel.isFirstGuide = false;
            }

            if (missionModel.currTaskId <= 0) // 从未领取当前场景的任务
            {
                ReceiveTask(missionModel.firstTaskId);
            }
            else
            {
                ReceiveTask(missionModel.currTaskId);
            }

            RegistMessages();
            inited = true;

            LogWarp.Log("-->GuideMissionModule init.");
        }
Exemplo n.º 22
0
 /// <summary>
 /// 开启新动物栏事件
 /// </summary>
 /// <param name="goname"></param>
 private void OnClickAddZool(string goname)
 {
     if (needStar <= playerStar)
     {
         //发送消息开启动物栏
         int level = GlobalDataManager.GetInstance().playerData.GetLittleZooModuleData(littleZooID).littleZooTicketsLevel;
         if (level < 1)
         {
             OpenNewLittleZoo.Send(littleZooID);
             string btnSoundPath = Config.globalConfig.getInstace().BuildOpenMusic;
             UFrame.MiniGame.SoundManager.GetInstance().PlaySound(btnSoundPath);
             this.IsHide("");
         }
         else
         {
             LogWarp.Log("UIBuildOpenPage测试:  新开启的动物栏ID" + littleZooID + ",动物栏等级" + level + ",不需要开启");
         }
     }
     else
     {
         LogWarp.Log("钱不够,新动物栏无法开启");
     }
 }
Exemplo n.º 23
0
        protected bool CalcOffline(bool forceCalc)
        {
            //Debug.LogError("CalcOffline");
            long calcDuation = (DateTime.Now.Ticks - this.calcOffineTick) / 10000000;

            if (calcDuation <= 5 && !forceCalc)
            {
                LogWarp.Log("CalcOffline FALSE calcDuation <= 5 && !forceCalc");
                return(false);
            }

            playerData = GlobalDataManager.GetInstance().playerData;

            if (playerData.playerZoo.isGuide)
            {
                //Logger.LogWarp.LogErrorFormat("playerData.playerZoo.isGuide {0}", playerData.playerZoo.isGuide);
                return(false);
            }

            var buffList = playerData.playerZoo.buffList;
            var buffs    = GetCurrBuffs();

            buffs.Clear();
            buffs.AddRange(buffList);
            double offlineSeconds = playerData.GetOfflineSecond();

            if (offlineSeconds <= 0)
            {
                //Debug.LogError("CalcOffline FALSE offlineTime <=0");
                return(false);
            }

            //if (playerData.playerZoo.buffList == null)
            //{
            //    playerData.playerZoo.buffList = new List<Buff>();
            //}

            removeBuffList.Clear();

            var offlineBuffList = new List <Buff>();

            playerData.playerZoo.offlineBuffList = offlineBuffList;
            for (int i = 0; i < buffList.Count; i++)
            {
                var buff = buffList[i];
                //构建离线buff列表
                if ((offlineSeconds > 0) &&
                    (buff.buffType == BuffType.RatioCoinInComeAdd || buff.buffType == BuffType.RatioCoinInComeMul))
                {
                    LogWarp.LogErrorFormat("构建离线buff列表");
                    //offlineTime += Config.globalConfig.getInstace().MinOfflineSecond;
                    double offlineBuffTime = Math.Min(buff.CD.cd, offlineSeconds);
                    if (offlineBuffTime > 0)
                    {
                        var offlineBuff = new Buff();
                        offlineBuff.Init(buff.buffID, offlineBuffTime);
                        //离线buff不涉及合并规则,因为离线buff来源于buff列表,已经合并过。
                        offlineBuffList.Add(offlineBuff);
                    }
                }
                //正常BUFF扣除离线时间
                buff.CD.cd -= offlineSeconds;
                if (buff.CD.cd <= 0)
                {
                    removeBuffList.Add(i);
                }
            }
            //记录要移除的buff载体
            List <Buff> removeList = new List <Buff>();

            //移除移除剩余时间<=0的buff
            for (int i = 0; i < removeBuffList.Count; i++)
            {
                int removeIdx = removeBuffList[i];
                removeList.Add(buffList[removeIdx]);
            }
            foreach (var item in removeList)
            {
                buffList.Remove(item);
            }

            calcOffineTick = DateTime.Now.Ticks;

            buffs.Clear();
            buffs.AddRange(buffList);

            GlobalDataManager.GetInstance().offlineSeconds = offlineSeconds;
            //Debug.LogError("CalcOffline TRUE");
            return(true);
        }