Пример #1
0
    bool IschatChannel()
    {
        if (_SendChatKind != ChatKind.CK_World)
        {
            if (!GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Family) && _OpenChannels[(int)ChatKind.CK_Guild])
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("jiazuweikaiqi"));
                return(false);
            }
            if (!GuildSystem.IsInGuild() && _OpenChannels[(int)ChatKind.CK_Guild])
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("meiyoujiazu"));
                return(false);
            }
            if (!GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Team) && _OpenChannels[(int)ChatKind.CK_Team])
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("duiwuweikai"));
                return(false);
            }
            if (!TeamSystem.IsInTeam() && _OpenChannels[(int)ChatKind.CK_Team])
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("meiyouduiwu"));
                return(false);
            }
            if (_OpenChannels[(int)ChatKind.CK_System])
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("bunengfasong"));
                return(false);
            }
        }

        return(true);
    }
Пример #2
0
 private void OnyaoqingBtn(ButtonScript obj, object args, int param1, int param2)
 {
     if (GuildSystem.IsInGuild())
     {
         gjob = (GuildJob)Enum.ToObject(typeof(GuildJob), GuildSystem.GetGuildMemberSelf(GamePlayer.Instance.InstId).job_);
         if (gjob == GuildJob.GJ_VicePremier)
         {
             PopText.Instance.Show(LanguageManager.instance.GetValue("yaoqingchenggong"));
         }
         else if (gjob == GuildJob.GJ_SecretaryHead)
         {
             PopText.Instance.Show(LanguageManager.instance.GetValue("yaoqingchenggong"));
         }
         else
         if (gjob == GuildJob.GJ_Premier)
         {
             PopText.Instance.Show(LanguageManager.instance.GetValue("yaoqingchenggong"));
         }
         NetConnection.Instance.inviteJoinGuild(_splayerInst.instName_);
     }
     else
     {
         PopText.Instance.Show(LanguageManager.instance.GetValue("nojiazu"));
     }
 }
Пример #3
0
    void OnClickChuan(ButtonScript obj, object args, int param1, int param2)
    {
        QuestData qdata = QuestData.GetData(CurrentId);

        if (qdata.questKind_ == QuestKind.QK_Guild)
        {
            if (!GuildSystem.IsInGuild())
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("gonghui"));
                return;
            }
        }
        if (GameManager.Instance.ParseNavMeshInfo(qdata.xunlu))
        {
            Prebattle.Instance.ChangeWalkEff(Prebattle.WalkState.WS_AFP);
        }
    }
Пример #4
0
    private void OnClickenter(ButtonScript obj, object args, int param1, int param2)
    {
        if (GuildSystem.IsInGuild())
        {
            if (GuildSystem.Mguild.buildings_[((int)GuildBuildingType.GBT_Main) - 1].level_ < 2)
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("dengjibuzu"));
                return;
            }
            if (TeamSystem.IsInTeam())
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("bunengzudui"));
                return;
            }
        }


        NetConnection.Instance.transforGuildBattleScene();
    }
Пример #5
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);
        //}
    }
