Пример #1
0
    private void OnClickZS(ButtonScript obj, object args, int param1, int param2)
    {
        SceneData ssdata = SceneData.GetData(GameManager.SceneID);

        if (ssdata.sceneType_ == SceneType.SCT_Instance)
        {
            MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("likaifuben"), () => {
                NetConnection.Instance.exitCopy();
            });
        }
        else
        {
            NetConnection.Instance.leaveTeam();
            tipsObj.SetActive(false);
        }



//		SceneData ssdata = SceneData.GetData (GameManager.SceneID);
//		if(ssdata.sceneType_ == SceneType.SCT_Instance)
//		{
//			return;
//		}
//		NetConnection.Instance.leaveTeam ();
//		tipsObj.SetActive (false);
    }
Пример #2
0
    void OSceneData()
    {
        metaData = SceneData.GetData();

        for (int i = 0; i < btns.Count; ++i)
        {
            UIManager.RemoveButtonEventHandler(btns[i].gameObject, EnumButtonEvent.OnClick);
            UIManager.SetButtonEventHandler(btns[i].gameObject, EnumButtonEvent.OnClick, OnNotOpen, 0, 0);
            btns[i].GetComponentInChildren <UISprite>().color = new Color(0f, 1f, 1f);
        }

        for (int i = 0; i < sceneIds.Length; i++)
        {
            if (GamePlayer.Instance.GetSceneAvaliable(sceneIds[i]))
            {
                btns[i].enabled = true;
                btns[i].GetComponentInChildren <UISprite>().color = Color.white;
                UIManager.SetButtonEventHandler(btns[i].gameObject, EnumButtonEvent.OnClick, OnClickDoDuplicate, sceneIds[i], 0);
            }
            else
            {
                UIManager.RemoveButtonEventHandler(btns[i].gameObject, EnumButtonEvent.OnClick);
                UIManager.SetButtonEventHandler(btns[i].gameObject, EnumButtonEvent.OnClick, OnLimitOpen, GamePlayer.Instance.GetSceneOpenLimit(sceneIds[i]), 0);
                btns[i].GetComponentInChildren <UISprite>().color = new Color(0f, 1f, 1f);
            }
        }
    }
Пример #3
0
    void OnClickJoin(ButtonScript obj, object args, int param1, int param2)
    {
        SceneData ssd = SceneData.GetData(GameManager.SceneID);

        if (SimpleTeamInfo.isRunning_)
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("jiaruteamkaishi"));
        }
        else
        {
            int level = GamePlayer.Instance.GetIprop(PropertyType.PT_Level);
            if (level >= SimpleTeamInfo.minLevel_ && level <= SimpleTeamInfo.maxLevel_)
            {
                if (SimpleTeamInfo.needPassword_)
                {
                    teamId = (int)SimpleTeamInfo.teamId_;
                    tips.SetActive(true);
                }
                else
                {
                    NetConnection.Instance.joinTeam(SimpleTeamInfo.teamId_, "");
                    FastTeamPanel.HideMe();
                }
            }
            else
            {
                //ErrorTipsUI.ShowMe(LanguageManager.instance.GetValue("dengjitishi"));
                PopText.Instance.Show(LanguageManager.instance.GetValue("dengjitishi"));
            }
        }
    }
Пример #4
0
    void OnClickDoYER(ButtonScript obj, object args, int param1, int param2)
    {
        SceneData ssdata = SceneData.GetData(GameManager.SceneID);

        if (ssdata.sceneType_ == SceneType.SCT_Instance)
        {
            if (CopyData.IsCopyScene(GameManager.SceneID))
            {
                MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("likaifuben"), () => {
                    NetConnection.Instance.exitCopy();
                    Prebattle.Instance.ActiveEnterScene(2);
                });
            }
        }
        else if (ssdata.sceneType_ == SceneType.SCT_GuildBattleScene)
        {
            MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("likaijiazuzhan"), () => {
                Prebattle.Instance.ActiveEnterScene(2);
            });
        }
        else
        {
            Prebattle.Instance.ActiveEnterScene(2);
        }

        Hide();
    }
Пример #5
0
    private void OnClickLK(ButtonScript obj, object args, int param1, int param2)
    {
        SceneData ssdata = SceneData.GetData(GameManager.SceneID);

        if (ssdata.sceneType_ == SceneType.SCT_Instance)
        {
            if (CopyData.IsCopyScene(GameManager.SceneID))
            {
                MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("likaifuben"), () =>
                {
                    NetConnection.Instance.exitCopy();
                });
            }
            else
            {
                NetConnection.Instance.exitTeam();
                NetConnection.Instance.exitLobby();
            }
        }
        else
        {
            NetConnection.Instance.exitTeam();
            NetConnection.Instance.exitLobby();
        }
        tipsObj.SetActive(false);
    }
Пример #6
0
    void OnClicYaoqing(ButtonScript obj, object args, int param1, int param2)
    {
        if (!GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Team))
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("duiwuweikai"));
            return;
        }
//		if(!(((GuildMember.openSubSystemFlag_) &(0x1 << (int)OpenSubSystemFlag.OSSF_Team)) != 0))
//		{
//			PopText.Instance.Show(LanguageManager.instance.GetValue("Duifangduiwu"));
//			return;
//		}
        SceneData ssd = SceneData.GetData(GameManager.SceneID);

        if (ssd.sceneType_ == SceneType.SCT_AlonePK || ssd.sceneType_ == SceneType.SCT_TeamPK)
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("bunengzudui"));
            return;
        }
        if (ssd.sceneType_ == SceneType.SCT_GuildBattleScene)
        {
            if (!GuildSystem.IsInMyGuild(GuildMember.roleId_))
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("bunengyaoqingdifang"));
                return;
            }
        }
        NetConnection.Instance.inviteTeamMember(name);
    }
