public override void init()
        {
            alain();
            inText();
            this.transform.SetAsFirstSibling();

            goMapcon = getGameObjectByPath("panel_map");
            goP      = getGameObjectByPath("panel_map/p");


            TeammateCon = this.transform.FindChild("panel_map/icon_Teammate");
            enemyCon    = this.transform.FindChild("panel_map/icon_enemy");
            TeamObj     = this.transform.FindChild("panel_map/signal1").gameObject;
            EnemyObj    = this.transform.FindChild("panel_map/signal0").gameObject;
            BaseButton btn_close = new BaseButton(transform.FindChild("close"));

            btn_close.onClick = onCloseMap;
            btns = this.transform.FindChild("panel_map/btns");

            for (int i = 0; i < btns.childCount; i++)
            {
                new BaseButton(btns.GetChild(i)).onClick = (GameObject go) => {
                    Vector3 vec = SceneCamera.getPosOnMiniMap(curMiniMap.mapScale);
                    vec = mapRotation * vec;
                    int x = (int)vec.x;
                    int y = (int)vec.y;

                    A3_cityOfWarProxy.getInstance().send_signal(uint.Parse(go.name), x, y);
                };
            }
            mapRotation = Quaternion.Euler(0f, 0f, 0f);
        }
Ejemplo n.º 2
0
 public override void onClosed()
 {
     A3_cityOfWarProxy.getInstance().removeEventListener(A3_cityOfWarProxy.REFRESHINFO, Refresh);
     A3_cityOfWarProxy.getInstance().removeEventListener(A3_cityOfWarProxy.REFRESHAPPLY, RefreshApply);
     A3_cityOfWarProxy.getInstance().removeEventListener(A3_cityOfWarProxy.REFRESHPREPARE, RefreshPrepare);
     CancelInvoke("refreshTime_Apply");
     CancelInvoke("refreshTime_Waring");
     CancelInvoke("refreshTime_WarOver");
     CancelInvoke("refreshTime_Prepare");
 }
Ejemplo n.º 3
0
 void OnDestroy()
 {
     A3_cityOfWarProxy.getInstance().removeEventListener(A3_cityOfWarProxy.REFRESHFBINFO, onFbInfo);
     PlayerModel.getInstance().lvlsideid = 0;
     PlayerModel.getInstance().inCityWar = false;
     A3_cityOfWarProxy.getInstance().sendProxy(1);
     InterfaceMgr.getInstance().close(InterfaceMgr.A3_LITEMINIBASEMAP1);
     CancelInvoke("refersh_Nav");
     CancelInvoke("Refsignal");
     A3_cityOfWarModel.getInstance().signalList.Clear();
 }
Ejemplo n.º 4
0
        public override void onShowed()
        {
            A3_cityOfWarProxy.getInstance().addEventListener(A3_cityOfWarProxy.REFRESHINFO, Refresh);
            A3_cityOfWarProxy.getInstance().addEventListener(A3_cityOfWarProxy.REFRESHAPPLY, RefreshApply);
            A3_cityOfWarProxy.getInstance().addEventListener(A3_cityOfWarProxy.REFRESHPREPARE, RefreshPrepare);
            this.transform.SetAsLastSibling();
            A3_cityOfWarProxy.getInstance().sendProxy(1);
            inputTip.SetActive(false);
            helpCon.SetActive(false);

            refreshTime_Stage();
            onTab("skycity");
        }
        public override void onShowed()
        {
            instance = this;
            A3_cityOfWarProxy.getInstance().sendPos_info();

            if (curMiniMap == null || curMiniMap.id != GRMap.instance.m_nCurMapID)
            {
                init_open_map();
            }
            clear_pos();
            InvokeRepeating("refreshPos_otherP", 0, 3f);
            SetSignal();
        }
