You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 19, 2023. It is now read-only.
Ich suggest, to add an additinal validation for this:
public bool ValidateAnimatorController()
{
AnimatorController controller = GetAnimatorController();
if (controller == null)
return false;
_avaCryptController.ValidateAnimations(gameObject, controller);
_avaCryptController.ValidateParameters(controller);
_avaCryptController.ValidateLayers(controller);
return true;
}
private AnimatorController GetAnimatorController()
{
if (transform.parent != null)
{
EditorUtility.DisplayDialog("AvaCryptRoot component not on a Root GameObject.",
"The GameObject which the AvaCryptRoot component is placed on must not be the child of any other GameObject.",
"Ok");
return null;
}
Animator animator = GetComponent<Animator>();
if (animator == null)
{
EditorUtility.DisplayDialog("No Animator.",
"Add an animator to the Avatar's root GameObject.",
"Ok");
return null;
}
RuntimeAnimatorController runtimeController = animator.runtimeAnimatorController;
if (runtimeController == null)
{
EditorUtility.DisplayDialog("Animator has no AnimatorController.",
"Add an AnimatorController to the Animator component.",
"Ok");
return null;
}
AnimatorController controller = UnityEditor.AssetDatabase.LoadAssetAtPath<UnityEditor.Animations.AnimatorController>(UnityEditor.AssetDatabase.GetAssetPath(runtimeController));
if (controller == null)
{
EditorUtility.DisplayDialog("Could not get AnimatorController.",
"This shouldn't happen... don't know why this would happen.",
"Ok");
return null;
}
VRCAvatarDescriptor descriptor = GetComponent<VRCAvatarDescriptor>();
if (descriptor == null)
{
EditorUtility.DisplayDialog("Could not get AvatarDescriptor.",
"Add an AvatarDescriptor to the Avatar's root GameObject.",
"Ok");
return null;
}
else if (descriptor.baseAnimationLayers[4].animatorController == null)
{
EditorUtility.DisplayDialog("Could not get AvatarDescriptor.",
"Add an custom FX layer to your AvatarDescriptor.",
"Ok");
return null;
}
else if (descriptor.baseAnimationLayers[4].animatorController != runtimeController) {
EditorUtility.DisplayDialog("Current AnimatorController doesn't match.",
"Set the AnimatorController of the FX layer in your Animator component.",
"Ok");
return null;
}
return controller;
}
public void EncryptAvatar()
{
if (!ValidateAnimatorController())
return;
...
The text was updated successfully, but these errors were encountered:
Ess-Ka
changed the title
Other playable layers then FX can accidentally be changed
Other playable layers than FX can accidentally be changed
May 31, 2021
Ich suggest, to add an additinal validation for this:
The text was updated successfully, but these errors were encountered: