Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinerius committed Mar 20, 2024
1 parent f816659 commit 7073746
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ private void CreateAnimatorController(IGltfImport gltfImport, string directory)
var state = controller.AddMotion(newCopy, 0);
var anyStateTransition = rootStateMachine.AddAnyStateTransition(state);
anyStateTransition.AddCondition(AnimatorConditionMode.If, 0, animationClipName);
anyStateTransition.duration = 0;
}

AssetDatabase.SaveAssets();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,14 @@ private void ReferenceAnimatorController(AssetImportContext ctx)
if (gameObject != null)
{
Animator animator = gameObject.GetComponent<Animator>();
var folderName = $"{Path.GetDirectoryName(ctx.assetPath)}/Animator/";
string filePath = folderName + "animatorController.controller";
AnimatorController animationController = AssetDatabase.LoadAssetAtPath<AnimatorController>(filePath);
animator.runtimeAnimatorController = animationController;

if (animator != null)
{
var folderName = $"{Path.GetDirectoryName(ctx.assetPath)}/Animator/";
string filePath = folderName + "animatorController.controller";
AnimatorController animationController = AssetDatabase.LoadAssetAtPath<AnimatorController>(filePath);
animator.runtimeAnimatorController = animationController;
}
}
}

Expand Down

0 comments on commit 7073746

Please sign in to comment.