Exemple #1
0
    void OnEnable()
    {
        if (TeamSystem.IsInTeam())
        {
            updatePros(TeamSystem.GetTeamMembers());
        }
        if (TeamSystem.IsInTeam())
        {
            if (grid == null)
            {
                return;
            }
            foreach (Transform tr in grid.transform)
            {
                Destroy(tr.gameObject);
            }

            AddTeamItem(TeamSystem.GetTeamMembers());
            creataTeamBtn.gameObject.SetActive(false);
        }
        else
        {
            creataTeamBtn.gameObject.SetActive(true);
            UIManager.SetButtonEventHandler(creataTeamBtn.gameObject, EnumButtonEvent.OnClick, OnClickcreataTeamBtn, 0, 0);
        }
    }
Exemple #2
0
    void UpdateMainteamList()
    {
        if (TeamSystem.GetTeamMembers().Length == 0)
        {
            creataTeamBtn.gameObject.SetActive(true);
        }
        else
        {
            creataTeamBtn.gameObject.SetActive(false);
        }
        if (grid == null)
        {
            return;
        }
        foreach (Transform tr in grid.transform)
        {
            Destroy(tr.gameObject);
        }
//		teamPanle.clipOffset = Vector2.zero;
//		teamPanle.transform.localPosition = Vector3.zero;
//		teamPanle.GetComponent<UIScrollView>().ResetPosition();
//		teamPanle.GetComponent<UIPanel>().clipOffset = Vector2.zero;
//		teamPanle.transform.localPosition = Vector3.zero;
        AddTeamItem(TeamSystem.GetTeamMembers());
    }
Exemple #3
0
    private void  UpdateMyInfo()
    {
        COM_PlayerVsPlayer info = ArenaPvpSystem.Instance.MyInfo;

        if (info == null)
        {
            return;
        }
        PlayerData       pdata  = PlayerData.GetData((int)GamePlayer.Instance.Properties[(int)PropertyType.PT_TableId]);
        EntityAssetsData enData = EntityAssetsData.GetData(pdata.lookID_);

        if (!_icons.Contains(enData.assetsIocn_))
        {
            _icons.Add(enData.assetsIocn_);
        }

        Profession profession = Profession.get((JobType)GamePlayer.Instance.GetIprop(PropertyType.PT_Profession), (int)GamePlayer.Instance.GetIprop(PropertyType.PT_ProfessionLevel));

        COM_SimplePlayerInst[] team = TeamSystem.GetTeamMembers();
        if (team != null && team.Length > 0)
        {
            MyTeamInfo(team);
        }
        else
        {
            MysingleInfo(info);
        }
    }
Exemple #4
0
 void OnDelTeamPlayerEnvt(int a)
 {
     COM_SimplePlayerInst[] team = TeamSystem.GetTeamMembers();
     if (team != null && team.Length > 0)
     {
         MyTeamInfo(team);
     }
 }
Exemple #5
0
 COM_SimplePlayerInst GetPlayer(int uid)
 {
     for (int i = 0; i < TeamSystem.GetTeamMembers().Length; i++)
     {
         if (uid == TeamSystem.GetTeamMembers()[i].instId_)
         {
             return(TeamSystem.GetTeamMembers()[i]);
         }
     }
     return(null);
 }
Exemple #6
0
    void UpdateTeamMBOk(COM_SimplePlayerInst info)
    {
        index = TeamSystem.GetTeamMembers().Length - 1;
        ENTITY_ID weaponAssetId = 0;

        if (GlobalInstanceFunction.Instance.WeaponID(info) != 0)
        {
            weaponAssetId = (ENTITY_ID)ItemData.GetData(GlobalInstanceFunction.Instance.WeaponID(info)).weaponEntityId_;
        }
        GameManager.Instance.GetActorClone((ENTITY_ID)info.properties_[(int)PropertyType.PT_AssetId], weaponAssetId, EntityType.ET_Player, AssetLoadCallBack, new ParamData((int)info.instId_, index, (int)info.properties_[(int)PropertyType.PT_AssetId]), "UI", GlobalInstanceFunction.Instance.GetDressId(info.equips_));
        UIManager.SetButtonEventHandler(teamCells[index].gameObject, EnumButtonEvent.OnClick, OnClickShowTips, 0, 0);
    }