Пример #7
0
    void OnClickJDW(ButtonScript obj, object args, int param1, int param2)
    {
        if (!GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Team))
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("duiwuweikai"));
            return;
        }
        //if(!(((PlayerInst.openSubSystemFlag_) &(0x1 << (int)OpenSubSystemFlag.OSSF_Team)) != 0))
        //{
        //	PopText.Instance.Show(LanguageManager.instance.GetValue("Duifangduiwu"));
        //	return;
        //}
        SceneData ssd = SceneData.GetData(GameManager.SceneID);

        //if(ssd.sceneType_ == SceneType.SCT_AlonePK||ssd.sceneType_ == SceneType.SCT_TeamPK)
        //{
        //    PopText.Instance.Show(LanguageManager.instance.GetValue("bunengzudui"));
        //    return;
        //}
        if (ssd.sceneType_ == SceneType.SCT_GuildBattleScene)
        {
            if (!GuildSystem.IsInMyGuild(PlayerInst.instId_))
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("bunengyaoqingdifang"));
                return;
            }
        }
        if (TeamSystem.IsInTeam())
        {
            if (!TeamSystem.IsTeamLeader(GamePlayer.Instance.InstId))
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("onlyLeaderCanOperate"));
            }
            else
            {
                NetConnection.Instance.inviteTeamMember(PlayerInst.instName_);
                //PopText.Instance.Show(LanguageManager.instance.GetValue("yaoqingchenggong"));
                gameObject.SetActive(false);
            }
        }
        else
        {
            //NetConnection.Instance.jointLobby();

            COM_CreateTeamInfo cti = new COM_CreateTeamInfo();
            cti.type_ = TeamType.TT_MainQuest;
            cti.name_ = LanguageManager.instance.GetValue("autoTeam");
            //cti.pwd_ = passWordInput.text;
            cti.maxMemberSize_ = 5;
            cti.minLevel_      = 1;
            cti.maxLevel_      = (ushort)maxLevel;
            NetConnection.Instance.createTeam(cti);
            // NetConnection.Instance.inviteTeamMember(PlayerInst.instName_);
            PopText.Instance.Show(LanguageManager.instance.GetValue("yaoqingchenggong"));
        }
    }
Пример #8
0
    public string Convert2Name(int sceneId)
    {
        SceneData ssd = SceneData.GetData(sceneId);

        if (ssd == null)
        {
            ClientLog.Instance.LogWarning("There is no data with SceneID: " + sceneId);
            return("");
        }
        return(ssd.sceneXml_);
    }
Пример #9
0
    void SetMinmapNPC()
    {
        ssd = SceneData.GetData(GameManager.SceneID);
        if (ssd != null)
        {
            if (string.IsNullOrEmpty(crtSceneName) || !crtSceneName.Equals(ssd.nameEffectId_))
            {
                ClearName();
                crtSceneName = ssd.nameEffectId_;
                HeadIconLoader.Instance.LoadIcon(crtSceneName, sceneName);
            }

            if (string.IsNullOrEmpty(crtMap) || !crtMap.Equals(ssd.minmap))
            {
                ClearMap();
                crtMap = ssd.minmap;
                HeadIconLoader.Instance.LoadIcon(crtMap, backGround);
            }

            sceneName.gameObject.SetActive(true);
        }
        else
        {
            sceneName.gameObject.SetActive(false);
            ClearName();
            ClearMap();
        }

        NpcMiniLogo.gameObject.SetActive(false);
        for (int i = 0; i < Prebattle.Instance.npcContainer_.Count; i++)
        {
            GameObject npc = Prebattle.Instance.npcContainer_[i].gameObject_;

            UISprite sp = GameObject.Instantiate(NpcMiniLogo) as UISprite;
            sp.gameObject.SetActive(true);
            sp.transform.parent        = backGround.transform;
            sp.transform.localScale    = Vector3.one;
            sp.transform.localPosition = new Vector3(((npc.transform.position.x + ssd.offsetX_) * miniMapWidth / mapWidth) * ssd.dir_, ((npc.transform.position.z + ssd.offsetY_) * miniMapHeight / mapHeight) * ssd.dir_, 0);
            sp.transform.localPosition = sp.transform.localPosition * ssd.zoom_;
        }

        EntryMiniLogo.gameObject.SetActive(false);
        for (int i = 0; i < ssd.entrys_.Count; i++)
        {
            UISprite sp = GameObject.Instantiate(EntryMiniLogo) as UISprite;
            sp.gameObject.SetActive(true);
            sp.transform.parent        = backGround.transform;
            sp.transform.localScale    = Vector3.one;
            sp.transform.localPosition = new Vector3(((ssd.entrys_[i].pos_.x + ssd.offsetX_) * miniMapWidth / mapWidth) * ssd.dir_, ((ssd.entrys_[i].pos_.y + ssd.offsetY_) * miniMapHeight / mapHeight) * ssd.dir_, 0);
            sp.transform.localPosition = sp.transform.localPosition * ssd.zoom_;
        }
    }
Пример #10
0
    void LoadCurMapData()
    {
        SceneData ssd = SceneData.GetData(GameManager.SceneID);

        if (ssd != null)
        {
            HeadIconLoader.Instance.LoadIcon(ssd.nameEffectId_, SceneName);
            SceneName.gameObject.SetActive(true);
        }
        else
        {
            SceneName.gameObject.SetActive(false);
        }
        LoadNpcBtn();
        LoadEntryBtn();
    }
