GetHumanoidFallback() private static method

private static GetHumanoidFallback ( ) : GameObject
return UnityEngine.GameObject
Ejemplo n.º 1
0
        private static GameObject CalculatePreviewGameObject(Animator selectedAnimator, Motion motion, ModelImporterAnimationType animationType)
        {
            AnimationClip firstAnimationClipFromMotion = AvatarPreview.GetFirstAnimationClipFromMotion(motion);
            GameObject    gameObject = AvatarPreviewSelection.GetPreview(animationType);

            if (AvatarPreview.IsValidPreviewGameObject(gameObject, ModelImporterAnimationType.None))
            {
                return(gameObject);
            }
            if (selectedAnimator != null && AvatarPreview.IsValidPreviewGameObject(selectedAnimator.gameObject, animationType))
            {
                return(selectedAnimator.gameObject);
            }
            gameObject = AvatarPreview.FindBestFittingRenderableGameObjectFromModelAsset(firstAnimationClipFromMotion, animationType);
            if (gameObject != null)
            {
                return(gameObject);
            }
            if (animationType == ModelImporterAnimationType.Human)
            {
                return(AvatarPreview.GetHumanoidFallback());
            }
            if (animationType == ModelImporterAnimationType.Generic)
            {
                return(AvatarPreview.GetGenericAnimationFallback());
            }
            return(null);
        }
Ejemplo n.º 2
0
 private void SetPreviewAvatarOption(object obj)
 {
     this.m_Option = (AvatarPreview.PreviewPopupOptions)obj;
     if (this.m_Option == AvatarPreview.PreviewPopupOptions.Auto)
     {
         this.SetPreview(null);
     }
     else if (this.m_Option == AvatarPreview.PreviewPopupOptions.DefaultModel)
     {
         this.SetPreview(AvatarPreview.GetHumanoidFallback());
     }
     else if (this.m_Option == AvatarPreview.PreviewPopupOptions.Other)
     {
         ObjectSelector.get.Show(null, typeof(GameObject), null, false);
         ObjectSelector.get.objectSelectorID = this.m_ModelSelectorId;
     }
 }
Ejemplo n.º 3
0
        private void SetPreviewAvatarOption(object obj)
        {
            switch ((AvatarPreview.PreviewPopupOptions)obj)
            {
            case AvatarPreview.PreviewPopupOptions.Auto:
                this.SetPreview((GameObject)null);
                break;

            case AvatarPreview.PreviewPopupOptions.DefaultModel:
                this.SetPreview(AvatarPreview.GetHumanoidFallback());
                break;

            case AvatarPreview.PreviewPopupOptions.Other:
                ObjectSelector.get.Show((Object)null, typeof(GameObject), (SerializedProperty)null, false);
                ObjectSelector.get.objectSelectorID = this.m_ModelSelectorId;
                break;
            }
        }