Exemplo n.º 1
0
    /// <summary>
    /// pos位置坐标
    /// index只的是克隆的第几个物体
    /// newLevel判断是否是新关卡
    /// </summary>
    /// <param name="index"></param>
    /// <param name="newLevel"></param>
    /// <param name="up"></param>
    Transform CloneGrah(int pos)
    {
        StarManager clone = Instantiate(chapter[pos % chapter.Count], group);

        clone.transform.localScale = Vector3.one;
        clone.GetComponent <RectTransform> ().anchoredPosition = new Vector2(0, pos * 1280 + (contentOffset + startOffset));
        clone.GetComponent <StarManager> ().SetStarBg(GetBgUrl(pos % chapter.Count), graphBg[pos % graphBg.Count]);
        clone.GetComponent <StarManager> ().SetButtonState(pos == Prefs.unlockedWorld);
        return(clone.transform);
    }