Пример #11
0
    void OnClickzanshi(ButtonScript obj, object args, int param1, int param2)
    {
        SceneData ssdata = SceneData.GetData(GameManager.SceneID);

        if (ssdata.sceneType_ == SceneType.SCT_Instance)
        {
            MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("likaifuben"), () => {
                NetConnection.Instance.exitCopy();
            });
        }
        else
        {
            NetConnection.Instance.leaveTeam();
            backTeamBtn.gameObject.SetActive(true);
            zanshiBtn.gameObject.SetActive(false);
        }
    }
Пример #12
0
    private void OnClickxuyuanBtn(ButtonScript obj, object args, int param1, int param2)
    {
        if (GamePlayer.Instance.GetIprop(PropertyType.PT_Level) < 25)
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("gongnengweikaiqi"));
            return;
        }
        SceneData ssdata = SceneData.GetData(GameManager.SceneID);

        if (ssdata.sceneType_ == SceneType.SCT_GuildBattleScene)
        {
            MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("querenlikai"), () => {
                NetConnection.Instance.moveToNpc(9572);
            });
            return;
        }

        NetConnection.Instance.moveToNpc(9572);
    }
Пример #13
0
    private void OnClickPTeamButton(ButtonScript obj, object args, int param1, int param2)
    {
        passCount--;
        isquestbtn = true;
        if (isteamquestbtn)
        {
            teampassCount  = 0;
            isteamquestbtn = false;
        }
        if (!GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Team))
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("duiwuweikai"));
        }
        else
        {
            SceneData ssd = SceneData.GetData(GameManager.SceneID);
//			if(ssd.sceneType_ == SceneType.SCT_AlonePK||ssd.sceneType_ == SceneType.SCT_TeamPK)
//			{
//				PopText.Instance.Show(LanguageManager.instance.GetValue("bunengzudui"));
//				return;
//			}


//			if (TeamSystem.IsInTeam() && TeamSystem.IsTeamLeader())
//			{
//				NetConnection.Instance.joinTeamRoom();
//			}else
//			{
            //TeamUI.ShowMe();
//			}
            teampassCount++;
            if (teampassCount >= 2)
            {
                TeamUI.ShowMe();
            }
            TeamSystem.isYqEnd       = false;
            TeamButton.pressedSprite = "duiwuliang";
            TeamButton.normalSprite  = "duiwuliang";
            teamObj.SetActive(true);
            tasksObj.SetActive(false);
            SwitchBtnSprite(true);
        }
    }
Пример #14
0
    private void OnClickYQ(ButtonScript obj, object args, int param1, int param2)
    {
        if (!GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Team))
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("duiwuweikai"));
            return;
        }
//		if(!(((PlayerInst.openSubSystemFlag_) &(0x1 << (int)OpenSubSystemFlag.OSSF_Team)) != 0))
//		{
//			PopText.Instance.Show(LanguageManager.instance.GetValue("Duifangduiwu"));
//			return;
//		}
        SceneData ssd = SceneData.GetData(GameManager.SceneID);

        if (ssd.sceneType_ == SceneType.SCT_AlonePK || ssd.sceneType_ == SceneType.SCT_TeamPK)
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("bunengzudui"));
            return;
        }
        if (TeamSystem.IsInTeam())
        {
            NetConnection.Instance.inviteTeamMember(Member.roleName_);
            gameObject.SetActive(false);
        }
        else
        {
            //NetConnection.Instance.jointLobby();

            COM_CreateTeamInfo cti = new COM_CreateTeamInfo();
            cti.type_ = TeamType.TT_None;
            cti.name_ = "";
            //cti.pwd_ = passWordInput.text;
            cti.maxMemberSize_ = 5;
            cti.minLevel_      = 1;
            cti.maxLevel_      = 60;
            NetConnection.Instance.createTeam(cti);
        }



        //NetConnection.Instance.inviteTeamMember (Member.roleName_);
    }
Пример #15
0
    public static void ExcuteLoadedEvent()
    {
        Transform trans = null;

        if (ApplicationEntry.Instance != null)
        {
            for (int i = 0; i < ApplicationEntry.Instance.uiRoot.transform.childCount; ++i)
            {
                trans = ApplicationEntry.Instance.uiRoot.transform.GetChild(i);
                if (trans.gameObject.name.Equals("NameLabel"))
                {
                    GameObject.Destroy(trans.gameObject);
                }
            }
        }

        Loading = false;

        if (OnSceneLoaded != null)
        {
            OnSceneLoaded(Scene_name);
        }

        SceneData sd = SceneData.GetData(GameManager.SceneID);

        if (sd == null)
        {
            return;
        }
        MusicAssetsData mdata = MusicAssetsData.GetData(sd.M_ID);

        if (!GlobalValue.isBattleScene(Scene_name))
        {
            SoundTools.PlayMusic((MUSIC_ID)mdata.id_);
        }

        if (!BagSystem.instance.IsInit && !Scene_name.Equals("LoginScene") && !Scene_name.Equals("CreateRoleScene"))
        {
            NetConnection.Instance.requestBag();
        }
    }
