forked from MattRix/UnityDecompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimationCurve.cs
More file actions
164 lines (138 loc) · 4 KB
/
AnimationCurve.cs
File metadata and controls
164 lines (138 loc) · 4 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using UnityEngine.Scripting;
namespace UnityEngine
{
[RequiredByNativeCode]
[StructLayout(LayoutKind.Sequential)]
public sealed class AnimationCurve
{
internal IntPtr m_Ptr;
public Keyframe[] keys
{
get
{
return this.GetKeys();
}
set
{
this.SetKeys(value);
}
}
public Keyframe this[int index]
{
get
{
return this.GetKey_Internal(index);
}
}
public extern int length
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
public extern WrapMode preWrapMode
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
public extern WrapMode postWrapMode
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
public AnimationCurve(params Keyframe[] keys)
{
this.Init(keys);
}
[RequiredByNativeCode]
public AnimationCurve()
{
this.Init(null);
}
[GeneratedByOldBindingsGenerator, ThreadAndSerializationSafe]
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void Cleanup();
~AnimationCurve()
{
this.Cleanup();
}
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern float Evaluate(float time);
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern int AddKey(float time, float value);
public int AddKey(Keyframe key)
{
return this.AddKey_Internal(key);
}
private int AddKey_Internal(Keyframe key)
{
return AnimationCurve.INTERNAL_CALL_AddKey_Internal(this, ref key);
}
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int INTERNAL_CALL_AddKey_Internal(AnimationCurve self, ref Keyframe key);
public int MoveKey(int index, Keyframe key)
{
return AnimationCurve.INTERNAL_CALL_MoveKey(this, index, ref key);
}
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int INTERNAL_CALL_MoveKey(AnimationCurve self, int index, ref Keyframe key);
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern void RemoveKey(int index);
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void SetKeys(Keyframe[] keys);
private Keyframe GetKey_Internal(int index)
{
Keyframe result;
AnimationCurve.INTERNAL_CALL_GetKey_Internal(this, index, out result);
return result;
}
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void INTERNAL_CALL_GetKey_Internal(AnimationCurve self, int index, out Keyframe value);
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private extern Keyframe[] GetKeys();
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern void SmoothTangents(int index, float weight);
public static AnimationCurve Linear(float timeStart, float valueStart, float timeEnd, float valueEnd)
{
float num = (valueEnd - valueStart) / (timeEnd - timeStart);
Keyframe[] keys = new Keyframe[]
{
new Keyframe(timeStart, valueStart, 0f, num),
new Keyframe(timeEnd, valueEnd, num, 0f)
};
return new AnimationCurve(keys);
}
public static AnimationCurve EaseInOut(float timeStart, float valueStart, float timeEnd, float valueEnd)
{
Keyframe[] keys = new Keyframe[]
{
new Keyframe(timeStart, valueStart, 0f, 0f),
new Keyframe(timeEnd, valueEnd, 0f, 0f)
};
return new AnimationCurve(keys);
}
[GeneratedByOldBindingsGenerator, ThreadAndSerializationSafe]
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void Init(Keyframe[] keys);
}
}