Exemple #7
0
 bool IsleaveTeam()
 {
     if (!TeamSystem.IsInTeam())
     {
         return(false);
     }
     for (int i = 0; i < TeamSystem.GetTeamMembers().Length; i++)
     {
         if (TeamSystem.AwayTeam((int)TeamSystem.GetTeamMembers()[i].instId_))
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #8
0
    private void OnChallengeBtn(ButtonScript obj, object args, int param1, int param2)
    {
        if (_curId != hundredSystem.instance.ChallengeNum)
        {
            //ErrorTipsUI.ShowMe(LanguageManager.instance.GetValue("hundredMax"));
            PopText.Instance.Show(LanguageManager.instance.GetValue("hundredMax"));
            return;
        }

        if (hundredSystem.instance.UseNum == 0)
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("tioazhancishumei"));
            return;
        }

        if (TeamSystem.IsInTeam() && !TeamSystem.IsTeamLeader(GamePlayer.Instance.InstId))
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("zuduizhongduichang"));
            return;
        }

        if (TeamSystem.IsInTeam())
        {
            COM_SimplePlayerInst[] team = TeamSystem.GetTeamMembers();
            if (team == null)
            {
                return;
            }
            //int level = 0;
            //GlobalValue.Get(Constant.C_PVPJJCOpenlevel, out level);
            for (int i = 0; i < team.Length; i++)
            {
                if (team[i].properties_[(int)PropertyType.PT_Level] < 35)
                {
                    PopText.Instance.Show(LanguageManager.instance.GetValue("duiyuandengji"));
                    return;
                }
            }
        }



        NetConnection.Instance.enterHundredScene((int)_curId);
        //ChallengeData cData = ChallengeData.GetData ((int)_curId);
        //if(cData == null)
        //    return;
        //Prebattle.Instance.EnterNewScene (cData.senceId_);
    }
Exemple #9
0
 void ShowTeamMembers()
 {
     if (TeamSystem.IsInTeam())
     {
         COM_SimplePlayerInst[] members = TeamSystem.GetTeamMembers();
         for (int i = 0; i < members.Length; ++i)
         {
             ENTITY_ID weaponAssetId = 0;
             if (GlobalInstanceFunction.Instance.WeaponID(members[i]) != 0)
             {
                 weaponAssetId = (ENTITY_ID)ItemData.GetData(GlobalInstanceFunction.Instance.WeaponID(members[i])).weaponEntityId_;
             }
             GameManager.Instance.GetActorClone((ENTITY_ID)members[i].properties_[(int)PropertyType.PT_AssetId], weaponAssetId, EntityType.ET_Player, AssetLoadCallBack, new ParamData((int)members[i].instId_, i, (int)members[i].properties_[(int)PropertyType.PT_AssetId]), "UI", GlobalInstanceFunction.Instance.GetDressId(members[i].equips_));
         }
     }
 }
Exemple #10
0
    public static int TeamMemberLevel(ILuaState lua)
    {
        if (!TeamSystem.IsInTeam())
        {
            L.PushNil();
            return(1);
        }

        L.NewTable();
        COM_SimplePlayerInst[] members = TeamSystem.GetTeamMembers();
        for (int i = 0; i < members.Length; ++i)
        {
            L.PushInteger(i + 1);
            L.PushInteger((int)members[i].properties_[(int)PropertyType.PT_Level]);
            L.SetTable(-3);
        }

        return(1);
    }