Пример #16
0
    void Start()
    {
        worldLbl.text = LanguageManager.instance.GetValue("WordMap");
        backLbl.text  = LanguageManager.instance.GetValue("CurMap");
        UIManager.SetButtonEventHandler(closeBtn.gameObject, EnumButtonEvent.OnClick, OnClickClose, 0, 0);
        UIManager.SetButtonEventHandler(FLBtn.gameObject, EnumButtonEvent.OnClick, OnClickDoFL, 0, 0);
        UIManager.SetButtonEventHandler(YERBtn.gameObject, EnumButtonEvent.OnClick, OnClickDoYER, 0, 0);

        UIManager.SetButtonEventHandler(worlodBtn.gameObject, EnumButtonEvent.OnClick, OnClickWorldMap, 0, 0);
        UIManager.SetButtonEventHandler(backBtn.gameObject, EnumButtonEvent.OnClick, OnClickCurMap, 0, 0);



        npcBtn.gameObject.SetActive(false);
        entryBtn.gameObject.SetActive(false);
        //OpenScene ();

        GuideManager.Instance.RegistGuideAim(worlodBtn.gameObject, GuideAimType.GAT_WorldMapWorldBtn);
        GuideManager.Instance.RegistGuideAim(YERBtn.gameObject, GuideAimType.GAT_WorldMapER);
        GuideManager.Instance.RegistGuideAim(FLBtn.gameObject, GuideAimType.GAT_WorldMapFL);

        GuideManager.Instance.ProcEvent(ScriptGameEvent.SGE_WorldMapOpen);

        ssd = SceneData.GetData(GameManager.SceneID);
        HeadIconLoader.Instance.LoadIcon(ssd.minmap, minmap);
        if (num == 0)
        {
            worldObj.SetActive(true);
            curObj.SetActive(false);
            OSceneData();
            _TitleLable.text = LanguageManager.instance.GetValue("WordMap");
        }
        else
        {
            worldObj.SetActive(false);
            curObj.SetActive(true);
            LoadCurMapData();
            _TitleLable.text = LanguageManager.instance.GetValue("CurMap");
        }
    }
Пример #17
0
    // Use this for initialization
    void Start()
    {
        inst = this;
        if (GameManager.Instance != null)
        {
            GameManager.Instance.SetChatUIActive(false);
        }
        destroyed = false;
        if (OnBeginLoading != null)
        {
            OnBeginLoading();
        }
        SceneData sdata = SceneData.GetData(GameManager.SceneID);

        if (sdata == null)
        {
            scenenicon = "loding";
        }
        else
        {
            scenenicon = sdata.scene_icon;
        }
        HeadIconLoader.Instance.LoadIcon(scenenicon, back);
        ui_loaded_        = !StageMgr.withUI_;
        dynamicResLoaded_ = !StageMgr.withDynRes_;
        manualCloseUI_    = StageMgr.manualClose_;
        // 注册loading形式
        LoadingProgressbar progressbar = GetComponentInChildren <LoadingProgressbar>();

        progressbar.UseThisType();
        //加载场景模型
        SceneLoader.Instance.LoadScene(StageMgr.Scene_name, () =>
        {
            StartCoroutine(loading());
        });
        //加载UI资源
        GlobalInstanceFunction.LoadSceneUI(StageMgr.Scene_name, UILoadFinish);

        Resources.UnloadUnusedAssets();
    }
Пример #18
0
    void LoadEntryBtn()
    {
        SceneData       toSceneData = null;
        UIButton        sp          = null;
        UIEventListener listener    = null;

        for (int i = 0; i < ssd.entrys_.Count; i++)
        {
            sp = GameObject.Instantiate(entryBtn) as UIButton;
            sp.gameObject.SetActive(true);
            sp.transform.parent        = minmap.transform;
            sp.transform.localScale    = Vector3.one;
            sp.transform.localPosition = new Vector3(((ssd.entrys_[i].pos_.x + ssd.offsetX_) * miniMapWidth / mapWidth) * ssd.dir_, ((ssd.entrys_[i].pos_.y + ssd.offsetY_) * miniMapHeight / mapHeight) * ssd.dir_, 0);
            sp.transform.localPosition = sp.transform.localPosition * ssd.zoom_;
            listener           = UIEventListener.Get(sp.gameObject);
            listener.parameter = ssd.entrys_[i].pos_;
            listener.onClick  += OnClickMoveEntry;
            UILabel la = sp.GetComponentInChildren <UILabel>();
            toSceneData = SceneData.GetData(ssd.entrys_[i].toSceneId_);
            la.text     = toSceneData.sceneName_;
        }
    }
Пример #19
0
    static public void OpenMusic()
    {
        PlayerPrefs.SetInt("settingMusic", 0);
        settingDirty = true;
        int mucId = 0;

        if (GamePlayer.Instance.isInBattle)
        {
            if (Battle.Instance.battleType == BattleType.BT_PVE)
            {
                if (Battle.Instance.BattleID == 0)
                {
                    GlobalValue.Get(Constant.C_BossMuc, out mucId);
                    PlayMusic((MUSIC_ID)mucId);
                }
                else
                {
                    GlobalValue.Get(Constant.C_PutnMuc, out mucId);
                    PlayMusic((MUSIC_ID)mucId);
                }
            }
            else
            if (Battle.Instance.battleType == BattleType.BT_PVP)
            {
                GlobalValue.Get(Constant.C_PvpMuc, out mucId);
                PlayMusic((MUSIC_ID)mucId);
            }
        }
        else
        {
            SceneData sd = SceneData.GetData(GameManager.SceneID);
            if (sd == null)
            {
                return;
            }
            MusicAssetsData mdata = MusicAssetsData.GetData(sd.M_ID);
            PlayMusic((MUSIC_ID)mdata.id_);
        }
    }
