Example #1
0
        public void PickUpItem()
        {
            if (NetClient.instance == null)
            {
                dispose();
                return;
            }

            long curMs = NetClient.instance.CurServerTimeStampMS;

            if (curMs < cantGetTimer)
            {
                return;
            }

            if (NetClient.instance != null)
            {
                if (curMs - itemdta.initedTimer < 100)
                {
                    return;
                }
            }

            if (isFake)
            {
                FightText.play(FightText.MONEY_TEXT, SelfRole._inst.getHeadPos(), itemdta.count);
                dispose();
            }
            else
            {
                //int timer = NetClient.instance.CurServerTimeStamp;
                //if (timer - lastGetTimer < 3)
                //    return;
                //lastGetTimer = timer;
                //BaseRoomItem.instance.removeDropItm(itemdta.dpid);

                if (SelfRole.fsm.Autofighting &&
                    !AutoPlayModel.getInstance().WillPick((uint)itemdta.tpid))
                {
                    return;
                }
                if (a3_BagModel.getInstance().curi <= a3_BagModel.getInstance().getItems().Count&& (
                        a3_BagModel.getInstance().getItemNumByTpid((uint)itemdta.tpid) == 0 ||
                        a3_BagModel.getInstance().getItemNumByTpid((uint)itemdta.tpid) >= a3_BagModel.getInstance().getItemDataById((uint)itemdta.tpid).maxnum) &&
                    itemdta.tpid != 0)
                {
                    flytxt.instance.fly(ContMgr.getCont("BagProxy_noplace"));
                    return;
                }
                if (itemdta.ownerId == PlayerModel.getInstance().cid || itemdta.ownerId == 0)
                {
                    if (!A3_RollModel.getInstance().rollMapping.ContainsKey(itemdta.dpid))
                    {
                        BaseRoomItem.instance.removeDropItm(itemdta.dpid, false);
                    }
                }

                MapProxy.getInstance().sendPickUpItem(itemdta.dpid);
            }
        }
Example #2
0
        public void onGotoCity(GameObject go)
        {
            if (!FindBestoModel.getInstance().Canfly)
            {
                flytxt.instance.fly(FindBestoModel.getInstance().nofly_txt);
                InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP);
                return;
            }
            cd.updateHandle = worldmapsubwin.onCD;

            GameObject goeff = GameObject.Instantiate(EFFECT_CHUANSONG1) as GameObject;

            goeff.transform.SetParent(SelfRole._inst.m_curModel, false);

            cd.show(() =>
            {
                MapProxy.getInstance().sendBeginChangeMap(0, true);
            },
                    2.8f, false,
                    () =>
            {
                Destroy(goeff);
            }

                    );
            InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP);
        }
 private void OnBackRespawn(GameObject go)
 {
     MapProxy.getInstance().sendRespawn(false);
     //PlayerModel.getInstance().c
     if (MapModel.getInstance().curLevelId == 108 || MapModel.getInstance().curLevelId == 109 || MapModel.getInstance().curLevelId == 110 || MapModel.getInstance().curLevelId == 111)
     {
         TeamProxy.getInstance().SendLeaveTeam(PlayerModel.getInstance().cid);
     }
 }
 private void OnGoldRespawn(GameObject go)
 {
     if (here_time > 0 && PlayerModel.getInstance().gold < 20)
     {
         flytxt.instance.fly(ContMgr.getCont("a3_relive_nolive"));
         recharge.SetActive(true);
         return;
     }
     MapProxy.getInstance().sendRespawn(true);
 }
Example #5
0
 public void CollectAllDrops1()
 {
     if (dDropItem != null)
     {
         foreach (var v in dDropItem.Keys)
         {
             removeDropItm(v, false);
             MapProxy.getInstance().sendPickUpItem(v);
         }
     }
 }
Example #6
0
        void onClick()
        {
            if (hasSend == true)
            {
                return;
            }
            MapProxy.getInstance().sendRespawn(true);
            hasSend = true;

            //SelfRole._inst.onRelive();
            //InterfaceMgr.getInstance().close("relive");
        }
Example #7
0
        void refresh()
        {
            int cd = (int)(curCd - Time.time);

            if (cd <= 0 && hasSend == false)
            {
                hasSend = true;
                MapProxy.getInstance().sendRespawn();
                //InterfaceMgr.getInstance().close(InterfaceMgr.RELIVE);
                return;
            }

            txt.text = cd + "";
        }
