forked from hunterzonewu/unity-decompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimatorStateInfo.cs
More file actions
149 lines (136 loc) · 3.36 KB
/
AnimatorStateInfo.cs
File metadata and controls
149 lines (136 loc) · 3.36 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
// Decompiled with JetBrains decompiler
// Type: UnityEngine.AnimatorStateInfo
// Assembly: UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: A8FF7A2C-E4EE-4232-AB17-3FCABEC16496
// Assembly location: C:\Users\Blake\sandbox\unity\test-project\Library\UnityAssemblies\UnityEngine.dll
using System;
using UnityEngine.Scripting;
namespace UnityEngine
{
/// <summary>
/// <para>Information about the current or next state.</para>
/// </summary>
[RequiredByNativeCode]
public struct AnimatorStateInfo
{
private int m_Name;
private int m_Path;
private int m_FullPath;
private float m_NormalizedTime;
private float m_Length;
private float m_Speed;
private float m_SpeedMultiplier;
private int m_Tag;
private int m_Loop;
/// <summary>
/// <para>The full path hash for this state.</para>
/// </summary>
public int fullPathHash
{
get
{
return this.m_FullPath;
}
}
/// <summary>
/// <para>The hashed name of the State.</para>
/// </summary>
[Obsolete("Use AnimatorStateInfo.fullPathHash instead.")]
public int nameHash
{
get
{
return this.m_Path;
}
}
/// <summary>
/// <para>The hash is generated using Animator::StringToHash. The string to pass doest not include the parent layer's name.</para>
/// </summary>
public int shortNameHash
{
get
{
return this.m_Name;
}
}
/// <summary>
/// <para>Normalized time of the State.</para>
/// </summary>
public float normalizedTime
{
get
{
return this.m_NormalizedTime;
}
}
/// <summary>
/// <para>Current duration of the state.</para>
/// </summary>
public float length
{
get
{
return this.m_Length;
}
}
/// <summary>
/// <para>The playback speed of the animation. 1 is the normal playback speed.</para>
/// </summary>
public float speed
{
get
{
return this.m_Speed;
}
}
/// <summary>
/// <para>The speed multiplier for this state.</para>
/// </summary>
public float speedMultiplier
{
get
{
return this.m_SpeedMultiplier;
}
}
/// <summary>
/// <para>The Tag of the State.</para>
/// </summary>
public int tagHash
{
get
{
return this.m_Tag;
}
}
/// <summary>
/// <para>Is the state looping.</para>
/// </summary>
public bool loop
{
get
{
return this.m_Loop != 0;
}
}
/// <summary>
/// <para>Does name match the name of the active state in the statemachine?</para>
/// </summary>
/// <param name="name"></param>
public bool IsName(string name)
{
int hash = Animator.StringToHash(name);
if (hash != this.m_FullPath && hash != this.m_Name)
return hash == this.m_Path;
return true;
}
/// <summary>
/// <para>Does tag match the tag of the active state in the statemachine.</para>
/// </summary>
/// <param name="tag"></param>
public bool IsTag(string tag)
{
return Animator.StringToHash(tag) == this.m_Tag;
}
}
}