コード例 #1
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);
        }
    }
コード例 #2
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);
        }
    }