Пример #6
0
    void Start()
    {
        int mucId = 0;

        if (Battle.Instance.battleType == BattleType.BT_PVE)
        {
            if (Battle.Instance.BattleID == 0)
            {
                GlobalValue.Get(Constant.C_BossMuc, out mucId);
                SoundTools.PlayMusic((MUSIC_ID)mucId);
            }
            else
            {
                GlobalValue.Get(Constant.C_PutnMuc, out mucId);
                SoundTools.PlayMusic((MUSIC_ID)mucId);
            }
        }
        else
        if (Battle.Instance.battleType == BattleType.BT_PVP)
        {
            GlobalValue.Get(Constant.C_PvpMuc, out mucId);
            SoundTools.PlayMusic((MUSIC_ID)mucId);
        }
        HideAttackType();
        levelLabel.text = GamePlayer.Instance.Properties [(int)PropertyType.PT_Level].ToString();
        HeadIconLoader.Instance.LoadIcon("R_" + EntityAssetsData.GetData((int)GamePlayer.Instance.Properties [(int)PropertyType.PT_AssetId]).assetsIocn_, palyIcon);
        HUD.SetActive(false);
        attackNumSp.transform.gameObject.SetActive(false);
        closeSkillWindow();
        closeSkillTwoWindow();
        ClosePetWindow();
        lstEntityUI = new List <GameObject>();
        GameObject pos = GameObject.Find("CenterPoint");

        if (pos == null)
        {
            return;
        }

        CountDownG.transform.localPosition = GlobalInstanceFunction.WorldToUI(pos.transform.position);
        tempstr = playernanmeLabel.text;
        BagSystem.instance.UpdateItemEvent     += OnItemUpdate;
        BagSystem.instance.DelItemInstEvent    += OnItemDelete;
        BagSystem.instance.ItemChanged         += OnItemAdd;
        BagSystem.instance.BattleOpenBagEvent  += new RequestEventHandler <bool>(OpenBagEvent);
        UIManager.Instance.showMainPanelEnvent += new RequestEventHandler <bool>(AttackPanelShow);

        UpdateItemCount();

        buttons.Add(attackBtn);
        buttons.Add(skillBtn);
        buttons.Add(DefenseBtn);
        buttons.Add(PosBtn);
        buttons.Add(AUTOBtn);
        buttons.Add(ArticleBtn);
        buttons.Add(petBtn);
        buttons.Add(fleeBtn);
        buttons.Add(catchBtn);


        UIManager.SetButtonEventHandler(teamBtn.gameObject, EnumButtonEvent.OnClick, teamBtnClick, 0, 0);
        UIManager.SetButtonEventHandler(zihyinBtn.gameObject, EnumButtonEvent.OnClick, zihyinBtnClick, 0, 0);
        UIManager.SetButtonEventHandler(renwuBtn.gameObject, EnumButtonEvent.OnClick, OnClickrenwuBtn, 0, 0);
        UIManager.SetButtonEventHandler(skilliBtn.gameObject, EnumButtonEvent.OnClick, OnClickskilliBtn, 0, 0);
        //UIManager.SetButtonEventHandler (bagaBtn.gameObject, EnumButtonEvent.OnClick, OnClickbagaBtn, 0, 0);
        UIManager.SetButtonEventHandler(shopBtn.gameObject, EnumButtonEvent.OnClick, OnClickshopBtn, 0, 0);
        UIManager.SetButtonEventHandler(famBtn.gameObject, EnumButtonEvent.OnClick, OnClickfamBtn, 0, 0);
        UIManager.SetButtonEventHandler(huodongBtn.gameObject, EnumButtonEvent.OnClick, OnClickhuodongBtn, 0, 0);
        UIManager.SetButtonEventHandler(jincaBtn.gameObject, EnumButtonEvent.OnClick, OnClickjincaBtn, 0, 0);

        UIManager.SetButtonEventHandler(backBtn.gameObject, EnumButtonEvent.OnClick, BackClick, 0, 0);
        UIManager.SetButtonEventHandler(PlayerBackBtn.gameObject, EnumButtonEvent.OnClick, PlayerBackClick, 0, 0);
        UIManager.SetButtonEventHandler(catchBtn.gameObject, EnumButtonEvent.OnClick, OnClickCatchBtn, 0, 0);
        UIManager.SetButtonEventHandler(attackBtn.gameObject, EnumButtonEvent.OnClick, OnClickattackBtn, 0, 0);
        UIManager.SetButtonEventHandler(skillBtn.gameObject, EnumButtonEvent.OnClick, OnClickskillBtn, 0, 0);
        UIManager.SetButtonEventHandler(DefenseBtn.gameObject, EnumButtonEvent.OnClick, OnClickDefenseBtn, 0, 0);
        UIManager.SetButtonEventHandler(PosBtn.gameObject, EnumButtonEvent.OnClick, OnClickPosBtn, 0, 0);
        UIManager.SetButtonEventHandler(AUTOBtn.gameObject, EnumButtonEvent.OnClick, OnClickAUTOBtn, 0, 0);
        UIManager.SetButtonEventHandler(ArticleBtn.gameObject, EnumButtonEvent.OnClick, OnClickArticleBtn, 0, 0);
        UIManager.SetButtonEventHandler(petBtn.gameObject, EnumButtonEvent.OnClick, OnClickpetBtn, 0, 0);
        UIManager.SetButtonEventHandler(fleeBtn.gameObject, EnumButtonEvent.OnClick, OnClickfleeBtn, 0, 0);
        UIManager.SetButtonEventHandler(CanAUTOBtn.gameObject, EnumButtonEvent.OnClick, OnClickCanAUTO, 0, 0);
        UIManager.SetButtonEventHandler(speedUpBtn_.gameObject, EnumButtonEvent.OnClick, OnSpeedUpBtn, 0, 0);
        UIManager.SetButtonEventHandler(playerActionBtn.gameObject, EnumButtonEvent.OnClick, OnPlayerActionBtn, 0, 0);
        UIManager.SetButtonEventHandler(petActionBtn.gameObject, EnumButtonEvent.OnClick, OnPetActionBtn, 0, 0);
        UIManager.SetButtonEventHandler(babyHUD.gameObject, EnumButtonEvent.OnClick, OnShowBaby, 0, 0);
        UIEventListener.Get(playeroBJ).onClick = OnOpenPlayer;
        AutoPlayerPanel.GetComponent <ChangeAutoOrder>().operatType_ = OperateType.OT_P1;
        AutoPetPanel.GetComponent <ChangeAutoOrder>().operatType_    = OperateType.OT_B;

        curHp = GamePlayer.Instance.GetIprop(PropertyType.PT_HpCurr);
        curMp = GamePlayer.Instance.GetIprop(PropertyType.PT_MpCurr);

        if (GamePlayer.Instance.BattleBaby != null)
        {
            curHpbb = GamePlayer.Instance.BattleBaby.GetIprop(PropertyType.PT_HpCurr);
            curMpbb = GamePlayer.Instance.BattleBaby.GetIprop(PropertyType.PT_MpCurr);
        }

        speedUpBtn_.normalSprite = Battle.Instance.speedUpOn_ ? speedUpImg : normalImg;
        if (GuildSystem.IsInGuild())
        {
            famBtn.isEnabled = true;
            UISprite sp = famBtn.GetComponentInChildren <UISprite>();
            sp.color = new Color(255, 255, 255);
        }
        else
        {
            UISprite sp = famBtn.GetComponentInChildren <UISprite>();
            sp.color         = new Color(0, 255, 0);
            famBtn.isEnabled = false;
        }
        if (TeamSystem.IsInTeam())
        {
            UISprite sp = teamBtn.GetComponentInChildren <UISprite>();
            sp.color          = new Color(255, 255, 255);
            teamBtn.isEnabled = true;
        }
        else
        {
            UISprite sp = teamBtn.GetComponentInChildren <UISprite>();
            sp.color          = new Color(0, 255, 0);
            teamBtn.isEnabled = false;
        }
        if (GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Shop))
        {
            UISprite sp = shopBtn.GetComponentInChildren <UISprite>();
            sp.color          = new Color(255, 255, 255);
            shopBtn.isEnabled = true;
        }
        else
        {
            UISprite sp = shopBtn.GetComponentInChildren <UISprite>();
            sp.color          = new Color(0, 255, 0);
            shopBtn.isEnabled = false;
        }
        if (GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Guid))
        {
            UISprite sp = zihyinBtn.GetComponentInChildren <UISprite>();
            sp.color            = new Color(255, 255, 255);
            zihyinBtn.isEnabled = true;
        }
        else
        {
            UISprite sp = zihyinBtn.GetComponentInChildren <UISprite>();
            sp.color            = new Color(0, 255, 0);
            zihyinBtn.isEnabled = false;
        }
        if (GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Activity))
        {
            UISprite sp = huodongBtn.GetComponentInChildren <UISprite>();
            sp.color             = new Color(255, 255, 255);
            huodongBtn.isEnabled = true;
        }
        else
        {
            UISprite sp = huodongBtn.GetComponentInChildren <UISprite>();
            sp.color             = new Color(0, 255, 0);
            huodongBtn.isEnabled = false;
        }
        if (GamePlayer.Instance.GetIprop(PropertyType.PT_Level) >= GamePlayer.Instance.openADActivityLv)
        {
            UISprite sp = jincaBtn.GetComponentInChildren <UISprite>();
            if (GamePlayer.Instance.adTypes.Count == 0)
            {
                sp.color           = new Color(0, 255, 0);
                jincaBtn.isEnabled = false;
            }

            if (GamePlayer.Instance.adTypes.Count > 0)
            {
                sp.color           = new Color(255, 255, 255);
                jincaBtn.isEnabled = true;
            }
        }
        else
        {
            UISprite sp = jincaBtn.GetComponentInChildren <UISprite>();
            sp.color           = new Color(0, 255, 0);
            jincaBtn.isEnabled = false;
        }
        GuideManager.Instance.RegistGuideAim(attackBtn.gameObject, GuideAimType.GAT_BattleAttack);
        GuideManager.Instance.RegistGuideAim(skillBtn.gameObject, GuideAimType.GAT_BattleSkill);
        GuideManager.Instance.RegistGuideAim(AUTOBtn.gameObject, GuideAimType.GAT_BattleAuto);
        GuideManager.Instance.RegistGuideAim(ArticleBtn.gameObject, GuideAimType.GAT_BattleBag);
        GuideManager.Instance.RegistGuideAim(catchBtn.gameObject, GuideAimType.GAT_BattleCatch);
        GuideManager.Instance.RegistGuideAim(playerActionBtn.gameObject, GuideAimType.GAT_PlayerAuto);
        GlobalInstanceFunction.Instance.UpdatecounDownTime += attackEvent;
        if (GuideManager.Instance.InBattleGuide_)
        {
            CloseCountDown();
        }

        AttaclEvent.getInstance.OnSetPanelActive += SetSelfActive;
        huiheObj.SetActive(false);
        hasDestroy = false;
        SetBabyInfo();
    }