Example #8
0
        protected override void onTrigger()
        {
            Variant v = SvrMapConfig.instance.getSingleMapConf(mapid);

            int lvup = 0;

            if (v.ContainsKey("lv_up"))
            {
                lvup = v["lv_up"];
            }

            int lv = 0;

            if (v.ContainsKey("lv"))
            {
                lv = v["lv"];
            }

            if (lvup > PlayerModel.getInstance().up_lvl)
            {
                flytxt.instance.fly(ContMgr.getCont("comm_nolvmap", lvup.ToString(), lv.ToString(), v["map_name"]));
                return;
            }
            else if (lvup == PlayerModel.getInstance().up_lvl)
            {
                if (lv > PlayerModel.getInstance().lvl)
                {
                    flytxt.instance.fly(ContMgr.getCont("comm_nolvmap", lvup.ToString(), lv.ToString(), v["map_name"]));
                    return;
                }
            }

            loading_cloud.showIt(() =>
            {
                if (is_need_stop_fsm)
                {
                    SelfRole.fsm.Stop();
                    is_need_stop_fsm = false;
                }

                a1_gamejoy.inst_joystick.stop();
                MapProxy.getInstance().changingMap = true;

                PlayerModel.getInstance().mapBeginroatate = faceto;

                MapProxy.getInstance().sendBeginChangeMap(id);
            });
        }
        override public void init()
        {
            MapProxy.getInstance();
            g_mgr.regRPCProcesser(PKG_NAME.S2C_FCM_NOTIFY, fcm_notify.create);
            // g_mgr.regRPCProcesser(PKG_NAME.S2C_PK_STATE_CHANGE, pk_state_change.create);
            g_mgr.regRPCProcesser(PKG_NAME.S2C_PK_V_CHANGE, pk_v_change.create);
            g_mgr.regRPCProcesser(PKG_NAME.S2C_LINE_CHANGE, line_change.create);
            g_mgr.regRPCProcesser(PKG_NAME.S2C_GAIN_ACHIVE, gain_achive.create);
            //g_mgr.regRPCProcesser(PKG_NAME.S2C_CUR_ARCHIVE_CHANGE, cur_archive_change.create);
            g_mgr.regRPCProcesser(PKG_NAME.S2C_GET_ACHIVES_RES, get_achives_res.create);
            g_mgr.regRPCProcesser(PKG_NAME.S2C_LINE_INFO_RES, line_info_res.create);
            g_mgr.regRPCProcesser(PKG_NAME.S2C_JOIN_WORLD_RES, onJoinWorldRes.create);
            //  g_mgr.regRPCProcesser(PKG_NAME.S2C_ON_CLIENT_CONFIG, on_client_config.create);

            //g_mgr.regRPCProcesser(PKG_NAME.S2C_ON_ERR_MSG, on_err_msg.create);
        }
Example #10
0
        private void setChangeMapData(uint scene_setting_mapid, Variant svrConf, Variant localConf_TO_DEL)
        {
            changeMapTimeSt = NetClient.instance.CurServerTimeStamp;
            curSvrConf      = svrConf;
            InterfaceMgr.doCommandByLua("MapModel:getInstance().getmapinfo", "model/MapModel", curSvrConf);
            debug.Log("C#1::::" + svrConf.dump());
            MediaClient.instance.StopSounds(); //清理所有的音效缓存
            GAMEAPI.ClearAllOneAsset();
            Resources.UnloadUnusedAssets();
            System.GC.Collect(0, System.GCCollectionMode.Forced);

            if (sdk_sendroleLogin)
            {
                sdk_sendroleLogin = false;
                //     LGPlatInfo.inst.logSDKAP("roleLogin");
            }

            MouseClickMgr.init();


            int local_mapid = svrConf["id"]._int;

            //m_nCurMapSceneSettingID = scene_setting_mapid;
            m_nCurMapID = local_mapid;

            bool isFb = false;
            int  idx  = -1;

            for (int i = 0; i < AutoPlayModel.getInstance().autoplayCfg4FB.Count; i++)
            {
                if (AutoPlayModel.getInstance().autoplayCfg4FB[i].map.Contains(m_nCurMapID))
                {
                    isFb = true;
                    idx  = i;
                    break;
                }
            }
            if (isFb)
            {
                if (idx != -1)
                {
                    StateInit.Instance.Distance     = AutoPlayModel.getInstance().autoplayCfg4FB[idx].Distance;
                    StateInit.Instance.PickDistance = AutoPlayModel.getInstance().autoplayCfg4FB[idx].DistancePick;
                }
            }
            else
            {
                StateInit.Instance.Distance     = StateInit.Instance.DistanceNormal;
                StateInit.Instance.PickDistance = StateInit.Instance.PickDistanceNormal;
            }
            //m_CurLocalConf = localConf;
            InterfaceMgr.getInstance().closeAllWin();

            if (MapProxy.getInstance().openWin != null && MapProxy.getInstance().openWin != "")
            {
                if (MapProxy.getInstance().Win_uiData != null && MapProxy.getInstance().Win_uiData != "")
                {
                    ArrayList arr = new ArrayList();
                    arr.Add(MapProxy.getInstance().Win_uiData);
                    InterfaceMgr.getInstance().ui_async_open(MapProxy.getInstance().openWin, arr);
                }
                else
                {
                    InterfaceMgr.getInstance().ui_async_open(MapProxy.getInstance().openWin);
                }
                MapProxy.getInstance().openWin    = null;
                MapProxy.getInstance().Win_uiData = null;
            }
            //combo_txt.clear();


            //TaskModel.getInstance().isSubTask = false;
            LEVEL_PLOT_ID = 0;
            REV_RES_LIST_OK();
            REV_PLOT_PLAY_OVER();
        }
        public override void Execute(float delta_time)
        {
            if (waitTick > 0)
            {
                waitTick--;
                return;
            }

            if (MapProxy.getInstance().changingMap)
            {
                return;
            }
            if (SelfRole._inst?.m_moveAgent == null)
            {
                return;
            }
            refredshPos();

            if (waitTick > 0)
            {
                waitTick--;
                return;
            }
            SelfRole._inst.m_curAni?.SetBool(EnumAni.ANI_RUN, true);
            SelfRole.ChangeRideAniState(true);
            if (line.Count == 0)
            {
                Vector3 v = SelfRole._inst.m_moveAgent.destination.ConvertToGamePosition();

                float dis = Vector3.Distance(SelfRole._inst.m_curModel.position.ConvertToGamePosition(), v);//SelfRole._inst.m_moveAgent.remainingDistance;
                if (dis <= SelfRole.fsm.StopDistance)
                {
                    SelfRole._inst?.m_moveAgent?.ResetPath();
                    SelfRole._inst?.m_moveAgent?.Stop();
                    if (handle != null)
                    {
                        handle();
                    }
                    SelfRole.fsm.ChangeState(StateIdle.Instance);


                    return;
                }



                thinktime += delta_time;
                if (thinktime > 1)
                {
                    thinktime = 0;
                    if (dis < 5f)
                    {
                        Quaternion rot = Quaternion.LookRotation(SelfRole._inst.m_curModel.forward - pos.normalized);
                        if (rot.eulerAngles.y > 10f)
                        {
                            SelfRole._inst?.TurnToPos(pos);
                        }
                    }
                }
            }
        }
