forked from MattRix/UnityDecompiled
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAnimation.cs
More file actions
320 lines (320 loc) · 9.27 KB
/
Animation.cs
File metadata and controls
320 lines (320 loc) · 9.27 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
using System;
using System.Collections;
using System.Runtime.CompilerServices;
using UnityEngine.Internal;
namespace UnityEngine
{
public sealed class Animation : Behaviour, IEnumerable
{
private sealed class Enumerator : IEnumerator
{
private Animation m_Outer;
private int m_CurrentIndex = -1;
public object Current
{
get
{
return this.m_Outer.GetStateAtIndex(this.m_CurrentIndex);
}
}
internal Enumerator(Animation outer)
{
this.m_Outer = outer;
}
public bool MoveNext()
{
int stateCount = this.m_Outer.GetStateCount();
this.m_CurrentIndex++;
return this.m_CurrentIndex < stateCount;
}
public void Reset()
{
this.m_CurrentIndex = -1;
}
}
public extern AnimationClip clip
{
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
public extern bool playAutomatically
{
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
public extern WrapMode wrapMode
{
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
public extern bool isPlaying
{
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
public AnimationState this[string name]
{
get
{
return this.GetState(name);
}
}
public extern bool animatePhysics
{
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
[Obsolete("Use cullingType instead")]
public extern bool animateOnlyIfVisible
{
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
public extern AnimationCullingType cullingType
{
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
set;
}
public Bounds localBounds
{
get
{
Bounds result;
this.INTERNAL_get_localBounds(out result);
return result;
}
set
{
this.INTERNAL_set_localBounds(ref value);
}
}
public void Stop()
{
Animation.INTERNAL_CALL_Stop(this);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void INTERNAL_CALL_Stop(Animation self);
public void Stop(string name)
{
this.Internal_StopByName(name);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void Internal_StopByName(string name);
public void Rewind(string name)
{
this.Internal_RewindByName(name);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void Internal_RewindByName(string name);
public void Rewind()
{
Animation.INTERNAL_CALL_Rewind(this);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void INTERNAL_CALL_Rewind(Animation self);
public void Sample()
{
Animation.INTERNAL_CALL_Sample(this);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void INTERNAL_CALL_Sample(Animation self);
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern bool IsPlaying(string name);
[ExcludeFromDocs]
public bool Play()
{
PlayMode mode = PlayMode.StopSameLayer;
return this.Play(mode);
}
public bool Play([DefaultValue("PlayMode.StopSameLayer")] PlayMode mode)
{
return this.PlayDefaultAnimation(mode);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern bool Play(string animation, [DefaultValue("PlayMode.StopSameLayer")] PlayMode mode);
[ExcludeFromDocs]
public bool Play(string animation)
{
PlayMode mode = PlayMode.StopSameLayer;
return this.Play(animation, mode);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern void CrossFade(string animation, [DefaultValue("0.3F")] float fadeLength, [DefaultValue("PlayMode.StopSameLayer")] PlayMode mode);
[ExcludeFromDocs]
public void CrossFade(string animation, float fadeLength)
{
PlayMode mode = PlayMode.StopSameLayer;
this.CrossFade(animation, fadeLength, mode);
}
[ExcludeFromDocs]
public void CrossFade(string animation)
{
PlayMode mode = PlayMode.StopSameLayer;
float fadeLength = 0.3f;
this.CrossFade(animation, fadeLength, mode);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern void Blend(string animation, [DefaultValue("1.0F")] float targetWeight, [DefaultValue("0.3F")] float fadeLength);
[ExcludeFromDocs]
public void Blend(string animation, float targetWeight)
{
float fadeLength = 0.3f;
this.Blend(animation, targetWeight, fadeLength);
}
[ExcludeFromDocs]
public void Blend(string animation)
{
float fadeLength = 0.3f;
float targetWeight = 1f;
this.Blend(animation, targetWeight, fadeLength);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern AnimationState CrossFadeQueued(string animation, [DefaultValue("0.3F")] float fadeLength, [DefaultValue("QueueMode.CompleteOthers")] QueueMode queue, [DefaultValue("PlayMode.StopSameLayer")] PlayMode mode);
[ExcludeFromDocs]
public AnimationState CrossFadeQueued(string animation, float fadeLength, QueueMode queue)
{
PlayMode mode = PlayMode.StopSameLayer;
return this.CrossFadeQueued(animation, fadeLength, queue, mode);
}
[ExcludeFromDocs]
public AnimationState CrossFadeQueued(string animation, float fadeLength)
{
PlayMode mode = PlayMode.StopSameLayer;
QueueMode queue = QueueMode.CompleteOthers;
return this.CrossFadeQueued(animation, fadeLength, queue, mode);
}
[ExcludeFromDocs]
public AnimationState CrossFadeQueued(string animation)
{
PlayMode mode = PlayMode.StopSameLayer;
QueueMode queue = QueueMode.CompleteOthers;
float fadeLength = 0.3f;
return this.CrossFadeQueued(animation, fadeLength, queue, mode);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern AnimationState PlayQueued(string animation, [DefaultValue("QueueMode.CompleteOthers")] QueueMode queue, [DefaultValue("PlayMode.StopSameLayer")] PlayMode mode);
[ExcludeFromDocs]
public AnimationState PlayQueued(string animation, QueueMode queue)
{
PlayMode mode = PlayMode.StopSameLayer;
return this.PlayQueued(animation, queue, mode);
}
[ExcludeFromDocs]
public AnimationState PlayQueued(string animation)
{
PlayMode mode = PlayMode.StopSameLayer;
QueueMode queue = QueueMode.CompleteOthers;
return this.PlayQueued(animation, queue, mode);
}
public void AddClip(AnimationClip clip, string newName)
{
this.AddClip(clip, newName, -2147483648, 2147483647);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern void AddClip(AnimationClip clip, string newName, int firstFrame, int lastFrame, [DefaultValue("false")] bool addLoopFrame);
[ExcludeFromDocs]
public void AddClip(AnimationClip clip, string newName, int firstFrame, int lastFrame)
{
bool addLoopFrame = false;
this.AddClip(clip, newName, firstFrame, lastFrame, addLoopFrame);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern void RemoveClip(AnimationClip clip);
public void RemoveClip(string clipName)
{
this.RemoveClip2(clipName);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
public extern int GetClipCount();
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void RemoveClip2(string clipName);
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private extern bool PlayDefaultAnimation(PlayMode mode);
[Obsolete("use PlayMode instead of AnimationPlayMode.")]
public bool Play(AnimationPlayMode mode)
{
return this.PlayDefaultAnimation((PlayMode)mode);
}
[Obsolete("use PlayMode instead of AnimationPlayMode.")]
public bool Play(string animation, AnimationPlayMode mode)
{
return this.Play(animation, (PlayMode)mode);
}
public void SyncLayer(int layer)
{
Animation.INTERNAL_CALL_SyncLayer(this, layer);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void INTERNAL_CALL_SyncLayer(Animation self, int layer);
public IEnumerator GetEnumerator()
{
return new Animation.Enumerator(this);
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern AnimationState GetState(string name);
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern AnimationState GetStateAtIndex(int index);
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern int GetStateCount();
public AnimationClip GetClip(string name)
{
AnimationState state = this.GetState(name);
if (state)
{
return state.clip;
}
return null;
}
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void INTERNAL_get_localBounds(out Bounds value);
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void INTERNAL_set_localBounds(ref Bounds value);
}
}