Exemple #11
0
    void changeLeaderOk(int uid)
    {
        COM_SimplePlayerInst[] members = TeamSystem.GetTeamMembers();
        COM_SimplePlayerInst   temp    = teamCells [0].GetComponent <TeamMemberCell> ().PlayerInst;

        if (uid != temp.instId_)
        {
            for (int i = 0; i < members.Length; ++i)
            {
                if ((int)members[i].instId_ == uid)
                {
                    //idx = i;
                    ChatSystem.PushSystemMessage(members[i].instName_ + LanguageManager.instance.GetValue("duizhang"));
                }
                DeTeamMunber((int)members[i].instId_);
            }
            GlobalInstanceFunction.Instance.Invoke(() => {
                ShowTeamMembers();
                UpdateUI();
            }, 1);
        }


//		int idx = 0;
//		if(GamePlayer.Instance.InstId == uid)
//		{
//
//			MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("shengweiduizhang"),null,true);
//		}

//		for (int i = 0; i < members.Length; ++i)
//		{
//			if ((int)members[i].instId_ == uid)
//			{
//				idx = i;
//
//				ChatSystem.PushSystemMessage(members[i].instName_ + LanguageManager.instance.GetValue("duizhang"));
//				break;
//			}
//		}

        //TeamSystem.UpdateMainTeamInfo ();
    }
Exemple #12
0
    void DeTeamMunber(int uid)
    {
        COM_SimplePlayerInst[] members = TeamSystem.GetTeamMembers();
//		for (int i = 0; i < members.Length; i++)
//		{
//			if (members[i].instId_ == uid)
//			{
//				for(int j = 0;j<rosobj.Count;j++)
//				{
//					if(int.Parse(rosobj[j].name) == uid)
//					{
//						ChatSystem.PushSystemMessage(members[i].instName_ + LanguageManager.instance.GetValue("likaifangjian"));
//						DestroyGameObj((ENTITY_ID)members[i].properties_[(int)PropertyType.PT_AssetId], true, rosobj[j]);
//						Destroy(rosobj[j]);
//						rosobj.RemoveAt(j);
//						//members[i] = null;
//						break;
//					}
//				}

//			}
//		}
        for (int i = 0; i < teamCells.Count; i++)
        {
            TeamMemberCell tcell = teamCells [i].GetComponent <TeamMemberCell> ();
            if (tcell.PlayerInst == null)
            {
                continue;
            }
            if (tcell.PlayerInst.instId_ == uid)
            {
                tcell.StateSp.spriteName = "dengdaizhong";
                tcell.OpenBtn.gameObject.SetActive(false);
                tcell.offBtn.gameObject.SetActive(true);
                tcell.RestMemberCellInfo();
                UIManager.RemoveButtonAllEventHandler(teamCells[i].gameObject);
                ChatSystem.PushSystemMessage(tcell.PlayerInst.instName_ + LanguageManager.instance.GetValue("likaifangjian"));
                DestroyGameObj((ENTITY_ID)tcell.PlayerInst.properties_[(int)PropertyType.PT_AssetId], true, tcell.modPos.GetChild(0).gameObject);
                Destroy(tcell.modPos.GetChild(0).gameObject);
            }
        }
        StartCoroutine(Do());
    }
Exemple #13
0
 bool IsTeamMemberInGuild()
 {
     if (!TeamSystem.IsInTeam())
     {
         return(false);
     }
     for (int i = 0; i < TeamSystem.GetTeamMembers().Length; i++)
     {
         if (GuildSystem.IsMyGuildMember((int)TeamSystem.GetTeamMembers()[i].instId_))
         {
             continue;
         }
         else
         {
             return(false);
         }
     }
     return(true);
 }
