コード例 #1
0
		public override void OnInspectorGUI()
		{
			if (ModelImporterRigEditor.styles == null)
			{
				ModelImporterRigEditor.styles = new ModelImporterRigEditor.Styles();
			}
			EditorGUI.BeginChangeCheck();
			EditorGUILayout.Popup(this.m_AnimationType, ModelImporterRigEditor.styles.AnimationTypeOpt, ModelImporterRigEditor.styles.AnimationType, new GUILayoutOption[0]);
			if (EditorGUI.EndChangeCheck())
			{
				this.m_AvatarSource.objectReferenceValue = null;
				if (this.animationType == ModelImporterAnimationType.Legacy)
				{
					this.m_AnimationCompression.intValue = 1;
				}
				else
				{
					if (this.animationType == ModelImporterAnimationType.Generic || this.animationType == ModelImporterAnimationType.Human)
					{
						this.m_AnimationCompression.intValue = 3;
					}
				}
			}
			EditorGUILayout.Space();
			if (!this.m_AnimationType.hasMultipleDifferentValues)
			{
				if (this.animationType == ModelImporterAnimationType.Human)
				{
					this.HumanoidGUI();
				}
				else
				{
					if (this.animationType == ModelImporterAnimationType.Generic)
					{
						this.GenericGUI();
					}
					else
					{
						if (this.animationType == ModelImporterAnimationType.Legacy)
						{
							this.LegacyGUI();
						}
					}
				}
			}
			if (this.m_Avatar && this.m_Avatar.isValid && this.m_Avatar.isHuman)
			{
				this.ShowUpdateReferenceClip();
			}
			bool flag = true;
			if (this.animationType != ModelImporterAnimationType.Human && this.animationType != ModelImporterAnimationType.Generic)
			{
				flag = false;
			}
			if (this.m_CopyAvatar.boolValue)
			{
				flag = false;
			}
			if (flag)
			{
				EditorGUILayout.PropertyField(this.m_OptimizeGameObjects, new GUILayoutOption[0]);
				if (this.m_OptimizeGameObjects.boolValue && base.serializedObject.targetObjects.Length == 1)
				{
					EditorGUILayout.Space();
					EditorGUI.BeginDisabledGroup(!this.m_CanMultiEditTransformList);
					this.m_ExposeTransformEditor.OnGUI();
					EditorGUI.EndDisabledGroup();
				}
			}
			base.ApplyRevertGUI();
		}
コード例 #2
0
        public override void OnInspectorGUI()
        {
            if (ModelImporterRigEditor.styles == null)
            {
                ModelImporterRigEditor.styles = new ModelImporterRigEditor.Styles();
            }
            string stringValue  = this.m_RigImportErrors.stringValue;
            string stringValue2 = this.m_RigImportWarnings.stringValue;

            if (stringValue.Length > 0)
            {
                EditorGUILayout.Space();
                EditorGUILayout.HelpBox("Error(s) found while importing rig in this animation file. Open \"Import Messages\" foldout below for more details", MessageType.Error);
            }
            else if (stringValue2.Length > 0)
            {
                EditorGUILayout.Space();
                EditorGUILayout.HelpBox("Warning(s) found while importing rig in this animation file. Open \"Import Messages\" foldout below for more details", MessageType.Warning);
            }
            EditorGUI.BeginChangeCheck();
            EditorGUILayout.Popup(this.m_AnimationType, ModelImporterRigEditor.styles.AnimationTypeOpt, ModelImporterRigEditor.styles.AnimationType, new GUILayoutOption[0]);
            if (EditorGUI.EndChangeCheck())
            {
                this.m_AvatarSource.objectReferenceValue = null;
                if (this.animationType == ModelImporterAnimationType.Legacy)
                {
                    this.m_AnimationCompression.intValue = 1;
                }
                else if (this.animationType == ModelImporterAnimationType.Generic || this.animationType == ModelImporterAnimationType.Human)
                {
                    this.m_AnimationCompression.intValue = 3;
                }
                this.m_DstHasExtraRoot.boolValue = this.m_SrcHasExtraRoot.boolValue;
            }
            EditorGUILayout.Space();
            if (!this.m_AnimationType.hasMultipleDifferentValues)
            {
                if (this.animationType == ModelImporterAnimationType.Human)
                {
                    this.HumanoidGUI();
                }
                else if (this.animationType == ModelImporterAnimationType.Generic)
                {
                    this.GenericGUI();
                }
                else if (this.animationType == ModelImporterAnimationType.Legacy)
                {
                    this.LegacyGUI();
                }
            }
            this.ShowUpdateReferenceClip();
            bool flag = true;

            if (this.animationType != ModelImporterAnimationType.Human && this.animationType != ModelImporterAnimationType.Generic)
            {
                flag = false;
            }
            if (this.m_CopyAvatar.boolValue)
            {
                flag = false;
            }
            if (flag)
            {
                EditorGUILayout.PropertyField(this.m_OptimizeGameObjects, new GUILayoutOption[0]);
                if (this.m_OptimizeGameObjects.boolValue && base.serializedObject.targetObjects.Length == 1)
                {
                    EditorGUILayout.Space();
                    using (new EditorGUI.DisabledScope(!this.m_CanMultiEditTransformList))
                    {
                        this.m_ExposeTransformEditor.OnGUI();
                    }
                }
            }
            if (stringValue.Length > 0 || stringValue2.Length > 0)
            {
                EditorGUILayout.Space();
                ModelImporterRigEditor.importMessageFoldout = EditorGUILayout.Foldout(ModelImporterRigEditor.importMessageFoldout, ModelImporterRigEditor.styles.ImportMessages, true);
                if (ModelImporterRigEditor.importMessageFoldout)
                {
                    if (stringValue.Length > 0)
                    {
                        EditorGUILayout.HelpBox(stringValue, MessageType.None);
                    }
                    else if (stringValue2.Length > 0)
                    {
                        EditorGUILayout.HelpBox(stringValue2, MessageType.None);
                    }
                }
            }
        }