Ejemplo n.º 6
0
        void Start()
        {
            Debug.LogError("进城战");
            WIN_MTL_1 = U3DAPI.U3DResLoad <Material>("mtl/zc2_chengmen1");
            WIN_MTL_2 = U3DAPI.U3DResLoad <Material>("mtl/zc2_chengmen2");

            A3_cityOfWarProxy.getInstance().addEventListener(A3_cityOfWarProxy.REFRESHFBINFO, onFbInfo);
            door = GameObject.Find("Object368");
            door.SetActive(true);
            PlayerModel.getInstance().inCityWar = true;
            InvokeRepeating("refersh_Nav", 0, 3f);
            door.GetComponent <MeshRenderer>().material = WIN_MTL_2;

            InvokeRepeating("Refsignal", 0, 1);
        }
Ejemplo n.º 7
0
        public override void init()
        {
            this.transform.FindChild("Text").GetComponent <Text>().text     = ContMgr.getCont("uilayer_a3_cityWarTip_1");
            this.transform.FindChild("yes/Text").GetComponent <Text>().text = ContMgr.getCont("uilayer_a3_cityWarTip_2");
            this.transform.FindChild("no/Text").GetComponent <Text>().text  = ContMgr.getCont("uilayer_a3_cityWarTip_3");


            new BaseButton(this.transform.FindChild("yes")).onClick = (GameObject go) => {
                A3_cityOfWarProxy.getInstance().sendInfb();
                InterfaceMgr.getInstance().close(this.uiName);
            };
            new BaseButton(this.transform.FindChild("no")).onClick = (GameObject go) =>
            {
                InterfaceMgr.getInstance().close(this.uiName);
            };
        }
