Ejemplo n.º 1
0
        private void CreateSubItem(LoudspeakerManager.SLoudspeakerObjectInfo info, List <LineObjCache> curLineObject)
        {
            if (curLineObject == null)
            {
                return;
            }

            ResNode itemPrefab = LogicDataCenter.loudspeakerManager.GetChatItemPrefabByObjType(info.type);

            if (itemPrefab == null)
            {
                return;
            }

            GameObject itemObj = itemPrefab.InstanceMainRes();

            if (itemObj == null)
            {
                return;
            }

            itemObj.transform.SetParent(this.transform, false);
            ILoudspeakerItem subItem = itemObj.GetComponent <ILoudspeakerItem>();

            if (subItem == null)
            {
                return;
            }

            if (subItem.SetItemData(info) == false)
            {
                return;
            }

            AddLineObject(subItem, curLineObject);
        }