private GameObject SpawnGobj(SpreadCache spreadCache, Transform parent) { GameObject gobj = spreadCache.SpawnGo(); gobj.transform.SetParent(parent); gobj.transform.localPosition = Vector3.zero; gobj.transform.localScale = Vector3.one; return(gobj); }
/// <summary> /// 设置bigone的个数 /// </summary> /// <param name="bigCount"></param> public void SetBigCount(int bigCount) { if (null == m_bigGoCache) { m_bigGoCache = new SpreadCache(); m_bigGoCache.InitCache(BigOneTempl, BigParent); m_smallGoCache = new SpreadCache(); m_smallGoCache.InitCache(SmallOneTempl, SmallParent); } ClearChildsExceptName(Content, s_SmallContentName); for (int i = 0; i < bigCount; ++i) { GameObject cloneGobj = SpawnGobj(m_bigGoCache, Content); if (null != showBigoneFunc) { showBigoneFunc(cloneGobj, i); } } UpdateViewContentRectHeight(bigCount * 100f); }