/// <summary> /// 外部调用,生成单个零件 /// </summary> public static PPObjLoader LoadBlock(PPPrefabInfo prefabInfo, PPBlockInfo nodeInfo, Transform parent, Action <GameObject> onFinishWithObj) { GameObject obj = new GameObject("PPObjLoader"); obj.transform.SetParent(RootObj); PPObjLoader loader = obj.AddComponent <PPObjLoader>(); loader.mPrefabInfo = prefabInfo; loader.nodeInfo = nodeInfo; loader.parent = parent; loader.onFinishWithObj = onFinishWithObj; loader.StartCoroutine(loader.AsyncLoadBlock()); return(loader); }
public static PPObjLoader LoadBlocks(PPBlockConfigInfo blockConfigInfo, Transform parent, Dictionary <int, GameObject> animNodes, LoadConfig loadConfig, Action onFinish = null) { GameObject obj = new GameObject("PPObjLoader"); obj.transform.SetParent(RootObj); PPObjLoader loader = obj.AddComponent <PPObjLoader>(); loader.mBlockConfigInfo = blockConfigInfo; loader.sectionInfo = loader.mBlockConfigInfo.SectionInfo; loader.parent = parent; loader.mAnimNodes = animNodes; loader.loadConfig = loadConfig; loader.onFinish = onFinish; loader.StartCoroutine(loader.AsyncLoadBlocks()); return(loader); }