Skip to content

Questions about the prefab #5

Closed Answered by julienkay
HannahHaensen asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Hannah,

yes the prefab is generated via code:

private static void CreatePrefab(string objName, Mlp mlp) {
bool splitShapes = AreOBJsSplit(GetObjBaseAssetPath(objName));
int numSplitShapes = GetNumSplitShapes(splitShapes);
GameObject prefabObject = new GameObject(objName);
for (int i = 0; i < mlp.ObjNum; i++) {
for (int j = 0; j < numSplitShapes; j++) {
GameObject shapeModel = AssetDatabase.LoadAssetAtPath<GameObject>(GetObjAssetPath(objName, i, j, splitShapes));
GameObject shape = GameObject.Instantiate(shapeModel);
shape.name = shape.name.Replace("…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by julienkay
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4 on October 10, 2022 18:23.