Skip to content

Commit 1fafd86

Browse files
committed
code review fix - update function names
1 parent a4339fa commit 1fafd86

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Assets/FbxExporters/Editor/ConvertToModel.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public static GameObject Convert (
166166
}
167167

168168
// Copy the mesh/materials from the FBX
169-
UpdateFromFBX (toConvert, unityMainAsset);
169+
UpdateFromSourceRecursive (toConvert, unityMainAsset);
170170

171171
// Set up the FbxPrefab component so it will auto-update.
172172
// Make sure to delete whatever FbxPrefab history we had.
@@ -265,15 +265,15 @@ public static void EnforceUniqueNames(IEnumerable<GameObject> exportSet)
265265
/// Updates the meshes and materials of the exported GameObjects
266266
/// to link to those imported from the FBX.
267267
/// </summary>
268-
/// <param name="orig">Original.</param>
269-
/// <param name="fbx">Fbx.</param>
270-
public static void UpdateFromFBX(GameObject orig, GameObject fbx)
268+
/// <param name="dest">GameObject to update.</param>
269+
/// <param name="source">Source to update from.</param>
270+
public static void UpdateFromSourceRecursive(GameObject dest, GameObject source)
271271
{
272272
// recurse over orig, for each transform finding the corresponding transform in the FBX
273273
// and copying the meshes and materials over from the FBX
274-
var goDict = GetNameToFbxGameObject(orig, fbx);
274+
var goDict = MapNameToSourceRecursive(dest, source);
275275
var q = new Queue<Transform> ();
276-
q.Enqueue (orig.transform);
276+
q.Enqueue (dest.transform);
277277
while (q.Count > 0) {
278278
var t = q.Dequeue ();
279279

@@ -289,16 +289,16 @@ public static void UpdateFromFBX(GameObject orig, GameObject fbx)
289289
}
290290

291291
/// <summary>
292-
/// Gets a dictionary linking exported GameObject name to fbx game object.
292+
/// Gets a dictionary linking dest GameObject name to source game object.
293293
/// </summary>
294-
/// <returns>Dictionary containing the name to fbx game object.</returns>
295-
/// <param name="orig">Original.</param>
296-
/// <param name="fbx">Fbx.</param>
297-
private static Dictionary<string,GameObject> GetNameToFbxGameObject(GameObject orig, GameObject fbx){
294+
/// <returns>Dictionary containing the name to source game object.</returns>
295+
/// <param name="dest">Destination GameObject.</param>
296+
/// <param name="source">Source GameObject.</param>
297+
private static Dictionary<string,GameObject> MapNameToSourceRecursive(GameObject dest, GameObject source){
298298
var nameToGO = new Dictionary<string,GameObject> ();
299299

300300
var q = new Queue<Transform> ();
301-
q.Enqueue (orig.transform);
301+
q.Enqueue (dest.transform);
302302
while (q.Count > 0) {
303303
var t = q.Dequeue ();
304304
nameToGO [t.name] = null;
@@ -307,10 +307,10 @@ private static Dictionary<string,GameObject> GetNameToFbxGameObject(GameObject o
307307
}
308308
}
309309

310-
nameToGO [orig.name] = fbx;
310+
nameToGO [dest.name] = source;
311311

312312
var fbxQ = new Queue<Transform> ();
313-
foreach (Transform child in fbx.transform) {
313+
foreach (Transform child in source.transform) {
314314
fbxQ.Enqueue (child);
315315
}
316316

0 commit comments

Comments
 (0)