Ejemplo n.º 8
0
        public override void init()
        {
            Con_view        = this.transform.FindChild("citylist/scroll/content");
            stageCon        = this.transform.FindChild("cityinfo/citystage");
            inputTip        = transform.FindChild("tip").gameObject;
            apply_clan_item = this.transform.FindChild("viewbg/applyview/scroll/item").gameObject;
            helpCon         = this.transform.FindChild("helpCon").gameObject;
            apply_clan_Con  = this.transform.FindChild("viewbg/applyview/scroll/content");
            inputCost       = inputTip.transform.FindChild("bug/InputField/Text").GetComponent <Text>();
            new BaseButton(transform.FindChild("close")).onClick = (GameObject go) => {
                InterfaceMgr.getInstance().close(this.uiName);
            };

            applyview   = this.transform.FindChild("viewbg/applyview");
            Prepareview = this.transform.FindChild("viewbg/Prepareview");

            for (int i = 0; i < Con_view.childCount; i++)
            {
                new BaseButton(Con_view.GetChild(i)).onClick = (GameObject go) =>
                {
                    onTab(go.name);
                };
            }

            new BaseButton(this.transform.FindChild("letters/apply")).onClick = (GameObject go) => {
                SetLetter_btn(1);
            };

            new BaseButton(this.transform.FindChild("letters/Prepare")).onClick = (GameObject go) => {
                SetLetter_btn(2);
                change_Id(1);
            };

            new BaseButton(this.transform.FindChild("letters/Prepare/local")).onClick = (GameObject go) => {
                flytxt.instance.fly(ContMgr.getCont("uilayer_A3_cityOfWar_nllopen"));//"备战阶段才可以此操作"
            };

            new BaseButton(this.transform.FindChild("viewbg/applyview/apply_btn")).onClick = (GameObject go) => {
                if (A3_LegionModel.getInstance().myLegion.clanc < 3)
                {
                    flytxt.flyUseContId("clan_8");
                    return;
                }
                inputTip.SetActive(true);
                SetApply_Info_Tip();
            };
            new BaseButton(this.transform.FindChild("viewbg/applyview/infb_btn")).onClick = (GameObject go) => {
                //进入副本
                A3_cityOfWarProxy.getInstance().sendInfb();
            };

            new BaseButton(inputTip.transform.FindChild("btn_add")).onClick = (GameObject go) => {
                mineCost = mineCost + A3_cityOfWarModel.getInstance().one_change_cost;
                if (mineCost > A3_LegionModel.getInstance().myLegion.gold)
                {
                    mineCost = mineCost - A3_cityOfWarModel.getInstance().one_change_cost;
                    flytxt.instance.fly(ContMgr.getCont("A3_cityOfWar_nullMoney"));
                    return;
                }
                if (mineCost >= Minimum + A3_cityOfWarModel.getInstance().max_cost)
                {
                    mineCost = Minimum + A3_cityOfWarModel.getInstance().max_cost;
                }
                inputCost.text = mineCost.ToString();
            };

            new BaseButton(inputTip.transform.FindChild("btn_reduce")).onClick = (GameObject go) => {
                mineCost = mineCost - A3_cityOfWarModel.getInstance().one_change_cost;
                if (mineCost <= Minimum + A3_cityOfWarModel.getInstance().min_cost)
                {
                    if (mineCost <= 0)
                    {
                        mineCost = 0;
                        flytxt.instance.fly(ContMgr.getCont("A3_cityOfWar_nullMoney"));
                    }
                    else
                    {
                        mineCost = Minimum + A3_cityOfWarModel.getInstance().min_cost;
                    }
                }
                inputCost.text = mineCost.ToString();
            };

            new BaseButton(inputTip.transform.FindChild("toup")).onClick = (GameObject go) => {
                A3_cityOfWarProxy.getInstance().sendApply((uint)mineCost);
                inputTip.SetActive(false);
            };

            new BaseButton(inputTip.transform.FindChild("close")).onClick = (GameObject go) => {
                inputTip.SetActive(false);
            };

            new BaseButton(this.transform.FindChild("viewbg/applyview/Refresh")).onClick = (GameObject go) => {
                A3_cityOfWarProxy.getInstance().sendProxy(1);
            };


            new BaseButton(this.transform.FindChild("help")).onClick = (GameObject go) => {
                helpCon.SetActive(true);
            };

            new BaseButton(this.transform.FindChild("helpCon/close")).onClick = (GameObject go) => {
                helpCon.SetActive(false);
            };

            new BaseButton(this.transform.FindChild("viewbg/Prepareview/apply_btn")).onClick = (GameObject go) =>
            {
                if (A3_LegionModel.getInstance().myLegion.clanc < 3)
                {
                    flytxt.flyUseContId("clan_8");
                    return;
                }
                if (curSelectId != 0)
                {
                    A3_cityOfWarProxy.getInstance().sendPrepare((uint)curSelectId);
                }
            };
            inText();
        }
        //void refreshPos_otherP()
        //{
        //    a3_sportsProxy.getInstance().getTeam_pos();
        //    if (a3_sportsProxy.getInstance().list_position != null)
        //    {
        //        for (int i = 0; i < a3_sportsProxy.getInstance().list_position.Count; i++)
        //        {
        //            if (a3_sportsProxy.getInstance().list_position[i].lvlsideid == 2)
        //            {
        //                if (posObj.ContainsKey(a3_sportsProxy.getInstance().list_position[i].iid))
        //                {
        //                    posObj[a3_sportsProxy.getInstance().list_position[i].iid].SetActive(true);

        //                    int x2 = (int)a3_sportsProxy.getInstance().list_position[i].x;
        //                    int y2 = (int)a3_sportsProxy.getInstance().list_position[i].y;
        //                    Vector3 vec = SceneCamera.getTeamPosOnMinMap(x2, y2, curMiniMap.mapScale);
        //                    vec = mapRotation * vec;
        //                    posObj[a3_sportsProxy.getInstance().list_position[i].iid].transform.localPosition = vec;
        //                }
        //                else
        //                {
        //                    for (int m = 0; m < TeammateCon.childCount; m++)
        //                    {
        //                        if (TeammateCon.GetChild(m).gameObject.activeSelf == false)
        //                        {
        //                            TeammateCon.GetChild(m).gameObject.SetActive(true);
        //                            posObj[a3_sportsProxy.getInstance().list_position[i].iid] = TeammateCon.GetChild(m).gameObject;
        //                            int x2 = (int)a3_sportsProxy.getInstance().list_position[i].x;
        //                            int y2 = (int)a3_sportsProxy.getInstance().list_position[i].y;
        //                            Vector3 vec = SceneCamera.getTeamPosOnMinMap(x2, y2, curMiniMap.mapScale);
        //                            vec = mapRotation * vec;
        //                            posObj[a3_sportsProxy.getInstance().list_position[i].iid].transform.localPosition = vec;
        //                            break;
        //                        }
        //                    }
        //                }
        //            }
        //            else
        //            {
        //                if (posObj.ContainsKey(a3_sportsProxy.getInstance().list_position[i].iid))
        //                {
        //                    posObj[a3_sportsProxy.getInstance().list_position[i].iid].SetActive(true);

        //                    int x2 = (int)a3_sportsProxy.getInstance().list_position[i].x;
        //                    int y2 = (int)a3_sportsProxy.getInstance().list_position[i].y;
        //                    Vector3 vec = SceneCamera.getTeamPosOnMinMap(x2, y2, curMiniMap.mapScale);
        //                    vec = mapRotation * vec;
        //                    posObj[a3_sportsProxy.getInstance().list_position[i].iid].transform.localPosition = vec;
        //                }
        //                else
        //                {
        //                    for (int m = 0; m < enemyCon.childCount; m++)
        //                    {
        //                        if (enemyCon.GetChild(m).gameObject.activeSelf == false)
        //                        {
        //                            enemyCon.GetChild(m).gameObject.SetActive(true);
        //                            posObj[a3_sportsProxy.getInstance().list_position[i].iid] = enemyCon.GetChild(m).gameObject;
        //                            int x2 = (int)a3_sportsProxy.getInstance().list_position[i].x;
        //                            int y2 = (int)a3_sportsProxy.getInstance().list_position[i].y;
        //                            Vector3 vec = SceneCamera.getTeamPosOnMinMap(x2, y2, curMiniMap.mapScale);
        //                            vec = mapRotation * vec;
        //                            posObj[a3_sportsProxy.getInstance().list_position[i].iid].transform.localPosition = vec;
        //                            break;
        //                        }
        //                    }
        //                }

        //            }
        //        }
        //    }
        //}


        //Dictionary<int, GameObject> posObj = new Dictionary<int, GameObject>();

        void refreshPos_otherP()
        {
            // Debug.LogError(PlayerModel.getInstance().lvlsideid);
            A3_cityOfWarProxy.getInstance().sendPos_info();
            if (A3_cityOfWarProxy.getInstance().list_position != null && A3_cityOfWarProxy.getInstance().list_position.Count > 0)
            {
                foreach (PlayerPos_cityWar info in A3_cityOfWarProxy.getInstance().list_position.Values)
                {
                    if (info.lvlsideid == PlayerModel.getInstance().lvlsideid)
                    {
                        if (posObj_team.ContainsKey(info.iid))
                        {
                            int     x2  = (int)info.x;
                            int     y2  = (int)info.y;
                            Vector3 vec = SceneCamera.getTeamPosOnMinMap(x2, y2, curMiniMap.mapScale);
                            vec = mapRotation * vec;
                            posObj_team[info.iid].transform.localPosition = vec;
                        }
                        else
                        {
                            GameObject clon = Instantiate(TeamObj) as GameObject;
                            clon.SetActive(true);
                            int     x2  = (int)info.x;
                            int     y2  = (int)info.y;
                            Vector3 vec = SceneCamera.getTeamPosOnMinMap(x2, y2, curMiniMap.mapScale);
                            vec = mapRotation * vec;
                            clon.transform.localPosition = vec;
                            posObj_team[info.iid]        = clon;
                            clon.transform.SetParent(TeammateCon, false);
                        }
                    }
                    else
                    {
                        if (posObj_enemy.ContainsKey(info.iid))
                        {
                            int     x2  = (int)info.x;
                            int     y2  = (int)info.y;
                            Vector3 vec = SceneCamera.getTeamPosOnMinMap(x2, y2, curMiniMap.mapScale);
                            vec = mapRotation * vec;
                            posObj_enemy[info.iid].transform.localPosition = vec;
                        }
                        else
                        {
                            GameObject clon = Instantiate(EnemyObj) as GameObject;
                            clon.SetActive(true);
                            int     x2  = (int)info.x;
                            int     y2  = (int)info.y;
                            Vector3 vec = SceneCamera.getTeamPosOnMinMap(x2, y2, curMiniMap.mapScale);
                            vec = mapRotation * vec;
                            clon.transform.localPosition = vec;
                            clon.transform.SetParent(enemyCon, false);
                            posObj_enemy[info.iid] = clon;
                        }
                    }
                }
            }

            List <int> clearid = new List <int>();

            foreach (int id in posObj_team.Keys)
            {
                if (!A3_cityOfWarProxy.getInstance().list_position.ContainsKey(id))
                {
                    clearid.Add(id);
                }
            }
            foreach (int id in posObj_enemy.Keys)
            {
                if (!A3_cityOfWarProxy.getInstance().list_position.ContainsKey(id))
                {
                    clearid.Add(id);
                }
            }

            foreach (int i in clearid)
            {
                if (posObj_team.ContainsKey(i))
                {
                    Destroy(posObj_team[i]);
                    posObj_team.Remove(i);
                }

                if (posObj_enemy.ContainsKey(i))
                {
                    Destroy(posObj_enemy[i]);
                    posObj_enemy.Remove(i);
                }
            }
        }