Пример #20
0
    void Start()
    {
        //UIManager.SetButtonEventHandler (hudObj.gameObject, EnumButtonEvent.OnClick, OnClickShowTips, 0, 0);
        UIManager.SetButtonEventHandler(closeBtn.gameObject, EnumButtonEvent.OnClick, OnClickclose, 0, 0);
        UIManager.SetButtonEventHandler(CKBtn.gameObject, EnumButtonEvent.OnClick, OnClickCK, 0, 0);
        UIManager.SetButtonEventHandler(pvpBtn.gameObject, EnumButtonEvent.OnClick, OnClickpvp, 0, 0);
        UIManager.SetButtonEventHandler(JHYBtn.gameObject, EnumButtonEvent.OnClick, OnClickJHY, 0, 0);
        ssd = SceneData.GetData(GameManager.SceneID);
        UIManager.SetButtonEventHandler(jdwBtn.gameObject, EnumButtonEvent.OnClick, OnClickJDW, 0, 0);
        if (ssd.sceneType_ == SceneType.SCT_TeamPK || ssd.sceneType_ == SceneType.SCT_AlonePK || ssd.sceneType_ == SceneType.SCT_Instance || ssd.sceneType_ == SceneType.SCT_GuildBattleScene)
        {
            pvpBtn.isEnabled = true;
            UIManager.SetButtonEventHandler(pvpBtn.gameObject, EnumButtonEvent.OnClick, OnClickpvp, 0, 0);
        }
        else
        {
            pvpBtn.isEnabled = false;
        }
        GlobalValue.Get(Constant.C_PlayerMaxLevel, out maxLevel);
//		TeamSystem.OnChangejoinL += joinLobbyOk;
//		TeamSystem.OnInitMyTeam += InitMyTeamOk;
    }
Пример #21
0
    string GetSceneName(string location)
    {
        string[] parse = null;
        int      sceneId;

        if (location.Contains("|"))
        {
            parse   = location.Split('|');
            sceneId = int.Parse(parse[0]);
        }
        else
        {
            parse   = location.Split(';');
            sceneId = int.Parse(parse[0]);
        }
        SceneData ssd = SceneData.GetData(sceneId);

        if (ssd != null)
        {
            return(ssd.sceneName_);
        }
        return(LanguageManager.instance.GetValue("Nothing"));
    }
Пример #22
0
    private void OnClickOtherFamily(ButtonScript obj, object args, int param1, int param2)
    {
        Prebattle.Instance.ChangeWalkEff(Prebattle.WalkState.WS_Normal);
        Prebattle.Instance.StopSelfActorMove();
        SceneData ssdata = SceneData.GetData(GameManager.SceneID);

        if (CopyData.IsCopyScene(GameManager.SceneID))
        {
            MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("likaifuben"), () => {
                NetConnection.Instance.exitCopy();
                NetConnection.Instance.transforScene(1100);
            });
        }
        else if (ssdata.sceneType_ == SceneType.SCT_GuildBattleScene)
        {
            MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("querenlikai"), () => {
                NetConnection.Instance.transforScene(1100);
            });
        }
        else
        {
            NetConnection.Instance.transforScene(1100);
        }
    }