Example #12
0
 private void OnStoneRespawn(GameObject go)
 {
     MapProxy.getInstance().sendRespawn(true);
 }
Example #13
0
        private void a3_scene_loaded()
        {
            MapProxy.getInstance().changingMap = false;

            if (!grmap_loading)
            {
                return;
            }

            //   PlayerNameUIMgr.getInstance().Clear();

            //清空音效
            //MediaClient.instance.clearMusic();

            SceneCamera.Init();
            if (SelfRole._inst != null)
            {
                SelfRole._inst.dispose();
            }

            debug.Log("初始化角色");
            SelfRole.Init();

            SelfRole._inst.m_unIID             = PlayerModel.getInstance().iid;
            SelfRole._inst.m_curModel.position = PlayerModel.getInstance().enter_map_pos;
            SelfRole._inst.setNavLay(NavmeshUtils.listARE[1]);
            //debug.Log("地图加载后的坐标为" + SelfRole._inst.m_curModel.position);


            Time.fixedDeltaTime = 0.02f;

            GameObject svr = GameObject.Find("SVR_DATA");

            if (svr != null)
            {
                GameObject.Destroy(svr);
            }

            //主城添加一个z轴的18高度,防止初始化判断在阻挡外面。加了高度后虽然在阻挡外面,但hit返回的xy值正常,z值调整为正常
            float z = 0f;

            if (curSvrConf["id"] == 10 || GRMap.curSvrConf["id"] == 24)
            {
                z = 18f;
            }
            SelfRole._inst.setPos(new Vector3(PlayerModel.getInstance().mapBeginX, z, PlayerModel.getInstance().mapBeginY));

            if (PlayerModel.getInstance().mapBeginroatate > 0f)
            {
                SelfRole._inst.setRoleRoatate(PlayerModel.getInstance().mapBeginroatate);
                PlayerModel.getInstance().mapBeginroatate = 0f;
            }

            DoAfterMgr.instacne.addAfterRender(() =>
            {
                if (MapModel.getInstance().CheckAutoPlay())
                {
                    SelfRole.fsm.StartAutofight();
                }
            });


            GameRoomMgr.getInstance().onChangeLevel(curSvrConf, curSvrMsg);
            grmap_loading = false;

            if (!fristloaded)
            {
                if (showid.Contains(curSvrConf["id"]))
                {
                    InterfaceMgr.getInstance().close(InterfaceMgr.A3_PKMAPUI);
                }
                else
                {
                    if (curSvrConf.ContainsKey("pk_hint") && curSvrConf["pk_hint"] == 1)
                    {
                        InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_PKMAPUI);
                        showid.Add(curSvrConf["id"]);
                    }
                    else
                    {
                        InterfaceMgr.getInstance().close(InterfaceMgr.A3_PKMAPUI);
                    }
                }
            }
            //打开魔炼之地
            if (a3_fb_finish.ismlzd)
            {
                ArrayList dl = new ArrayList();
                dl.Add("mlzd");
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ACTIVE, dl);
                a3_fb_finish.ismlzd = false;
            }
            if (curSvrConf.ContainsKey("pk_lock"))
            {
                InterfaceMgr.doCommandByLua("a1_low_fightgame.refreskCanPk", "ui/interfaces/low/a1_low_fightgame", false);
            }
            else
            {
                InterfaceMgr.doCommandByLua("a1_low_fightgame.refreskCanPk", "ui/interfaces/low/a1_low_fightgame", true);
            }

            if (a1_gamejoy.inst_skillbar != null)
            {
                if (GRMap.curSvrConf["id"] == 10 || GRMap.curSvrConf["id"] == 24)
                {
                    a1_gamejoy.inst_skillbar.ShowCombatUI(false);
                }
                else
                {
                    a1_gamejoy.inst_skillbar.ShowCombatUI(true);
                }
            }

            if (a3_liteMinimap.instance)
            {
                a3_liteMinimap.instance.refreshMapname();
            }
            InterfaceMgr.doCommandByLua("a1_high_fightgame.refreshMapname", "ui/interfaces/high/a1_high_fightgame", null);

            if (a1_gamejoy.inst_skillbar != null)
            {
                a1_gamejoy.inst_skillbar.refreshAllSkills(SelfRole.s_bStandaloneScene ? 0 : -1);
            }

            if (curSvrConf.ContainsKey("music"))
            {
                MediaClient.instance.PlayMusicUrl("audio_map_" + curSvrConf["music"], null, true);
            }

            fristloaded = false;

            OtherPlayerMgr._inst.onMapLoaded();
            MonsterMgr._inst.onMapLoaded();
            NpcMgr.instance.onMapLoaded();
            BattleProxy.getInstance().onMapLoaded();
        }
