Exemple #1
0
 public void Init(string title, eGuildTabMode mode, System.Action<eGuildTabMode> callback)
 {
     m_LabelTitle.text = title;
     m_Mode = mode;
     m_Toggle.Set(false);
     m_Callback = callback;
 }
Exemple #2
0
    public void SetTab(eGuildTabMode mode)
    {
        GuildTab tab = null;

        if (Tabs.TryGetValue(mode, out tab) == true)
        {
            m_CurrentTab = mode;
            tab.OnTabClick();
        }
    }
Exemple #3
0
    void OnTabClick(eGuildTabMode mode)
    {
        m_CurrentTab = mode;
        AllContentsDiable();
        GuildContentsBase content = null;

        if (Contents.TryGetValue(mode, out content) == false)
        {
            switch (mode)
            {
            case eGuildTabMode.GuildJoin:
                content = GameObject.Instantiate(GuildJoinPrefab).GetComponent <GuildJoin>();
                break;

            case eGuildTabMode.GuildCreate:
                content = GameObject.Instantiate(GuildCreatePrefab).GetComponent <GuildCreate>();
                break;

            case eGuildTabMode.GuildInfo:
                content = GameObject.Instantiate(GuildInfoPrefab).GetComponent <UIGuildInfo>();
                break;

            case eGuildTabMode.GuildBuff:
                content = GameObject.Instantiate(GuildBuffPrefab).GetComponent <GuildBuff>();
                break;

            case eGuildTabMode.RequestList:
                content = GameObject.Instantiate(RequestListPrefab).GetComponent <GuildRequestList>();
                break;

            case eGuildTabMode.GuildRank:
                content = GameObject.Instantiate(GuildRankPrefab).GetComponent <GuildRank>();
                break;

            case eGuildTabMode.GuildManagement:
                content = GameObject.Instantiate(GuildManagementPrefab).GetComponent <GuildManagement>();
                break;

            default:
                Tooltip.Instance.ShowMessageKey("NotImplement");
                return;
            }
            content.transform.SetParent(m_Contents.transform, false);
            content.transform.localPosition = Vector3.zero;
            content.transform.localScale    = Vector3.one;
            Contents.Add(mode, content);
        }
        content.Init(this);
    }
Exemple #4
0
    override public bool Init(MenuParams parms)
    {
        GuildTabPrefabManager.Clear();
        if (parms.bBack == true)
        {
            var tabs = Tabs.Keys.ToList();
            Tabs.Clear();
            InitTabs(tabs);
            SetTab(m_CurrentTab);
            return(true);
        }
        Tabs.Clear();
        if (GuildManager.Instance.IsGuildJoined)
        {
            m_CurrentTab = eGuildTabMode.GuildInfo;
            List <eGuildTabMode> tabs = new List <eGuildTabMode>()
            {
                m_CurrentTab, eGuildTabMode.GuildBuff, eGuildTabMode.GuildRank
            };
            if (GuildManager.Instance.AvailableGuildManagement)
            {
                tabs.Add(eGuildTabMode.GuildManagement);
            }
            InitTabs(tabs);
        }
        else
        {
            m_CurrentTab = eGuildTabMode.GuildJoin;

            List <eGuildTabMode> tabs = new List <eGuildTabMode>()
            {
                m_CurrentTab
            };

            if (Network.PlayerInfo.player_level >= GuildInfoManager.Config.AtLeastPlayerLevel)
            {
                tabs.Add(eGuildTabMode.RequestList);
                tabs.Add(eGuildTabMode.GuildCreate);
            }
            InitTabs(tabs);
        }
        SetTab(m_CurrentTab);

        return(true);
    }