Пример #23
0
    void ShowTaskIonf(int qid)
    {
        string    goal_str = "";
        QuestData quest    = QuestData.GetData(qid);

        if (quest == null)
        {
            return;
        }

        taskDescription.text = quest.QuestDes_;
        //ReceiveNpc.text = NpcData.GetData(qid).npcname_;
        NpcData npc = NpcData.GetData(quest.finishNpcId_);

        if (npc != null)
        {
            completeNpc.text = npc.NpcName;
        }


        if (quest.questType_ == QuestType.QT_Battle)
        {
            SceneData sData = SceneData.GetData(quest.targetId_);
            goal_str = string.Format("在{0}中发生{1}战斗", sData.sceneName_, quest.targetNum_);
        }
        else if (quest.questType_ == QuestType.QT_Dialog)
        {
            goal_str = quest.QuestDes_;
        }
        else if (quest.questType_ == QuestType.QT_Item)
        {
            ItemData iDta  = ItemData.GetData(quest.targetId_);
            NpcData  nData = NpcData.GetData(quest.finishNpcId_);
            goal_str = string.Format("把{0}个{1}交给{2}只", quest.targetNum_, iDta.name_, nData.Name);
        }
        else if (quest.questType_ == QuestType.QT_Kill)
        {
            BabyData bData = BabyData.GetData(quest.targetId_);
            if (bData != null)
            {
                goal_str = string.Format("杀死{0}{1}只", bData._Name, quest.targetNum_);
            }
        }
        taskgoal.text = goal_str;

        DropData droData = DropData.GetData(quest.DropID_);

        foreach (Transform tr in JGrid.transform)
        {
            Destroy(tr.gameObject);
        }
        jianliPanle.clipOffset = Vector2.zero;
        jianliPanle.transform.localPosition = Vector3.zero;
        jianliPanle.GetComponent <UIScrollView>().ResetPosition();
        if (droData == null)
        {
            return;
        }

        if (droData.exp_ != 0)
        {
            GameObject cloneExp = GameObject.Instantiate(JItem) as GameObject;
            cloneExp.SetActive(true);
            cloneExp.transform.parent     = JGrid.transform;
            cloneExp.transform.position   = Vector3.zero;
            cloneExp.transform.localScale = Vector3.one;
            RewardCell rCellExp = cloneExp.GetComponent <RewardCell>();
            rCellExp.RewardIcon.gameObject.SetActive(true);
            //rCellExp.RewardIcon.spriteName = "jingyan";
            // rCellExp.icont.gameObject.SetActive(false);
            rCellExp.RewardIcon.MakePixelPerfect();
            rCellExp.RewardLabel.text = droData.exp_.ToString();;
            HeadIconLoader.Instance.LoadIcon("jingyan_icon", rCellExp.icont);
        }
        if (droData.money_ != 0)
        {
            GameObject cloneJin = GameObject.Instantiate(JItem) as GameObject;
            cloneJin.SetActive(true);
            cloneJin.transform.parent     = JGrid.transform;
            cloneJin.transform.position   = Vector3.zero;
            cloneJin.transform.localScale = Vector3.one;
            RewardCell rCellJin = cloneJin.GetComponent <RewardCell>();
            rCellJin.RewardIcon.gameObject.SetActive(true);
            //rCellJin.icont.gameObject.SetActive(false);
            //rCellJin.RewardIcon.spriteName = "jinbitubiao";
            rCellJin.RewardIcon.MakePixelPerfect();
            rCellJin.RewardLabel.text = droData.money_.ToString();
            HeadIconLoader.Instance.LoadIcon("jingbitubiao", rCellJin.icont);
        }
        if (droData.item_1_ != 0)
        {
            GameObject clone = GameObject.Instantiate(JItem) as GameObject;
            clone.SetActive(true);
            clone.transform.parent     = JGrid.transform;
            clone.transform.position   = Vector3.zero;
            clone.transform.localScale = Vector3.one;
            RewardCell rCell = clone.GetComponent <RewardCell>();
            rCell.RewardIcon.gameObject.SetActive(false);
            rCell.icont.gameObject.SetActive(true);
            UISprite sp = clone.GetComponent <UISprite>();
            //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_1_).icon_;
            ItemCellUI ic = UIManager.Instance.AddItemCellUI(sp, (uint)droData.item_1_);
            ic.showTips = true;
            //HeadIconLoader.Instance.LoadIcon (ItemData.GetData (droData.item_1_).icon_, rCell.icont);
            rCell.RewardLabel.text = droData.item_num_1_.ToString();
            rCell.RewardIcon.MakePixelPerfect();
        }
        if (droData.item_2 != 0)
        {
            GameObject clone = GameObject.Instantiate(JItem) as GameObject;
            clone.SetActive(true);
            clone.transform.parent     = JGrid.transform;
            clone.transform.position   = Vector3.zero;
            clone.transform.localScale = Vector3.one;
            RewardCell rCell = clone.GetComponent <RewardCell>();
            rCell.RewardIcon.gameObject.SetActive(false);
            rCell.icont.gameObject.SetActive(true);
            //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_2).icon_;
            UISprite   sp = clone.GetComponent <UISprite>();
            ItemCellUI ic = UIManager.Instance.AddItemCellUI(sp, (uint)droData.item_2);
            ic.showTips = true;
            //HeadIconLoader.Instance.LoadIcon (ItemData.GetData (droData.item_2).icon_, rCell.icont);
            rCell.RewardLabel.text = droData.item_num_2.ToString();
            rCell.RewardIcon.MakePixelPerfect();
        }

        if (droData.item_3 != 0)
        {
            GameObject clone = GameObject.Instantiate(JItem) as GameObject;
            clone.SetActive(true);
            clone.transform.parent     = JGrid.transform;
            clone.transform.position   = Vector3.zero;
            clone.transform.localScale = Vector3.one;
            RewardCell rCell = clone.GetComponent <RewardCell>();
            rCell.RewardIcon.gameObject.SetActive(false);
            rCell.icont.gameObject.SetActive(true);
            //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_3).icon_;;
            UISprite   sp = clone.GetComponent <UISprite>();
            ItemCellUI ic = UIManager.Instance.AddItemCellUI(sp, (uint)droData.item_3);
            ic.showTips = true;
            //HeadIconLoader.Instance.LoadIcon (ItemData.GetData (droData.item_3).icon_, rCell.icont);
            rCell.RewardLabel.text = droData.item_num_3.ToString();
            rCell.RewardIcon.MakePixelPerfect();
        }

        if (droData.item_4 != 0)
        {
            GameObject clone = GameObject.Instantiate(JItem) as GameObject;
            clone.SetActive(true);
            clone.transform.parent     = JGrid.transform;
            clone.transform.position   = Vector3.zero;
            clone.transform.localScale = Vector3.one;
            RewardCell rCell = clone.GetComponent <RewardCell>();
            rCell.RewardIcon.gameObject.SetActive(false);
            rCell.icont.gameObject.SetActive(true);
            UISprite   sp = clone.GetComponent <UISprite>();
            ItemCellUI ic = UIManager.Instance.AddItemCellUI(sp, (uint)droData.item_4);
            ic.showTips = true;
            //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_4).icon_;;
            //HeadIconLoader.Instance.LoadIcon (ItemData.GetData (droData.item_4).icon_, rCell.icont);
            rCell.RewardLabel.text = droData.item_num_4.ToString();
            rCell.RewardIcon.MakePixelPerfect();
        }
        if (droData.item_5 != 0)
        {
            GameObject clone = GameObject.Instantiate(JItem) as GameObject;
            clone.SetActive(true);
            clone.transform.parent     = JGrid.transform;
            clone.transform.position   = Vector3.zero;
            clone.transform.localScale = Vector3.one;
            RewardCell rCell = clone.GetComponent <RewardCell>();
            rCell.icont.gameObject.SetActive(true);
            //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_5).icon_;;
            rCell.RewardIcon.gameObject.SetActive(false);
            UISprite   sp = clone.GetComponent <UISprite>();
            ItemCellUI ic = UIManager.Instance.AddItemCellUI(sp, (uint)droData.item_5);
            ic.showTips = true;
            //HeadIconLoader.Instance.LoadIcon (ItemData.GetData (droData.item_5).icon_, rCell.icont);
            rCell.RewardLabel.text = droData.item_num_5.ToString();
            rCell.RewardIcon.MakePixelPerfect();
        }
        if (droData.item_6 != 0)
        {
            GameObject clone = GameObject.Instantiate(JItem) as GameObject;
            clone.SetActive(true);
            clone.transform.parent     = JGrid.transform;
            clone.transform.position   = Vector3.zero;
            clone.transform.localScale = Vector3.one;
            RewardCell rCell = clone.GetComponent <RewardCell>();
            rCell.icont.gameObject.SetActive(true);
            //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_6).icon_;;
            rCell.RewardIcon.gameObject.SetActive(false);
            UISprite   sp = clone.GetComponent <UISprite>();
            ItemCellUI ic = UIManager.Instance.AddItemCellUI(sp, (uint)droData.item_6);
            ic.showTips = true;
            //HeadIconLoader.Instance.LoadIcon (ItemData.GetData (droData.item_6).icon_, rCell.icont);
            rCell.RewardLabel.text = droData.item_num_6.ToString();
            rCell.RewardIcon.MakePixelPerfect();
        }
//        for (int i = 0; i < droData.item_num_1_; i++)
//        {
//            GameObject clone = GameObject.Instantiate(JItem) as GameObject;
//            clone.SetActive(true);
//            clone.transform.parent = JGrid.transform;
//            clone.transform.position = Vector3.zero;
//            clone.transform.localScale = Vector3.one;
//            RewardCell rCell = clone.GetComponent<RewardCell>();
//            rCell.RewardIcon.gameObject.SetActive(false);
//            rCell.icont.gameObject.SetActive(true);
//            //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_1_).icon_;
//            HeadIconLoader.Instance.LoadIcon(ItemData.GetData(droData.item_1_).icon_, rCell.icont);
//            rCell.RewardLabel.text = droData.item_num_1_.ToString();
//            rCell.RewardIcon.MakePixelPerfect();
//
//        }
//        for (int i = 0; i < droData.item_num_2; i++)
//        {
//            GameObject clone = GameObject.Instantiate(JItem) as GameObject;
//            clone.SetActive(true);
//            clone.transform.parent = JGrid.transform;
//            clone.transform.position = Vector3.zero;
//            clone.transform.localScale = Vector3.one;
//            RewardCell rCell = clone.GetComponent<RewardCell>();
//            rCell.RewardIcon.gameObject.SetActive(false);
//            rCell.icont.gameObject.SetActive(true);
//            //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_2).icon_;
//            HeadIconLoader.Instance.LoadIcon(ItemData.GetData(droData.item_2).icon_, rCell.icont);
//            rCell.RewardLabel.text = droData.item_num_2.ToString();
//            rCell.RewardIcon.MakePixelPerfect();
//
//        }
//        for (int i = 0; i < droData.item_num_3; i++)
//        {
//            GameObject clone = GameObject.Instantiate(JItem) as GameObject;
//            clone.SetActive(true);
//            clone.transform.parent = JGrid.transform;
//            clone.transform.position = Vector3.zero;
//            clone.transform.localScale = Vector3.one;
//            RewardCell rCell = clone.GetComponent<RewardCell>();
//            rCell.RewardIcon.gameObject.SetActive(false);
//            rCell.icont.gameObject.SetActive(true);
//            //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_3).icon_;;
//            HeadIconLoader.Instance.LoadIcon(ItemData.GetData(droData.item_3).icon_, rCell.icont);
//            rCell.RewardLabel.text = droData.item_num_3.ToString();
//            rCell.RewardIcon.MakePixelPerfect();
//
//        }
//        for (int i = 0; i < droData.item_num_4; i++)
//        {
//            GameObject clone = GameObject.Instantiate(JItem) as GameObject;
//            clone.SetActive(true);
//            clone.transform.parent = JGrid.transform;
//            clone.transform.position = Vector3.zero;
//            clone.transform.localScale = Vector3.one;
//            RewardCell rCell = clone.GetComponent<RewardCell>();
//            rCell.RewardIcon.gameObject.SetActive(false);
//            rCell.icont.gameObject.SetActive(true);
//            //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_4).icon_;;
//            HeadIconLoader.Instance.LoadIcon(ItemData.GetData(droData.item_4).icon_, rCell.icont);
//            rCell.RewardLabel.text = droData.item_num_4.ToString();
//            rCell.RewardIcon.MakePixelPerfect();
//
//        }
//        for (int i = 0; i < droData.item_num_5; i++)
//        {
//            GameObject clone = GameObject.Instantiate(JItem) as GameObject;
//            clone.SetActive(true);
//            clone.transform.parent = JGrid.transform;
//            clone.transform.position = Vector3.zero;
//            clone.transform.localScale = Vector3.one;
//            RewardCell rCell = clone.GetComponent<RewardCell>();
//            rCell.icont.gameObject.SetActive(true);
//            //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_5).icon_;;
//            rCell.RewardIcon.gameObject.SetActive(false);
//            HeadIconLoader.Instance.LoadIcon(ItemData.GetData(droData.item_5).icon_, rCell.icont);
//            rCell.RewardLabel.text = droData.item_num_5.ToString();
//            rCell.RewardIcon.MakePixelPerfect();
//
//        }
//        for (int i = 0; i < droData.item_num_6; i++)
//        {
//            GameObject clone = GameObject.Instantiate(JItem) as GameObject;
//            clone.SetActive(true);
//            clone.transform.parent = JGrid.transform;
//            clone.transform.position = Vector3.zero;
//            clone.transform.localScale = Vector3.one;
//            RewardCell rCell = clone.GetComponent<RewardCell>();
//            rCell.icont.gameObject.SetActive(true);
//            //rCell.RewardIcon.spriteName = ItemData.GetData (droData.item_6).icon_;;
//            rCell.RewardIcon.gameObject.SetActive(false);
//            HeadIconLoader.Instance.LoadIcon(ItemData.GetData(droData.item_6).icon_, rCell.icont);
//            rCell.RewardLabel.text = droData.item_num_6.ToString();
//            rCell.RewardIcon.MakePixelPerfect();
//
//        }
        JGrid.repositionNow = true;
    }
