コード例 #1
0
 public override void OnInspectorGUI()
 {
     if (ModelImporterClipEditor.styles == null)
     {
         ModelImporterClipEditor.styles = new ModelImporterClipEditor.Styles();
     }
     EditorGUI.BeginDisabledGroup(this.singleImporter.animationType == ModelImporterAnimationType.None);
     EditorGUILayout.PropertyField(this.m_ImportAnimation, ModelImporterClipEditor.styles.ImportAnimations, new GUILayoutOption[0]);
     if (this.m_ImportAnimation.boolValue && !this.m_ImportAnimation.hasMultipleDifferentValues)
     {
         bool flag = base.targets.Length == 1 && this.singleImporter.importedTakeInfos.Length == 0;
         if (this.IsDeprecatedMultiAnimationRootImport())
         {
             EditorGUILayout.HelpBox("Animation data was imported using a deprecated Generation option in the Rig tab. Please switch to a non-deprecated import mode in the Rig tab to be able to edit the animation import settings.", MessageType.Info);
         }
         else
         {
             if (flag)
             {
                 if (base.serializedObject.hasModifiedProperties)
                 {
                     EditorGUILayout.HelpBox("The animations settings can be edited after clicking Apply.", MessageType.Info);
                 }
                 else
                 {
                     EditorGUILayout.HelpBox("No animation data available in this model.", MessageType.Info);
                 }
             }
             else
             {
                 if (this.m_AnimationType.hasMultipleDifferentValues)
                 {
                     EditorGUILayout.HelpBox("The rigs of the selected models have different animation types.", MessageType.Info);
                 }
                 else
                 {
                     if (this.animationType == ModelImporterAnimationType.None)
                     {
                         EditorGUILayout.HelpBox("The rigs is not setup to handle animation. Edit the settings in the Rig tab.", MessageType.Info);
                     }
                     else
                     {
                         if (this.m_ImportAnimation.boolValue && !this.m_ImportAnimation.hasMultipleDifferentValues)
                         {
                             this.AnimationClipGUI();
                         }
                     }
                 }
             }
         }
     }
     EditorGUI.EndDisabledGroup();
     base.ApplyRevertGUI();
 }
コード例 #2
0
 public override void OnInspectorGUI()
 {
     if (ModelImporterClipEditor.styles == null)
     {
         ModelImporterClipEditor.styles = new ModelImporterClipEditor.Styles();
     }
     EditorGUILayout.PropertyField(this.m_ImportAnimation, ModelImporterClipEditor.styles.ImportAnimations, new GUILayoutOption[0]);
     if (this.m_ImportAnimation.boolValue && !this.m_ImportAnimation.hasMultipleDifferentValues)
     {
         bool flag = base.targets.Length == 1 && this.singleImporter.importedTakeInfos.Length == 0 && this.singleImporter.animationType != ModelImporterAnimationType.None;
         if (this.IsDeprecatedMultiAnimationRootImport())
         {
             EditorGUILayout.HelpBox("Animation data was imported using a deprecated Generation option in the Rig tab. Please switch to a non-deprecated import mode in the Rig tab to be able to edit the animation import settings.", MessageType.Info);
         }
         else if (flag)
         {
             if (base.serializedObject.hasModifiedProperties)
             {
                 EditorGUILayout.HelpBox("The animations settings can be edited after clicking Apply.", MessageType.Info);
             }
             else
             {
                 string stringValue = this.m_RigImportErrors.stringValue;
                 if (stringValue.Length > 0)
                 {
                     EditorGUILayout.HelpBox("Error(s) found while importing rig in this animation file. Open \"Rig\" tab for more details.", MessageType.Error);
                 }
                 else
                 {
                     EditorGUILayout.HelpBox("No animation data available in this model.", MessageType.Info);
                 }
             }
         }
         else if (this.m_AnimationType.hasMultipleDifferentValues)
         {
             EditorGUILayout.HelpBox("The rigs of the selected models have different Animation Types.", MessageType.Info);
         }
         else if (this.animationType == ModelImporterAnimationType.None)
         {
             EditorGUILayout.HelpBox("The rigs of the selected models are not setup to handle animation. Change the Animation Type in the Rig tab and click Apply.", MessageType.Info);
         }
         else if (this.m_ImportAnimation.boolValue && !this.m_ImportAnimation.hasMultipleDifferentValues)
         {
             this.AnimationClipGUI();
         }
     }
 }
コード例 #3
0
		public override void OnInspectorGUI()
		{
			if (ModelImporterClipEditor.styles == null)
			{
				ModelImporterClipEditor.styles = new ModelImporterClipEditor.Styles();
			}
			EditorGUI.BeginDisabledGroup(this.singleImporter.animationType == ModelImporterAnimationType.None);
			EditorGUILayout.PropertyField(this.m_ImportAnimation, ModelImporterClipEditor.styles.ImportAnimations, new GUILayoutOption[0]);
			if (this.m_ImportAnimation.boolValue && !this.m_ImportAnimation.hasMultipleDifferentValues)
			{
				bool flag = base.targets.Length == 1 && this.singleImporter.importedTakeInfos.Length == 0;
				if (this.IsDeprecatedMultiAnimationRootImport())
				{
					EditorGUILayout.HelpBox("Animation data was imported using a deprecated Generation option in the Rig tab. Please switch to a non-deprecated import mode in the Rig tab to be able to edit the animation import settings.", MessageType.Info);
				}
				else
				{
					if (flag)
					{
						if (base.serializedObject.hasModifiedProperties)
						{
							EditorGUILayout.HelpBox("The animations settings can be edited after clicking Apply.", MessageType.Info);
						}
						else
						{
							EditorGUILayout.HelpBox("No animation data available in this model.", MessageType.Info);
						}
					}
					else
					{
						if (this.m_AnimationType.hasMultipleDifferentValues)
						{
							EditorGUILayout.HelpBox("The rigs of the selected models have different animation types.", MessageType.Info);
						}
						else
						{
							if (this.animationType == ModelImporterAnimationType.None)
							{
								EditorGUILayout.HelpBox("The rigs is not setup to handle animation. Edit the settings in the Rig tab.", MessageType.Info);
							}
							else
							{
								if (this.m_ImportAnimation.boolValue && !this.m_ImportAnimation.hasMultipleDifferentValues)
								{
									this.AnimationClipGUI();
								}
							}
						}
					}
				}
			}
			EditorGUI.EndDisabledGroup();
			base.ApplyRevertGUI();
		}