Example #14
0
        private bool onTrigger()
        {
            //if (type == 0)//切地图
            //{
            //    SelfRole._inst.canMove = false;
            //    SelfRole._inst.StopMove();
            //    loading_cloud.showhandle = changemap;
            //    InterfaceMgr.getInstance().open(InterfaceMgr.LOADING_CLOUD);
            //}
            //else if(type==1)//显示隐藏物件
            //{
            //    int idx = 0;
            //    foreach (GameObject go in paramGameobjects)
            //    {
            //        if (idx % 2 == 0)
            //        {
            //            if (go != null)
            //                go.SetActive(true);
            //        }
            //        else
            //        {
            //            if (go != null)
            //                go.SetActive(false);
            //        }

            //        idx++;
            //    }
            //}
            //else if (type == 2)//触发

            if (type == 0)
            {
                for (int i = 0; i < transform.childCount; i++)
                {
                    TriggerHanldePoint hd = transform.GetChild(i).GetComponent <TriggerHanldePoint>();
                    if (hd != null)
                    {
                        hd.onTriggerHanlde();
                    }
                }

                return(true);
                //foreach (GameObject go in paramGameobjects)
                //{
                //    TriggerHanldePoint hd = go.GetComponent<TriggerHanldePoint>();
                //    if (hd != null)
                //        hd.onTriggerHanlde();
                //}
            }
            else if (type == 1)//svr地图跳转
            {
                if (paramInts.Count == 0)
                {
                    return(true);
                }

                Variant v = SvrMapConfig.instance.getSingleMapConf((uint)paramInts[0]);

                if (v.ContainsKey("lv_up") && v["lv_up"] > PlayerModel.getInstance().up_lvl)
                {
                    flytxt.instance.fly(ContMgr.getCont("comm_nolvmap", v["lv_up"], v["lv"]), v["map_name"]);
                    return(false);
                }

                if (v.ContainsKey("lv") && v["lv"] > PlayerModel.getInstance().lvl)
                {
                    flytxt.instance.fly(ContMgr.getCont("comm_nolvmap", v["lv_up"], v["lv"]), v["map_name"]);
                    return(false);
                }


                loading_cloud.showIt(() =>
                {
                    MapProxy.getInstance().sendBeginChangeMap(paramInts[0]);
                });

                return(true);
            }

            return(true);
        }
        void onmoneyclick(GameObject go)
        {
            if (!FindBestoModel.getInstance().Canfly) //宝图活动战斗状态禁止传送
            {
                flytxt.instance.fly(FindBestoModel.getInstance().nofly_txt);
                InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP);
                InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP_SUB);
                return;
            }
            if (PlayerModel.getInstance().money < needMoney)
            {
                flytxt.instance.fly(ContMgr.getCont("comm_nomoney"));
            }
            else
            {
                float dis = Vector3.Distance(SelfRole._inst.m_curModel.position, new Vector3(xml.getFloat("ux"), SelfRole._inst.m_curModel.position.y, xml.getFloat("uy")));
                //  debug.Log(":::::" + dis);
                toid = id;
                if (mapid == GRMap.instance.m_nCurMapID && dis < AREA)
                {
                    GameObject goeff = GameObject.Instantiate(worldmap.EFFECT_CHUANSONG1) as GameObject;
                    goeff.transform.SetParent(SelfRole._inst.m_curModel, false);
                    MsgBoxMgr.getInstance().showConfirm(ContMgr.getCont("worldmap_tooclose"), () =>
                    {
                        cd.updateHandle = onCD;
                        cd.show(() =>
                        {
                            MapProxy.getInstance().sendBeginChangeMap(toid, true);
                        }, 2.8f, false,
                                () =>
                        {
                            Destroy(goeff);
                        }
                                );
                        InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP);
                        InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP_SUB);
                        if (a3_active.onshow)
                        {
                            InterfaceMgr.getInstance().close(InterfaceMgr.A3_ACTIVE);
                        }
                    });
                }
                else
                {
                    cd.updateHandle = onCD;
                    GameObject goeff = GameObject.Instantiate(worldmap.EFFECT_CHUANSONG1) as GameObject;
                    goeff.transform.SetParent(SelfRole._inst.m_curModel, false);
                    cd.show(() =>
                    {
                        MapProxy.getInstance().sendBeginChangeMap(toid, true);
                    }, 2.8f, false,
                            () =>
                    {
                        Destroy(goeff);
                    }
                            );

                    InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP);
                    InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP_SUB);
                    if (a3_active.onshow)
                    {
                        InterfaceMgr.getInstance().close(InterfaceMgr.A3_ACTIVE);
                    }
                }
            }



            //InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP);
            //InterfaceMgr.getInstance().close(InterfaceMgr.WORLD_MAP_SUB);
        }
        private float refreshTime           = 2000;//刷新时间

        public void onProcess(float tmSlice)
        {
            if (recordTimer > 0)
            {
                if (UnityEngine.Time.time > recordTimer)
                {
                    //   LGPlatInfo.inst.logSDKCustomAP("run");
                    recordTimer = 0;
                }
            }

            if (!isShowAll)
            {
                GameTools.PrintNotice(" !isShowAll ");
                return;
            }


            if (TRY_SHOW_MAP_OBJ)
            {
                if (TO_LEVEL)
                {
                    TRY_SHOW_MAP_OBJ = false;
                }
                else
                {
                    waitShowMapObj++;
                    if (waitShowMapObj < 5)
                    {
                        return;
                    }



                    TRY_SHOW_MAP_OBJ = false;
                    waitShowMapObj   = 0;
                    MapProxy.getInstance().sendShowMapObj();
                }
            }

            if (CHECK_MAPLOADING_LAYER && LoaderBehavior.ms_HasAllLoaded)
            {
                CHECK_MAPLOADING_LAYER = false;
                if (FIRST_IN_GAME)
                {
                    // MapProxy.getInstance().sendShowMapObj();
                    FIRST_IN_GAME = false;

                    if (login.instance)
                    {
                    }
                    else
                    {
                        if (maploading.instance != null)
                        {
                            maploading.instance.closeLoadWait(0.2f);
                        }
                        //    LGPlatInfo.inst.logSDKCustomAP("load");

                        if (a3_mapname.instance)
                        {
                            a3_mapname.instance.refreshInfo();
                        }
                    }

                    recordTimer = UnityEngine.Time.time + 300;
                }
                else
                {
                    //    InterfaceMgr.getInstance().open(InterfaceMgr.LOADING_CLOUD);
                }

                //if (GRMap.HasNoWaitPlotSound())
                //{
                //GRMap.ClearWaitPlotSound();

                //请求播放剧情
                if (loading_cloud.instance == null)
                {
                    //gameST.REQ_PLAY_PLOT();
                }
                else
                {
                    //loading_cloud.instance.hide(gameST.REQ_PLAY_PLOT);
                    loading_cloud.instance.hide(null);
                }
                //}
            }
        }