Пример #24
0
    public void OnJoin(GameObject go)
    {
        SceneData ssdata = SceneData.GetData(GameManager.SceneID);

        if (ssdata.sceneType_ == SceneType.SCT_GuildBattleScene)
        {
            MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("querenlikai"), () => {
                if (daData_.activityKind_ == ActivityType.ACT_Family_0 ||
                    daData_.activityKind_ == ActivityType.ACT_Family_1 ||
                    daData_.activityKind_ == ActivityType.ACT_Family_2 ||
                    daData_.activityKind_ == ActivityType.ACT_Family_3 ||
                    daData_.activityKind_ == ActivityType.ACT_Family_4)
                {
                    if (!GuildSystem.IsInGuild())
                    {
                        PopText.Instance.Show(LanguageManager.instance.GetValue("guildCanJoin"), PopText.WarningType.WT_Warning);
                        return;
                    }
                }

                if (TeamSystem.IsInTeam() && !TeamSystem.IsTeamLeader(GamePlayer.Instance.InstId) && !TeamSystem.AwayTeam(GamePlayer.Instance.InstId))
                {
                    PopText.Instance.Show(LanguageManager.instance.GetValue("onlyLeaderCanOperate"), PopText.WarningType.WT_Tip);
                    return;
                }
                string joinInfo = (string)UIEventListener.Get(go).parameter;

                GameManager.Instance.ParseNavMeshInfo(joinInfo, ConvertNpcType(activityType_));
                HongDongPanel.HidePanelByName(UIASSETS_ID.UIASSETS_DailyActivityPanel);
            }, false, null, null, "", "", 2000, true);
            return;
        }



        if (daData_.activityKind_ == ActivityType.ACT_Family_0 ||
            daData_.activityKind_ == ActivityType.ACT_Family_1 ||
            daData_.activityKind_ == ActivityType.ACT_Family_2 ||
            daData_.activityKind_ == ActivityType.ACT_Family_3 ||
            daData_.activityKind_ == ActivityType.ACT_Family_4)
        {
            if (!GuildSystem.IsInGuild())
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("guildCanJoin"), PopText.WarningType.WT_Warning);
                return;
            }
        }

        if (TeamSystem.IsInTeam() && !TeamSystem.IsTeamLeader(GamePlayer.Instance.InstId) && !TeamSystem.AwayTeam(GamePlayer.Instance.InstId))
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("onlyLeaderCanOperate"), PopText.WarningType.WT_Tip);
            return;
        }
        string joinInfos = (string)UIEventListener.Get(go).parameter;

        GameManager.Instance.ParseNavMeshInfo(joinInfos, ConvertNpcType(activityType_));
        HongDongPanel.HidePanelByName(UIASSETS_ID.UIASSETS_DailyActivityPanel);
        //if(string.IsNullOrEmpty(joinInfo))
        //{
        //NPCInfo npc = GameManager.Instance.GetGuaiWuGongChengNpc();
        //if (npc == null)
        //{
        //    ClientLog.Instance.LogError("没有找到怪物攻城NPC");
        //}
        //else
        //    joinInfo = string.Format("{0},{1};{2}", npc.sceneId_, npc.areaNum_, npc.id_);
        //    return;
        //}

        //string[] infos = joinInfo.Split(';');
        //string[] sceneInfo = infos[0].Split(',');
        //int sceneId = int.Parse(sceneInfo[0]);
        //int sceneAreaNum = 0;
        //bool tryGetAreaNumByNpc = false;
        //if (sceneInfo.Length > 1)
        //    sceneAreaNum = int.Parse(sceneInfo[1]);
        //else
        //    tryGetAreaNumByNpc = true;
        //int npcId = 0;
        //Vector2 destPos = Vector2.zero;
        //if (infos.Length > 1)
        //{
        //    if (infos[1].Contains(","))
        //    {
        //        string[] pos = infos[1].Split(',');
        //        destPos = new Vector2(float.Parse(pos[0]), float.Parse(pos[1]));
        //    }
        //    else
        //    {
        //        npcId = int.Parse(infos[1]);
        //    }
        //}
        //else
        //{
        //    string xml = SceneSimpleData.GetData(sceneId).sceneXml_;
        //    int bornId = SceneData.GetBornPosEntryID(xml);
        //    destPos = SceneData.GetEntryPos(xml, bornId);
        //}

        //bool APEOn = false;
        //if (npcId != 0)
        //{
        //    if (tryGetAreaNumByNpc)
        //    {
        //        //NPCInfo destNpc = GameManager.Instance.GetNpc(sceneId, npcId);
        //        //if (destNpc == null)
        //        //{
        //        //    // npc has not refresh finished.
        //        //    tryGetAreaNumByNpc = false;
        //        //    return;
        //        //}
        //        //else
        //        //{
        //        //    sceneAreaNum = destNpc.areaNum_;
        //        //}
        //        //tryGetAreaNumByNpc = false;
        //    }
        //    APEOn = Traveller.Instance.Launch().TravelTo(sceneId, sceneAreaNum, npcId);
        //}
        //else if (destPos != Vector2.zero)
        //    APEOn = Traveller.Instance.Launch().TravelTo(sceneId, sceneAreaNum, new Vector3(destPos.x, 0f, destPos.y));
        //if (APEOn)
        //{
        //    GamePlayer.Instance.IsNotAutoPathing = true;
        //    Prebattle.Instance.UpdateAutoPathingAction();
        //    Prebattle.Instance.ExcuteOnePathAction();
        //    Prebattle.Instance.SwitchAFPEffect(true);
        //}
    }
Пример #25
0
        public void Awake()
        {
            _indexTeam = SceneData.GetData("TeamIndex", 0);

            LoadTeamsFromFile();
        }