Exemple #14
0
    void AssetLoadCallBack(GameObject ro, ParamData data)
    {
        if (hasDestroy_)
        {
            Destroy(ro);
            return;
        }
        //RestMemberCellUI ();
        COM_SimplePlayerInst csi = TeamSystem.GetTeamMemberByIndex(data.iParam2);

        if (csi == null)
        {
            Destroy(ro);
            return; /// 这里可能有问题
        }
        ro.name = csi.instId_.ToString();
        TeamMemberCell tell;

        if (int.Parse(ro.name) == TeamSystem.GetTeamMembers()[0].instId_)
        {
            tell = teamCells[0].GetComponent <TeamMemberCell>();
            UIManager.SetButtonEventHandler(teamCells[0].gameObject, EnumButtonEvent.OnClick, OnClickShowTips, 0, 0);
        }
        else
        {
            tell = findEmptyPos();
        }
        ro.transform.parent = tell.modPos;

        //tell.modPos.transform.localPosition = new Vector3 (20f,-166f,-100f);
        tell.gameObject.name       = csi.instId_.ToString();
        ro.transform.localPosition = Vector3.zero;
        ro.transform.rotation      = new Quaternion(ro.transform.rotation.x, -180, ro.transform.rotation.z, ro.transform.rotation.w);
        ro.transform.localScale    = new Vector3(EntityAssetsData.GetData(data.iParam3).zoom_, EntityAssetsData.GetData(data.iParam3).zoom_, EntityAssetsData.GetData(data.iParam3).zoom_);
        tell.PlayerInst            = csi;
        ro.AddComponent <EffectLevel> ();
        EffectLevel el = ro.GetComponent <EffectLevel> ();

        el.target = tell.gameObject.GetComponent <UIWidget>();
        rosobj.Add(ro);
        UpdateUI();
    }
Exemple #15
0
    void AddItem()
    {
        for (int i = 0; i < TeamSystem.GetTeamMembers().Length; i++)
        {
            GameObject go = Instantiate(item) as GameObject;
            go.SetActive(true);
            go.transform.parent     = grid.transform;
            go.transform.localScale = Vector3.one;
            UITexture tex = go.GetComponent <UITexture>();

            PlayerData       pdata  = PlayerData.GetData((int)TeamSystem.GetTeamMembers()[i].properties_[(int)PropertyType.PT_TableId]);
            EntityAssetsData enData = EntityAssetsData.GetData(pdata.lookID_);
            HeadIconLoader.Instance.LoadIcon(enData.assetsIocn_, tex);
            UILabel [] las = go.GetComponentsInChildren <UILabel>();
            for (int j = 0; j < las.Length; j++)
            {
                if (las[j].name.Equals("duizhanLabel"))
                {
                    las[j].text = TeamSystem.GetTeamMembers()[i].instName_;
                }
                if (las[j].name.Equals("zhiyeLabel"))
                {
                    las[j].text = Profession.get((JobType)TeamSystem.GetTeamMembers()[i].properties_[(int)PropertyType.PT_Profession], (int)TeamSystem.GetTeamMembers()[i].properties_[(int)PropertyType.PT_ProfessionLevel]).jobName_;
                }
                if (las[j].name.Equals("dengjiLabel"))
                {
                    las[j].text = TeamSystem.GetTeamMembers()[i].properties_[(int)PropertyType.PT_Level].ToString();
                }
                if (las[j].name.Equals("titleLabel"))
                {
                    if (TeamSystem.IsTeamLeader((int)TeamSystem.GetTeamMembers()[i].instId_))
                    {
                        las[j].text = LanguageManager.instance.GetValue("duizhang");
                    }
                    else
                    {
                        las[j].text = LanguageManager.instance.GetValue("duiyuan");
                    }
                }
            }
        }
    }
Exemple #16
0
    public static int HasLeaveMember(ILuaState lua)
    {
        if (!TeamSystem.IsInTeam())
        {
            L.PushBoolean(false);
            return(1);
        }

        COM_SimplePlayerInst[] members = TeamSystem.GetTeamMembers();
        for (int i = 0; i < members.Length; ++i)
        {
            if (members[i].isLeavingTeam_)
            {
                L.PushBoolean(true);
                return(1);
            }
        }
        L.PushBoolean(false);
        return(1);
    }
