Exemple #1
0
    public override void updateItem(GameObject item, int index)
    {
        if (list == null || index >= list.Count || list [index] == null)
        {
            return;
        }
        RankItemView sc = item.GetComponent <RankItemView> ();

        sc.init(list [index], type, index);
    }
Exemple #2
0
    public override void initButton(int i)
    {
        if (nodeList [i] == null)
        {
            nodeList [i] = NGUITools.AddChild(gameObject, itemPrefab3);
        }
        nodeList [i].name = StringKit.intToFixString(i + 1);
        RankItemView button = nodeList [i].GetComponent <RankItemView> ();

        button.setFatherWindow(this.fatherWindow);
        if (i >= list.Count)
        {
            button.init(null, type, i);
        }
        else
        {
            button.init(list [i], type, i);
        }
    }
 /// <summary>
 /// 更新容器
 /// </summary>
 private void updateContent()
 {
     UIUtils.M_removeAllChildren(content.gameObject);
     for (int i = 0; i < RankManagerment.Instance.guildAreaHurtList.Count; i++)
     {
         GuildAreaHurtRankItem item = RankManagerment.Instance.guildAreaHurtList[i];
         GameObject            go   = NGUITools.AddChild(content.gameObject, RankItemPrafab);
         RankItemView          view = go.GetComponent <RankItemView>();
         view.init(item, RankManagerment.TYPE_GUILD_AREA_CONTRIBUTION, i);
     }
     content.Reposition();
 }
Exemple #4
0
    public void initButton(int i)
    {
        GameObject obj = null;

        if (fatherWindow is RankWindow)
        {
            if ((fatherWindow as RankWindow).selectTabType == RankManagerment.TYPE_GUILD_FIGHT)
            {
                obj = Instantiate(itemPrefab4) as GameObject;
            }
            else
            {
                obj = Instantiate(itemPrefab3) as GameObject;
            }
        }
        else
        {
            obj = Instantiate(itemPrefab3) as GameObject;
        }
        obj.transform.parent        = transform;
        obj.transform.localPosition = new Vector3(-800, 0, 0);
        obj.transform.localScale    = Vector3.one;
        obj.name = StringKit.intToFixString(i + 1);
        RankItemView sc = obj.GetComponent <RankItemView> ();

        sc.setFatherWindow(this.fatherWindow);
        if (i >= list.Count)
        {
            sc.init(null, type, i);
        }
        else
        {
            sc.init(list [i], type, i);
        }
        if (!obj.activeSelf)
        {
            obj.SetActive(true);
        }
    }
Exemple #5
0
    /// <summary>
    /// 显示积分排行
    /// </summary>
    private void showIntegralRankContent()
    {
        hideAllContent();
        integralRankContent.SetActive(true);
        List <GuildShakeRankItem> rankInfos = RankManagerment.Instance.guildShakeList;
        int i = 0;

        /** 清空排行榜信息 */
        UIUtils.M_removeAllChildren(rankRoot);
        /** 初始化排行榜界面 */
        string contriStr = LanguageConfigManager.Instance.getLanguage("guildMain12");

        foreach (GuildShakeRankItem info in rankInfos)
        {
            info.contribution = GuildManagerment.Instance.getContribution(i + 1) + contriStr;
            RankItemView item = NGUITools.AddChild(rankRoot, rankItemPrefab).GetComponent <RankItemView> ();
            item.fatherWindow = this;
            item.init(info, RankManagerment.TYPE_GUILD_SHAKE, i);
            i++;
        }
        rankRoot.GetComponent <UIGrid> ().Reposition();
    }