Example #17
0
        public override void onShowed()
        {
            if (room is MLZDRoom)
            {
                //打开活动界面
                ismlzd = true;
            }

            InterfaceMgr.getInstance().closeAllWin();
            a3_insideui_fb.instance?.enter_pic2.SetActive(false);
            jjc.SetActive(false);
            jdzc.SetActive(false);
            cityWAr.SetActive(false);
            ar_result.SetActive(false);
            getGameObjectByPath("win/success").SetActive(false);
            getGameObjectByPath("state_successed").SetActive(false);
            transform.FindChild("state_successed/bg/goldNum").gameObject.SetActive(false);
            transform.FindChild("state_successed/bg/getNum").gameObject.SetActive(false);
            tip_text.SetActive(true);
            bgdefet.SetActive(false);
            bgwin.SetActive(false);
            yiwufb_defet.SetActive(false);
            //  closefb_way = false;
            transform.FindChild("btn_close/closeTime").gameObject.SetActive(false);
            //createAvatar();
            closetime  = 0;
            close_time = 0;
            Variant data = (Variant)uiData[0];

            if (data.ContainsKey("ltpid"))
            {
                ltpid = data["ltpid"];
            }
            if (data.ContainsKey("score"))
            {
                score = data["score"];
            }
            else
            {
                score = 0;
            }

            if (data.ContainsKey("close_tm"))
            {
                double ct = data["close_tm"];
                closetime = ct;
            }
            if (data.ContainsKey("win"))
            {
                int ct = data["win"];

                Transform wint = getTransformByPath("win");
                wint.gameObject.SetActive(true);
                if (ct > 0 && wint != null)
                {
                    wint.FindChild("success").gameObject.SetActive(true);
                    wint.FindChild("fail").gameObject.SetActive(false);
                }
                else if (wint != null)
                {
                    closeWindow();
                    // InterfaceMgr.getInstance().floatUI.localScale = Vector3.zero;
                    if (GameObject.Find("GAME_CAMERA/myCamera"))
                    {
                        GameObject cameraOBJ = GameObject.Find("GAME_CAMERA/myCamera");
                        if (!cameraOBJ.GetComponent <DeathShader>())
                        {
                            cameraOBJ.AddComponent <DeathShader>();
                        }
                        else
                        {
                            cameraOBJ.GetComponent <DeathShader>().enabled = true;
                        }
                    }
                    wint.FindChild("success").gameObject.SetActive(false);
                    wint.FindChild("fail").gameObject.SetActive(true);


                    getGameObjectByPath("state_successed").SetActive(false);
                }
                if (data.ContainsKey("item_drop"))
                {
                    ct = data["item_drop"]._arr.Count;
                }
                else
                {
                    ct = 0;
                }
                if (ct >= 0)
                {
                    getGameObjectByPath("state_successed").SetActive(true);
                    //getGameObjectByPath("state_failed").SetActive(false);

                    finishTiem = getComponentByPath <Text>("state_successed/bg/fnTime/time");
                    kmNum      = getComponentByPath <Text>("state_successed/bg/kmNum/num");
                    getNum     = getComponentByPath <Text>("state_successed/bg/getNum/num");
                    goldNum    = getComponentByPath <Text>("state_successed/bg/goldNum/num");
                }
                else
                {
                    getGameObjectByPath("state_successed").SetActive(false);
                    //getGameObjectByPath("state_failed").SetActive(true);
                    //finishTiem = getComponentByPath<Text>("state_failed/bg/fnTime/time");
                    //kmNum = getComponentByPath<Text>("state_failed/bg/kmNum/num");
                    //getNum = getComponentByPath<Text>("state_failed/bg/getNum/num");
                    //goldNum = getComponentByPath<Text>("state_failed/bg/goldNum/num");
                }
            }

            finishtime = 0;
            if (uiData.Count > 1)
            {
                finishtime = (double)uiData[1];
            }
            //TimeSpan ts = new TimeSpan(0, 0, (int)finishtime);

            float tss = 0;
            uint  tkn = 0, ten = 0, tgn = 0;
            int   ach = 0, mon = 0;

            DOTween.To(() => tss, (float s) =>
            {
                TimeSpan ts     = new TimeSpan(0, 0, (int)s);
                finishTiem.text = (int)ts.TotalHours + ":" + (int)ts.Minutes + ":" + (int)ts.Seconds;
            }, (float)finishtime, 1f);

            evaluation(score);

            kmnum = 0;
            if (uiData.Count > 2)
            {
                kmnum = (int)uiData[2];
            }
            DOTween.To(() => (int)tkn, (int s) =>
            {
                tkn        = (uint)s;
                kmNum.text = tkn.ToString();
            }, kmnum, 1f);


            if (room is MoneyRoom)
            {
                if (room != null)
                {
                    transform.FindChild("state_successed/bg/goldNum").gameObject.SetActive(true);
                }
            }


            if (room is ExpRoom)
            {
                if (room != null)
                {
                    transform.FindChild("state_successed/bg/getNum").gameObject.SetActive(true);
                }
            }
            //if (room != null)
            //{
            //    goldnum = room.goldnum;
            //}
            //DOTween.To(() => tgn, (uint s) =>
            //{
            //    tgn = s;
            //    goldNum.text = tgn.ToString();
            //}, goldnum, 1f);

            //}


            if (room is PVPRoom)
            {
                if (room != null)
                {
                    getach = room.getach;
                }
                DOTween.To(() => ach, (int s) =>
                {
                    ach         = s;
                    getNum.text = ach.ToString();
                }, getach, 1f);

                if (room != null)
                {
                    getmoney = room.getExp;
                }
                DOTween.To(() => mon, (int s) =>
                {
                    mon          = s;
                    goldNum.text = mon.ToString();
                }, getmoney, 1f);

                MapProxy.getInstance().Win_uiData = "sports_jjc";
                MapProxy.getInstance().openWin    = InterfaceMgr.A3_SPORTS;
            }
            else
            {
                if (room != null)
                {
                    getnum = room.expnum;
                }
                DOTween.To(() => ten, (uint s) =>
                {
                    ten         = s;
                    getNum.text = ten.ToString();
                }, getnum, 1f);
                if (room != null)
                {
                    //goldnum = room.goldnum;
                    goldnum = a3_insideui_fb.AllMoneynum;
                }
                DOTween.To(() => tgn, (uint s) =>
                {
                    tgn          = s;
                    goldNum.text = tgn.ToString();
                }, goldnum, 1f);
            }
            //if (data.ContainsKey("ltpid")) {
            //    int tid = data["ltpid"];
            //    if (tid == 101) {
            //        getNum.text = "获得经验量:" + getnum;
            //    }
            //    else if (tid == 102) {
            //        getNum.text = "获得金币量:" + getnum;
            //    }
            //}
            _NewOne     = true;
            instance    = this;
            room.getExp = 0;
            room.getach = 0;

            Variant d = SvrLevelConfig.instacne.get_level_data(ltpid);

            if (data["win"] == 0 || room is PVPRoom || d.ContainsKey("shengwu") || room is PlotRoom || room is ExpRoom || room is MoneyRoom || room is FSWZRoom || room is MLZDRoom || room is JDZCRoom || room is CityWarRoom)
            {
                a3_liteMinimap.instance?.taskinfo?.SetActive(true);
                a3_insideui_fb.instance?.enter_pic2?.SetActive(false);

                LevelProxy.getInstance().open_pic = false;
                closefb_way = true;
                //InterfaceMgr.getInstance().close(InterfaceMgr.TARGET_HEAD);
            }
            else
            {
                closefb_way = false;
            }


            if (closefb_way == true)
            {
                close_time = 0;
                transform.FindChild("btn_close/closeTime").gameObject.SetActive(true);
            }
            if (closefb_way == false)
            {
                close_time = (double)closetime - (double)muNetCleint.instance.CurServerTimeStamp - 3;
                transform.FindChild("btn_close/closeTime").gameObject.SetActive(false);
            }

            if (d.ContainsKey("shengwu") && d.ContainsKey("icon"))
            {
                shengwu = d["shengwu"];
                icon    = d["icon"];
                if (data["win"] == 0)
                {
                    jjc.SetActive(false);
                    jdzc.SetActive(false);
                    cityWAr.SetActive(false);
                    ar_result.SetActive(false);
                    getGameObjectByPath("win").SetActive(false);
                    getGameObjectByPath("win/success").SetActive(false);
                    getGameObjectByPath("state_successed").SetActive(false);
                    transform.FindChild("state_successed/bg/goldNum").gameObject.SetActive(false);
                    bgdefet.SetActive(false);
                    bgwin.SetActive(false);
                    yiwufb_defet.SetActive(true);
                    return;
                }
            }
            else
            {
                shengwu = 0;
            }
            if (data["win"] == 1 && d.ContainsKey("shengwu") && d.ContainsKey("des"))
            {
                icon1 = d["des"];
                string[] codess = icon1.Split(',');
                // SXML xml = XMLMgr.instance.GetSXML("accent_relic.relic", "type=="+codess[0].ToString());
                //mid = xml.getUint("obj");
                List <SXML> listSxml = null;
                if (listSxml == null)
                {
                    listSxml = XMLMgr.instance.GetSXMLList("accent_relic.relic");
                    //List<SXML> xml2 = XMLMgr.instance.GetSXMLList("accent_relic.relic", "carr=="+ PlayerModel.getInstance().profession);     , "carr==" + PlayerModel.getInstance().profession
                    for (int i = 0; i < listSxml.Count; i++)
                    {
                        if (listSxml[i].getInt("carr") == PlayerModel.getInstance().profession&& listSxml[i].getString("type") == codess[0].ToString())
                        {
                            List <SXML> god_id = listSxml[i].GetNodeList("relic_god", "id==" + codess[1].ToString());
                            {
                                foreach (SXML x in god_id)
                                {
                                    text1.text = x.getString("des1");
                                    text2.text = x.getString("des2");
                                }
                            }
                        }
                    }
                }



                //foreach (SXML x in xml)
                //{
                //    if (x.getString("id") == codess[1])
                //    {
                //        text1.text = x.getString("des1");
                //        text2.text = x.getString("des2");
                //    }
                // }


                //    if (xml.getInt("carr") == PlayerModel.getInstance().profession)
                //{

                //    text1.text = xml.getString("des1");
                //    text2.text = xml.getString("des2");

                //}
            }



            if (shengwu == 1)
            {
                ar_result.SetActive(true);
                string[] codes = icon.Split(',');
                if (PlayerModel.getInstance().profession == 2)
                {
                    pic_icon.transform.GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_ar_" + codes[0]);
                }
                if (PlayerModel.getInstance().profession == 3)
                {
                    pic_icon.transform.GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_ar_" + codes[1]);
                }
                if (PlayerModel.getInstance().profession == 5)
                {
                    pic_icon.transform.GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_ar_" + codes[2]);
                }

                bgwin.SetActive(false);
                getGameObjectByPath("win").SetActive(false);
                getGameObjectByPath("win/success").SetActive(false);
                transform.FindChild("state_successed").gameObject.SetActive(false);
                jjc.SetActive(false);
                jdzc.SetActive(false);
                cityWAr.SetActive(false);
            }
            jjc.SetActive(false);
            jdzc.SetActive(false);
            cityWAr.SetActive(false);
            if (room is PVPRoom)
            {
                jjc.SetActive(false);
                ar_result.SetActive(false);
                getGameObjectByPath("win").SetActive(false);
                getGameObjectByPath("state_successed").SetActive(false);
                bgdefet.SetActive(false);
                bgwin.SetActive(false);
                if (data.ContainsKey("win"))
                {
                    int cct = data["win"];
                    if (cct == 0)
                    {
                        jjc.SetActive(true);
                        jjc.transform.FindChild("vector").gameObject.SetActive(false);
                        jjc.transform.FindChild("defet").gameObject.SetActive(true);
                    }
                    else
                    {
                        jjc.SetActive(true);
                        jjc.transform.FindChild("vector").gameObject.SetActive(true);
                        jjc.transform.FindChild("defet").gameObject.SetActive(false);
                    }
                    int aa = a3_sportsModel.getInstance().grade;
                    if (aa < 10)
                    {
                        icon_star.GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_rank_00" + aa);
                    }
                    else
                    {
                        icon_star.GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_rank_0" + aa);
                    }
                    if (a3_sportsModel.getInstance().grade <= 0)
                    {
                        return;
                    }
                    SXML Xml        = XMLMgr.instance.GetSXML("jjc.reward", "grade==" + a3_sportsModel.getInstance().grade);
                    int  pointCount = Xml.getInt("star");
                    if (pointCount <= 0)
                    {
                        return;
                    }
                    Transform star = this.transform.FindChild("jjc/star");
                    for (int i = 0; i < star.childCount; i++)
                    {
                        star.GetChild(i).FindChild("this").gameObject.SetActive(false);
                        star.GetChild(i).gameObject.SetActive(false);
                    }
                    for (int m = pointCount; m > 0; m--)
                    {
                        star.GetChild(m - 1).gameObject.SetActive(true);
                    }
                    for (int j = 0; j < a3_sportsModel.getInstance().score; j++)
                    {
                        star.GetChild(j).FindChild("this").gameObject.SetActive(true);
                    }
                }
            }

            if (room is JDZCRoom)
            {
                jjc.SetActive(false);
                ar_result.SetActive(false);
                jdzc.SetActive(false);
                cityWAr.SetActive(false);
                tip_text.SetActive(false);
                getGameObjectByPath("win").SetActive(false);
                getGameObjectByPath("state_successed").SetActive(false);
                bgdefet.SetActive(false);
                bgwin.SetActive(false);
                if (data.ContainsKey("win"))
                {
                    int cct = data["win"];
                    jdzc.SetActive(true);

                    if (cct == 0)
                    {
                        GameObject item = jdzc.transform.FindChild("fail/gift/reward").gameObject;
                        Transform  con  = jdzc.transform.FindChild("fail/gift/contain");
                        jdzc.transform.FindChild("win").gameObject.SetActive(false);
                        jdzc.transform.FindChild("fail").gameObject.SetActive(true);
                        SXML        Xml_lose = XMLMgr.instance.GetSXML("pointarena.lose_reward");
                        List <SXML> rew      = Xml_lose.GetNodeList("RewardItem");
                        foreach (SXML one in rew)
                        {
                            GameObject clon = Instantiate(item) as GameObject;
                            clon.SetActive(true);
                            clon.transform.SetParent(con, false);
                            uint       id   = (uint)one.getInt("item_id");
                            int        num  = one.getInt("value");
                            GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(id);
                            icon.transform.SetParent(clon.transform.FindChild("pic/icon"), false);
                            clon.transform.FindChild("pic/num").GetComponent <Text>().text = num.ToString();
                        }
                    }
                    else
                    {
                        GameObject item = jdzc.transform.FindChild("win/gift/reward").gameObject;
                        Transform  con  = jdzc.transform.FindChild("win/gift/contain");
                        jdzc.transform.FindChild("win").gameObject.SetActive(true);
                        jdzc.transform.FindChild("fail").gameObject.SetActive(false);
                        SXML        Xml_win = XMLMgr.instance.GetSXML("pointarena.win_reward");
                        List <SXML> rew     = Xml_win.GetNodeList("RewardItem");
                        foreach (SXML one in rew)
                        {
                            GameObject clon = Instantiate(item) as GameObject;
                            clon.SetActive(true);
                            clon.transform.SetParent(con, false);
                            uint       id   = (uint)one.getInt("item_id");
                            int        num  = one.getInt("value");
                            GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(id);
                            icon.transform.SetParent(clon.transform.FindChild("pic/icon"), false);
                            clon.transform.FindChild("pic/num").GetComponent <Text>().text = num.ToString();
                        }
                    }
                }
            }

            if (room is CityWarRoom)
            {
                jjc.SetActive(false);
                ar_result.SetActive(false);
                jdzc.SetActive(false);
                tip_text.SetActive(false);
                cityWAr.SetActive(false);
                getGameObjectByPath("win").SetActive(false);
                getGameObjectByPath("state_successed").SetActive(false);
                bgdefet.SetActive(false);
                bgwin.SetActive(false);
                cityWAr.transform.FindChild("win/warinfo").gameObject.SetActive(false);
                if (data.ContainsKey("win"))
                {
                    int cct = data["win"];

                    cityWAr.SetActive(true);
                    if (cct == 0)
                    {
                        GameObject item = cityWAr.transform.FindChild("fail/gift/reward").gameObject;
                        Transform  con  = cityWAr.transform.FindChild("fail/gift/contain");
                        cityWAr.transform.FindChild("win").gameObject.SetActive(false);
                        cityWAr.transform.FindChild("fail").gameObject.SetActive(true);
                        if (PlayerModel.getInstance().lvlsideid == 1)
                        {//攻城
                            SXML        Xml_win   = XMLMgr.instance.GetSXML("clanwar.atk_awd", "min==" + 0);
                            List <SXML> rew       = Xml_win.GetNodeList("RewardItem");
                            List <SXML> awds_coin = Xml_win.GetNodeList("RewardValue");
                            setAwd(con, item, rew, awds_coin);
                        }
                        else
                        {
                            //守城
                            SXML        Xml_win   = XMLMgr.instance.GetSXML("clanwar.def_awd", "min==" + 0);
                            List <SXML> rew       = Xml_win.GetNodeList("RewardItem");
                            List <SXML> awds_coin = Xml_win.GetNodeList("RewardValue");
                            setAwd(con, item, rew, awds_coin);
                        }
                    }

                    else
                    {
                        GameObject item = cityWAr.transform.FindChild("win/gift/reward").gameObject;
                        Transform  con  = cityWAr.transform.FindChild("win/gift/contain");
                        cityWAr.transform.FindChild("win").gameObject.SetActive(true);
                        cityWAr.transform.FindChild("fail").gameObject.SetActive(false);
                        if (PlayerModel.getInstance().lvlsideid == 1)
                        {//攻城
                            int i = data["rank"];
                            if (data["win_clanid"])
                            {
                                cityWAr.transform.FindChild("win/warinfo").gameObject.SetActive(true);
                                if (A3_LegionModel.getInstance().myLegion != null && A3_LegionModel.getInstance().myLegion.id == data["win_clanid"])
                                {
                                    cityWAr.transform.FindChild("win/warinfo").GetComponent <Text>().text = ContMgr.getCont("uilayer_a3_fb_finish_11");
                                }
                                else
                                {
                                    cityWAr.transform.FindChild("win/warinfo").GetComponent <Text>().text = ContMgr.getCont("uilayer_a3_fb_finish_12");
                                }
                            }
                            cityWAr.transform.FindChild("win/info").GetComponent <Text>().text = ContMgr.getCont("uilayer_a3_fb_finish_9", new List <string> {
                                i.ToString()
                            });
                            SXML        Xml_win = XMLMgr.instance.GetSXML("clanwar");
                            List <SXML> awd     = Xml_win.GetNodeList("atk_awd");
                            foreach (SXML s in awd)
                            {
                                if (s.getInt("min") <= i && s.getInt("max") >= i)
                                {
                                    List <SXML> rew       = Xml_win.GetNodeList("RewardItem");
                                    List <SXML> awds_coin = Xml_win.GetNodeList("RewardValue");
                                    setAwd(con, item, rew, awds_coin);
                                    break;
                                }
                            }
                        }
                        else
                        {
                            //守城
                            int i = data["hpper"];
                            cityWAr.transform.FindChild("win/info").GetComponent <Text>().text = ContMgr.getCont("uilayer_a3_fb_finish_10", new List <string> {
                                i.ToString()
                            });
                            SXML        Xml_win = XMLMgr.instance.GetSXML("clanwar");
                            List <SXML> awd     = Xml_win.GetNodeList("def_awd");
                            foreach (SXML s in awd)
                            {
                                if (s.getInt("min") <= i && s.getInt("max") >= i)
                                {
                                    List <SXML> rew       = s.GetNodeList("RewardItem");
                                    List <SXML> awds_coin = s.GetNodeList("RewardValue");
                                    setAwd(con, item, rew, awds_coin);
                                    break;
                                }
                            }
                        }
                    }
                }
            }
        }