Exemple #17
0
    private void OnClickzh(ButtonScript obj, object args, int param1, int param2)
    {
        if (CopyData.IsCopyScene(GameManager.SceneID))
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("bunengzhaohuan"));
            return;
        }

        for (int i = 0; i < TeamSystem.GetTeamMembers().Length; i++)
        {
            if (!TeamSystem.IsTeamLeader((int)TeamSystem.GetTeamMembers()[i].instId_))
            {
                if (TeamSystem.GetTeamMembers()[i].isLeavingTeam_)
                {
                    NetConnection.Instance.teamCallMember((int)TeamSystem.GetTeamMembers()[i].instId_);
                }
            }
        }



        tipsObj.SetActive(false);
    }
Exemple #18
0
    private void OnChallengeBtn(ButtonScript obj, object args, int param1, int param2)
    {
        if (ArenaSystem.Instance.ChallengeNum <= 0)
        {
            //ErrorTipsUI.ShowMe( LanguageManager.instance.GetValue("ChallengeNum"));
            PopText.Instance.Show(LanguageManager.instance.GetValue("ChallengeNum"));
            return;
        }
        if (ArenaSystem.Instance.RemainCDTime > 0)
        {
            //ErrorTipsUI.ShowMe( LanguageManager.instance.GetValue("RemainCDTime"));
            PopText.Instance.Show(LanguageManager.instance.GetValue("RemainCDTime"));
            return;
        }
        COM_SimplePlayerInst[] team = TeamSystem.GetTeamMembers();
        if (team != null && team.Length > 0)
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("zhuduibuxing"));
            return;
        }

        NetConnection.Instance.requestChallenge(_player.name_);
        ArenaUI.HideMe();
    }
