Skip to content

Commit 3f9ab36

Browse files
committed
remove unused function
+ refactor to return earlier
1 parent 8855847 commit 3f9ab36

File tree

1 file changed

+15
-39
lines changed

1 file changed

+15
-39
lines changed

Packages/com.unity.formats.fbx/Editor/Scripts/FbxExporter.cs

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3079,22 +3079,22 @@ internal static Dictionary<GameObject, IExportData> GetExportData(Object[] objec
30793079

30803080
Dictionary<GameObject, IExportData> exportData = new Dictionary<GameObject, IExportData>();
30813081

3082-
if (exportOptions.ModelAnimIncludeOption == ExportSettings.Include.Anim)
3082+
if (exportOptions.ModelAnimIncludeOption != ExportSettings.Include.Anim)
30833083
{
3084-
foreach (var obj in objects)
3085-
{
3086-
GameObject go = ModelExporter.GetGameObject (obj);
3087-
3088-
if (go)
3089-
{
3090-
exportData[go] = GetExportData(go, exportOptions);
3091-
}
3092-
else if (obj.GetType().Name.Contains("EditorClip"))
3093-
{
3094-
KeyValuePair<GameObject, AnimationClip> pair = AnimationOnlyExportData.GetGameObjectAndAnimationClip(obj);
3084+
return null;
3085+
}
30953086

3096-
exportData[pair.Key] = GetExportData (pair.Key, pair.Value, exportOptions);
3097-
}
3087+
foreach (var obj in objects)
3088+
{
3089+
GameObject go = ModelExporter.GetGameObject (obj);
3090+
if (go)
3091+
{
3092+
exportData[go] = GetExportData(go, exportOptions);
3093+
}
3094+
else if (obj.GetType().Name.Contains("EditorClip"))
3095+
{
3096+
KeyValuePair<GameObject, AnimationClip> pair = AnimationOnlyExportData.GetGameObjectAndAnimationClip(obj);
3097+
exportData[pair.Key] = GetExportData (pair.Key, pair.Value, exportOptions);
30983098
}
30993099
}
31003100

@@ -3120,31 +3120,7 @@ public static IExportData GetExportData(GameObject rootObject, AnimationClip ani
31203120
return exportData;
31213121
}
31223122

3123-
internal static IExportData GetExportData(GameObject rootObject, AnimationTrack animationTrack, IExportOptions exportOptions = null)
3124-
{
3125-
if (exportOptions==null)
3126-
exportOptions = DefaultOptions;
3127-
Debug.Assert(exportOptions!=null);
3128-
3129-
// get animation clips for root object from animation track
3130-
List<AnimationClip> clips = new List<AnimationClip>();
3131-
3132-
foreach (TimelineClip myclip in animationTrack.GetClips())
3133-
{
3134-
clips.Add(myclip.animationClip);
3135-
}
3136-
3137-
var goToExport = new HashSet<GameObject>();
3138-
var animationClips = new Dictionary<AnimationClip, GameObject>();
3139-
var exportComponent = new Dictionary<GameObject, System.Type>();
3140-
3141-
var exportData = new AnimationOnlyExportData(animationClips, goToExport, exportComponent);
3142-
exportData.CollectDependencies(clips.ToArray(), rootObject, exportOptions);
3143-
3144-
return exportData;
3145-
}
3146-
3147-
protected static IExportData GetExportData(GameObject go, IExportOptions exportOptions = null)
3123+
internal static IExportData GetExportData(GameObject go, IExportOptions exportOptions = null)
31483124
{
31493125
if (exportOptions==null)
31503126
exportOptions = DefaultOptions;

0 commit comments

Comments
 (0)