forked from MattRix/UnityDecompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimationEditor.cs
More file actions
53 lines (49 loc) · 1.57 KB
/
AnimationEditor.cs
File metadata and controls
53 lines (49 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using UnityEngine;
namespace UnityEditor
{
[CanEditMultipleObjects, CustomEditor(typeof(Animation))]
internal class AnimationEditor : Editor
{
private int m_PrePreviewAnimationArraySize = -1;
public void OnEnable()
{
this.m_PrePreviewAnimationArraySize = -1;
}
public override void OnInspectorGUI()
{
base.serializedObject.Update();
SerializedProperty serializedProperty = base.serializedObject.FindProperty("m_Animation");
EditorGUILayout.PropertyField(serializedProperty, true, new GUILayoutOption[0]);
int objectReferenceInstanceIDValue = serializedProperty.objectReferenceInstanceIDValue;
SerializedProperty serializedProperty2 = base.serializedObject.FindProperty("m_Animations");
int arraySize = serializedProperty2.arraySize;
if (ObjectSelector.isVisible && this.m_PrePreviewAnimationArraySize == -1)
{
this.m_PrePreviewAnimationArraySize = arraySize;
}
if (this.m_PrePreviewAnimationArraySize != -1)
{
int num = (arraySize <= 0) ? -1 : serializedProperty2.GetArrayElementAtIndex(arraySize - 1).objectReferenceInstanceIDValue;
if (num != objectReferenceInstanceIDValue)
{
serializedProperty2.arraySize = this.m_PrePreviewAnimationArraySize;
}
if (!ObjectSelector.isVisible)
{
this.m_PrePreviewAnimationArraySize = -1;
}
}
Editor.DrawPropertiesExcluding(base.serializedObject, new string[]
{
"m_Animation",
"m_UserAABB"
});
base.serializedObject.ApplyModifiedProperties();
}
internal override void OnAssetStoreInspectorGUI()
{
this.OnInspectorGUI();
}
}
}