Exemple #19
0
    public void NpcOpenUI(UIASSETS_ID id)
    {
        switch (id)
        {
        case UIASSETS_ID.UIASSETS__BabySkillLearning:
            BabySkillLearning.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_ProfessionPanel:
            ProfessionPanel.SwithShowMe();
            //UIBase.AsyncLoad(UIASSETS_ID.UIASSETS_ProfessionPanel);
            break;

        case UIASSETS_ID.UIASSETS_ExchangePanel:
            Exchange.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS__LearningUI:
            if (GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Bar))
            {
                LearningUI.SwithShowMe();
            }
            break;

        case UIASSETS_ID.UIASSETS_FamilyPanel:
            FamilyPanelUI.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_FamilinfoPanel:
            MyFamilyInfo.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_FamilShopPanel:
            FamilyShopUI.SwithShowMe(true);
            break;

        case UIASSETS_ID.UIASSETS__StoreUI:
            if (GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Shop))
            {
                StoreUI.SwithShowMe(2);
            }
            break;

        case UIASSETS_ID.UIASSETS__Arena:
            if (GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_JJC))
            {
                ArenaUI.SwithShowMe();
            }
            else
            {
                int level = 0;
                GlobalValue.Get(Constant.C_PVPJJCOpenlevel, out level);
                if (GamePlayer.Instance.GetIprop(PropertyType.PT_Level) < level)
                {
                    PopText.Instance.Show(LanguageManager.instance.GetValue("EN_OpenBaoXiangLevel"));
                    return;
                }
            }
            break;

        case UIASSETS_ID.UIASSETS_ArenaPvpPanel:
            if (GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_PVPJJC))
            {
                bool isOpen = ActivitySystem.Instance.GetInfoState(7) == ActivitySystem.ActivityInfo.ActivityState.AS_Open;
                if (!isOpen)
                {
                    PopText.Instance.Show(LanguageManager.instance.GetValue("jjcmeikai"));
                    return;
                }

                if (TeamSystem.IsInTeam())
                {
                    if (!TeamSystem.IsTeamLeader())
                    {
                        PopText.Instance.Show(LanguageManager.instance.GetValue("teamopen"));
                        return;
                    }

                    COM_SimplePlayerInst[] team = TeamSystem.GetTeamMembers();
                    if (team == null || team.Length < 3)
                    {
                        PopText.Instance.Show(LanguageManager.instance.GetValue("arenapvpnum"));
                        return;
                    }
                    if (team != null && team.Length > 0)
                    {
                        for (int i = 0; i < team.Length; i++)
                        {
                            if (team[i].isLeavingTeam_)
                            {
                                PopText.Instance.Show(LanguageManager.instance.GetValue("teamMemberLeavingNoopen"));
                                return;
                            }
                        }

                        int level = 0;
                        GlobalValue.Get(Constant.C_PVPJJCOpenlevel, out level);
                        for (int i = 0; i < team.Length; i++)
                        {
                            if (team[i].properties_[(int)PropertyType.PT_Level] < level)
                            {
                                PopText.Instance.Show(LanguageManager.instance.GetValue("duiyuandengji"));
                                return;
                            }
                        }
                    }
                }
                else
                {
                    PopText.Instance.Show(LanguageManager.instance.GetValue("pvpzudui"));
                    return;
                }

                NetConnection.Instance.joinWarriorchoose();

                //NetConnection.Instance.requestpvprank();
                //NetConnection.Instance.requestMyJJCTeamMsg();
                //ArenaPvpPanelUI.SwithShowMe();
            }
            else
            {
                int level = 0;
                GlobalValue.Get(Constant.C_PVPJJCOpenlevel, out level);
                if (GamePlayer.Instance.GetIprop(PropertyType.PT_Level) < level)
                {
                    PopText.Instance.Show(LanguageManager.instance.GetValue("EN_OpenBaoXiangLevel"));
                    return;
                }
            }
            break;

        case UIASSETS_ID.UIASSETS__WordMapUI:
            WorldMap.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_GatherPanel:
            SkillViewUI.SwithShowMe(1);
            break;

        case UIASSETS_ID.UIASSETS_AuctionHousePanel:
            if (GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_AuctionHouse))
            {
                if (AuctionHouseSystem.Open_ == false)
                {
                    PopText.Instance.Show(LanguageManager.instance.GetValue("AuctionHouseClosed"), PopText.WarningType.WT_Warning);
                    return;
                }
                AuctionHousePanel.SwithShowMe();
            }
            break;

        case UIASSETS_ID.UIASSETS_HundredUI:
            if (GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Hundred))
            {
                HundredUI.SwithShowMe();
            }
            break;

        case UIASSETS_ID.UIASSETS_EmailPanel:
            EmailUI.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_LookchiPanel:
            LookTreeUI.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_PetTemple:
            PetTemple.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_FanilyBank:
            FanilyBankUI.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_FamilyCollection:
            FamilyCollectionUI.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_GuildBattlePanel:
            GuildBattleEnterScene.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_FamilyMonster:
        {
            if (FamilySystem.instance.GuildMember != null && (int)GuildSystem.GetGuildMemberSelf((int)GamePlayer.Instance.InstId).job_ >= (int)GuildJob.GJ_VicePremier)
            {
                FamilyMonsterUI.SwithShowMe();
            }
            else
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("EN_CommandPositionLess"));
            }
        }
        break;

        case UIASSETS_ID.UIASSETS_CopyOpenPanel:
            CopyOpenUI.SwithShowMe();
            break;

        case UIASSETS_ID.UIASSETS_EmployeeTask:
            NetConnection.Instance.requestEmployeeQuest();
            break;

        case UIASSETS_ID.UIASSETS_EquipUIPanel:
            EquipUIPanel.SwithShowMe();
            break;
        }
    }
