UnityEditor.AvatarPreview.GetAnimationType C# (CSharp) Méthode

GetAnimationType() public static méthode

public static GetAnimationType ( GameObject go ) : ModelImporterAnimationType
go UnityEngine.GameObject
Résultat ModelImporterAnimationType
        public static ModelImporterAnimationType GetAnimationType(GameObject go)
        {
            UnityEngine.Animator component = go.GetComponent<UnityEngine.Animator>();
            if (component != null)
            {
                Avatar avatar = (component == null) ? null : component.avatar;
                if ((avatar != null) && avatar.isHuman)
                {
                    return ModelImporterAnimationType.Human;
                }
                return ModelImporterAnimationType.Generic;
            }
            if (go.GetComponent<Animation>() != null)
            {
                return ModelImporterAnimationType.Legacy;
            }
            return ModelImporterAnimationType.None;
        }

Same methods

AvatarPreview::GetAnimationType ( Motion motion ) : ModelImporterAnimationType

Usage Example

Exemple #1
0
 public static bool IsValidPreviewGameObject(GameObject target, ModelImporterAnimationType requiredClipType)
 {
     if ((Object)target != (Object)null && !target.activeSelf)
     {
         Debug.LogWarning((object)"Can't preview inactive object, using fallback object");
     }
     if ((Object)target != (Object)null && target.activeSelf && GameObjectInspector.HasRenderablePartsRecurse(target))
     {
         return((requiredClipType == ModelImporterAnimationType.None ? 0 : (AvatarPreview.GetAnimationType(target) != requiredClipType ? 1 : 0)) == 0);
     }
     return(false);
 }
All Usage Examples Of UnityEditor.AvatarPreview::GetAnimationType