Skip to content

Commit f5bd2c1

Browse files
authored
Merge pull request #7 from Batonapiton/main
More correct creation of animation controller
2 parents 277be9f + 2c496da commit f5bd2c1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Editor/PokemonImporter.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,10 @@ private static void GenerateAnimationController(GameObject modelGo, string combi
174174
var animationsFolderPath = combinedExportFolder + "Animations/";
175175
var animator = modelGo.AddComponent<Animator> ();
176176

177-
var animatorController = new UnityEditor.Animations.AnimatorController ();
177+
var animatorController = UnityEditor.Animations.AnimatorController.CreateAnimatorControllerAtPath(animationsFolderPath + $"animController-{modelName}.controller");
178178

179179
var files = Directory.GetFiles (animationsFolderPath);
180-
181-
animatorController.AddLayer ("AllAnims");
180+
182181
// animatorController.layers[0].stateMachine.AddState ("1");
183182
foreach (var animationFilePath in files) {
184183
var animationClip = AssetDatabase.LoadAssetAtPath<AnimationClip> (animationFilePath);
@@ -188,7 +187,6 @@ private static void GenerateAnimationController(GameObject modelGo, string combi
188187
}
189188

190189
animator.runtimeAnimatorController = animatorController;
191-
AssetDatabase.CreateAsset (animatorController, animationsFolderPath + $"animController-{modelName}.controller");
192190
AssetDatabase.Refresh();
193191
}
194192

0 commit comments

Comments
 (0)