Exemple #20
0
 public void UpdateUI()
 {
     if (!TeamSystem.IsInTeam())
     {
         tuichuBtn.gameObject.SetActive(false);
         return;
     }
     tuichuBtn.gameObject.SetActive(true);
     UIManager.SetButtonEventHandler(tuichuBtn.gameObject, EnumButtonEvent.OnClick, OnClickTuichu, 0, 0);
     // is leader
     isLeader_ = TeamSystem.IsTeamLeader();
     duaiyuanObj.gameObject.SetActive(!isLeader_);
     duaizhangObj.gameObject.SetActive(isLeader_);
     mubiaoObj.SetActive(true);
     teamnameObj.SetActive(true);
     teamnameLabel.text = TeamSystem._MyTeamInfo.name_;
     mubiaoLabel.text   = LanguageManager.instance.GetValue(TeamSystem._MyTeamInfo.type_.ToString()) + "(" + TeamSystem._MyTeamInfo.minLevel_.ToString() + "级" + "-" + TeamSystem._MyTeamInfo.maxLevel_.ToString() + "级" + ")";
     huobanBtn.gameObject.SetActive(isLeader_);
     if (huobanBtn.gameObject.activeSelf)
     {
         UIManager.SetButtonEventHandler(huobanBtn.gameObject, EnumButtonEvent.OnClick, OnClickHuoban, 0, 0);
     }
     if (duaizhangObj.activeSelf)
     {
         UIManager.SetButtonEventHandler(hanhuaBt.gameObject, EnumButtonEvent.OnClick, OnClickHuanhua, 0, 0);
         UIManager.SetButtonEventHandler(XiugaiBtn.gameObject, EnumButtonEvent.OnClick, OnClickXiugai, 0, 0);
         UIManager.SetButtonEventHandler(YaoqingBtn.gameObject, EnumButtonEvent.OnClick, OnClickYaoqing, 0, 0);
     }
     else if (duaiyuanObj.activeSelf)
     {
         UIManager.SetButtonEventHandler(zanshiBtn.gameObject, EnumButtonEvent.OnClick, OnClickzanshi, 0, 0);
         UIManager.SetButtonEventHandler(backTeamBtn.gameObject, EnumButtonEvent.OnClick, OnClickbackTeam, 0, 0);
     }
     COM_SimplePlayerInst[] members = TeamSystem.GetTeamMembers();
     for (int i = 0; i < members.Length; i++)
     {
         if (isLeader_)
         {
             if (TeamSystem.IsTeamLeader((int)members[i].instId_))
             {
                 UpdateMaxMenberS();
             }
         }
         else
         {
             ShowTeamPosition();
             //HidenMaxMenberSizeUI();
         }
         for (int j = 0; j < teamCells.Count; j++)
         {
             TeamMemberCell tecll = teamCells[j].GetComponent <TeamMemberCell>();
             if (tecll.modPos.transform.childCount == 0)
             {
                 continue;
             }
             if (int.Parse(teamCells[j].name) == members[i].instId_)
             {
                 if (TeamSystem.IsTeamLeader((int)members[i].instId_))
                 {
                     tecll.duizhangSp.spriteName = "duizhang";
                 }
                 else
                 {
                     tecll.duizhangSp.spriteName = "duiyuan";
                 }
                 if (tecll.PlayerInst != null)
                 {
                     if (tecll.PlayerInst.isLeavingTeam_)
                     {
                         backTeamBtn.gameObject.SetActive(true);
                         zanshiBtn.gameObject.SetActive(false);
                         tecll.heiObj.SetActive(true);
                         tecll.StateSp.spriteName = "zanli";
                         tecll.OpenBtn.gameObject.SetActive(false);
                         tecll.offBtn.gameObject.SetActive(false);
                     }
                     else
                     {
                         backTeamBtn.gameObject.SetActive(false);
                         zanshiBtn.gameObject.SetActive(true);
                         tecll.heiObj.SetActive(false);
                     }
                 }
             }
         }
     }
     openOrOffBtn();
 }