Example #18
0
        public void TrySyncPos(float dt)
        {
            if (m_fSyncPosTime < 0f)
            {
                if (m_bFirst)
                {
                    if (m_unLastSendX != m_unLastReqX || m_unLastSendY != m_unLastReqY ||
                        m_unLastSendToX != m_unLastReqToX || m_unLastSendToY != m_unLastReqToY || MapProxy.getInstance().change_map)
                    {
                        m_unLastSendX   = m_unLastReqX;
                        m_unLastSendY   = m_unLastReqY;
                        m_unLastSendToX = m_unLastReqToX;
                        m_unLastSendToY = m_unLastReqToY;

                        m_bFirst = false;
                    }
                }
                if ((m_unLastSendX != m_unLastReqX || m_unLastSendY != m_unLastReqY ||
                     m_unLastSendToX != m_unLastReqToX || m_unLastSendToY != m_unLastReqToY))
                {
                    m_unLastSendX   = m_unLastReqX;
                    m_unLastSendY   = m_unLastReqY;
                    m_unLastSendToX = m_unLastReqToX;
                    m_unLastSendToY = m_unLastReqToY;

                    Variant msg = Variant.alloc();
                    msg["frm_x"]    = m_unLastSendX;
                    msg["frm_y"]    = m_unLastSendY;
                    msg["to_x"]     = m_unLastSendToX;
                    msg["to_y"]     = m_unLastSendToY;
                    msg["start_tm"] = m_unLastReqTM;
                    msg["radian"]   = m_unLastReqRadian;
                    sendRPC(PKG_NAME.C2S_MOVE, msg);
                    // debug.Log("发送 移动 " + m_unLastSendX + " " + m_unLastSendY + "   to  " + m_unLastSendToX + " " + m_unLastSendToY);
                    Variant.free(msg);

                    m_fSyncPosTime = 0.5f;
                }
            }
            else
            {
                m_fSyncPosTime -= dt;
            }
        }