Exemple #1
0
    private void CreatList(FightLayerType type, int index)
    {
        ToggleList listItem = GameObject.Instantiate <ToggleList>(listPrefab);

        listItem.gameObject.name = "" + type;
        listItem.transform.SetParent(transform, false);
        listItem.transform.localPosition = new Vector3(0, -130 * index, 0);
        listItem.InitList(type);
    }
Exemple #2
0
    public ToggleList UpDateList(FightLayerType type)
    {
        Transform childTrans = transform.FindChild("" + type);

        if (childTrans)
        {
            ToggleList listItem = childTrans.GetComponent <ToggleList>();
            listItem.InitList(type);
            return(listItem);
        }
        return(null);
    }