forked from hunterzonewu/unity-decompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimationMode.cs
More file actions
101 lines (87 loc) · 3.55 KB
/
AnimationMode.cs
File metadata and controls
101 lines (87 loc) · 3.55 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// Decompiled with JetBrains decompiler
// Type: UnityEditor.AnimationMode
// Assembly: UnityEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 01B28312-B6F5-4E06-90F6-BE297B711E41
// Assembly location: C:\Users\Blake\sandbox\unity\test-project\Library\UnityAssemblies\UnityEditor.dll
using System.Runtime.CompilerServices;
using UnityEngine;
namespace UnityEditor
{
/// <summary>
/// <para>AnimationMode is used by the AnimationWindow to store properties modifed by the AnimationClip playback.</para>
/// </summary>
public sealed class AnimationMode
{
private static bool s_InAnimationPlaybackMode = false;
private static Color s_AnimatedPropertyColorLight = new Color(1f, 0.65f, 0.6f, 1f);
private static Color s_AnimatedPropertyColorDark = new Color(1f, 0.55f, 0.5f, 1f);
/// <summary>
/// <para>The color used to show that a property is currently being animated.</para>
/// </summary>
public static Color animatedPropertyColor
{
get
{
if (EditorGUIUtility.isProSkin)
return AnimationMode.s_AnimatedPropertyColorDark;
return AnimationMode.s_AnimatedPropertyColorLight;
}
}
/// <summary>
/// <para>Is the specified property currently in animation mode and being animated?</para>
/// </summary>
/// <param name="target"></param>
/// <param name="propertyPath"></param>
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern bool IsPropertyAnimated(Object target, string propertyPath);
/// <summary>
/// <para>Stops Animation mode, reverts all properties that were animated in animation mode.</para>
/// </summary>
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void StopAnimationMode();
/// <summary>
/// <para>Are we currently in AnimationMode.</para>
/// </summary>
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern bool InAnimationMode();
/// <summary>
/// <para>Starts the animation mode.</para>
/// </summary>
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void StartAnimationMode();
internal static void StopAnimationPlaybackMode()
{
AnimationMode.s_InAnimationPlaybackMode = false;
}
internal static bool InAnimationPlaybackMode()
{
return AnimationMode.s_InAnimationPlaybackMode;
}
internal static void StartAnimationPlaybackMode()
{
AnimationMode.s_InAnimationPlaybackMode = true;
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void BeginSampling();
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void EndSampling();
/// <summary>
/// <para>Samples an AnimationClip on the object and also records any modified properties in AnimationMode.</para>
/// </summary>
/// <param name="gameObject"></param>
/// <param name="clip"></param>
/// <param name="time"></param>
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void SampleAnimationClip(GameObject gameObject, AnimationClip clip, float time);
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void AddPropertyModification(EditorCurveBinding binding, PropertyModification modification, bool keepPrefabOverride);
}
}