Exemple #21
0
    void Start()
    {
        item.SetActive(false);
        SwitchBtnSprite(false);
        teamObj.SetActive(false);
        tasksObj.SetActive(true);

        //questitem.SetActive(false);
        PlayTween = RightButton.GetComponent <UIPlayTween>();
        UIManager.SetButtonEventHandler(TaskButton.gameObject, EnumButtonEvent.OnClick, OnClickPTaskBtn, 0, 0);

        UIManager.SetButtonEventHandler(TeamButton.gameObject, EnumButtonEvent.OnClick, OnClickPTeamButton, 0, 0);

        UIManager.SetButtonEventHandler(RightButton.gameObject, EnumButtonEvent.OnClick, OnRightButtonDown, 0, 0);
        //QuestSystem.OnQuestUpdate += OnQuestUpdateOk;
        if (QuestSystem.CurrentList.Count == 0)
        {
            PlayerPrefs.SetInt("xysk_miniQuest_open", 0);
        }
        else
        {
            PlayerPrefs.SetInt("xysk_miniQuest_open", 1);
        }
        IsOpen = PlayerPrefs.GetInt("xysk_miniQuest_open") == 1;
        if (IsOpen)
        {
            PlayTween.Play(IsOpen);
        }
        if (IsOpen)
        {
            //raSp.transform.rotation = new Quaternion(raSp.transform.rotation.x,180,raSp.transform.rotation.z,raSp.transform.rotation.w);
            TweenRotation rot = raSp.GetComponent <TweenRotation>();
            rot.from = new Vector3(0, 0, 0);
            rot.to   = new Vector3(0, 180, 0);
        }
        else
        {
            TweenRotation rot = raSp.GetComponent <TweenRotation>();

            rot.from = new Vector3(0, 180, 0);
            rot.to   = new Vector3(0, 0, 0);
        }
        GuideManager.Instance.RegistGuideAim(TeamButton.gameObject, GuideAimType.GAT_MainTeamBtn);
        GuideManager.Instance.RegistGuideAim(TaskButton.gameObject, GuideAimType.GAT_MainTaskBtn);
        questitem.SetActive(false);
        //GuideManager.Instance.RegistGuideAim(questitem.transform.parent.gameObject, GuideAimType.GAT_QuestMiniFirst);
//		GuideManager.Instance.RegistGuideAim(questItems[1].transform.parent.gameObject, GuideAimType.GAT_QuestMiniSecond);
//		GuideManager.Instance.RegistGuideAim(questItems[2].transform.parent.gameObject, GuideAimType.GAT_QuestMiniThird);


        if (TeamSystem.IsInTeam())
        {
            if (grid == null)
            {
                return;
            }
            foreach (Transform tr in grid.transform)
            {
                Destroy(tr.gameObject);
            }
//			teamPanle.clipOffset = Vector2.zero;
//			teamPanle.transform.localPosition = Vector3.zero;
//			teamPanle.GetComponent<UIScrollView>().ResetPosition();
//			teamPanle.GetComponent<UIPanel>().clipOffset = Vector2.zero;
//			teamPanle.transform.localPosition = Vector3.zero;
            AddTeamItem(TeamSystem.GetTeamMembers());
            creataTeamBtn.gameObject.SetActive(false);
        }
        else
        {
            creataTeamBtn.gameObject.SetActive(true);
            UIManager.SetButtonEventHandler(creataTeamBtn.gameObject, EnumButtonEvent.OnClick, OnClickcreataTeamBtn, 0, 0);
        }
        TeamSystem.OnUpdateMainteamList += UpdateMainteamList;
        QuestSystem.OnQuestEffectFinish += TaskLabe;
        TeamSystem.OnTeamDirtyProps     += updatePros;

        if (QuestSystem.isTaskF)
        {
            ResetTaskLabe();
            QuestSystem.isTaskF = false;
        }
        if (!GamePlayer.Instance.GetOpenSubSystemFlag(OpenSubSystemFlag.OSSF_Castle))
        {
            TeamButton.pressedSprite = "duiwuan";
            TeamButton.normalSprite  = "duiwuan";
        }
        OnQuestUpdateOk();
    }