Ejemplo n.º 10
0
        public override void onStart(Variant svr)
        {
            base.onStart(svr);
            debug.Log("++++++++++++++++++进入城战");
            a3_insideui_fb.room = this;
            isOpen = true;
            data   = MapModel.getInstance().getMapDta(8000);
            if (data == null)
            {
                data = new MapData();
            }
            MapModel.getInstance().AddMapDta(9000, data);
            if (a3_liteMinimap.instance != null)
            {
                a3_liteMinimap.instance.updateUICseth();
            }
            if (a3_liteMinimap.instance != null)
            {
                a3_liteMinimap.instance.refreshByUIState();
            }

            Variant v = new Variant();

            v["curLevelId"] = MapModel.getInstance().curLevelId;
            InterfaceMgr.doCommandByLua("a1_low_fightgame.refresh_map_ByUIState", "ui/interfaces/low/a1_low_fightgame", v);
            InterfaceMgr.doCommandByLua("a1_low_fightgame.refresh_btn_ByUIState", "ui/interfaces/low/a1_low_fightgame", v);
            InterfaceMgr.doCommandByLua("a1_low_fightgame.showbtnIcon", "ui/interfaces/low/a1_low_fightgame", false);
            InterfaceMgr.doCommandByLua("a1_high_fightgame.showbtnIcon", "ui/interfaces/high/a1_high_fightgame", false);
            entertimer = muNetCleint.instance.CurServerTimeStamp;
            a3_insideui_fb.begintime = entertimer;
            enterdata = muLGClient.instance.g_levelsCT.get_curr_lvl_info();
            a3_insideui_fb.ShowInUI(a3_insideui_fb.e_room.CITYWAR);
            A3_cityOfWarProxy.getInstance().sendGetFb_info();
            if (a3_expbar.instance)
            {
                a3_expbar.instance.showBtnIcon(false);
            }

            if (a3_liteMinimap.instance)
            {
                a3_liteMinimap.instance.showbtnIcon(false);
            }

            if (a1_gamejoy.inst_joystick)
            {
                a1_gamejoy.inst_joystick.show_btnIcon(false);
            }

            if (a3_herohead.instance)
            {
                a3_herohead.instance.showbtnIcon(false);
            }

            if (a3_equipup.instance)
            {
                a3_equipup.instance.showbtnIcom(false);
            }
            InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_LITEMINIBASEMAP);
            if (data != null)
            {
                data.cycleCount++;
            }
        }