コード例 #3
0
        public override void OnInspectorGUI()
        {
            if (ModelImporterRigEditor.styles == null)
            {
                ModelImporterRigEditor.styles = new ModelImporterRigEditor.Styles();
            }
            EditorGUI.BeginChangeCheck();
            EditorGUILayout.Popup(this.m_AnimationType, ModelImporterRigEditor.styles.AnimationTypeOpt, ModelImporterRigEditor.styles.AnimationType, new GUILayoutOption[0]);
            if (EditorGUI.EndChangeCheck())
            {
                this.m_AvatarSource.objectReferenceValue = null;
                if (this.animationType == ModelImporterAnimationType.Legacy)
                {
                    this.m_AnimationCompression.intValue = 1;
                }
                else
                {
                    if (this.animationType == ModelImporterAnimationType.Generic || this.animationType == ModelImporterAnimationType.Human)
                    {
                        this.m_AnimationCompression.intValue = 3;
                    }
                }
            }
            EditorGUILayout.Space();
            if (!this.m_AnimationType.hasMultipleDifferentValues)
            {
                if (this.animationType == ModelImporterAnimationType.Human)
                {
                    this.HumanoidGUI();
                }
                else
                {
                    if (this.animationType == ModelImporterAnimationType.Generic)
                    {
                        this.GenericGUI();
                    }
                    else
                    {
                        if (this.animationType == ModelImporterAnimationType.Legacy)
                        {
                            this.LegacyGUI();
                        }
                    }
                }
            }
            if (this.m_Avatar && this.m_Avatar.isValid && this.m_Avatar.isHuman)
            {
                this.ShowUpdateReferenceClip();
            }
            bool flag = true;

            if (this.animationType != ModelImporterAnimationType.Human && this.animationType != ModelImporterAnimationType.Generic)
            {
                flag = false;
            }
            if (this.m_CopyAvatar.boolValue)
            {
                flag = false;
            }
            if (flag)
            {
                EditorGUILayout.PropertyField(this.m_OptimizeGameObjects, new GUILayoutOption[0]);
                if (this.m_OptimizeGameObjects.boolValue && base.serializedObject.targetObjects.Length == 1)
                {
                    EditorGUILayout.Space();
                    EditorGUI.BeginDisabledGroup(!this.m_CanMultiEditTransformList);
                    this.m_ExposeTransformEditor.OnGUI();
                    EditorGUI.EndDisabledGroup();
                }
            }
            base.ApplyRevertGUI();
        }