@@ -17,7 +17,7 @@ namespace Milease.Utils
17
17
public static class MilInstantAnimatorExtension
18
18
{
19
19
public static MilInstantAnimator AsMileaseKeyEvent ( this Action action , float delay = 0f )
20
- => Milease ( action , ( _ , _ ) => action . Invoke ( ) , null , 0f , delay ) ;
20
+ => Milease ( action , ( _ ) => action . Invoke ( ) , null , 0f , delay ) ;
21
21
22
22
public static MilInstantAnimator AsMileaseHandleFunction ( this MileaseHandleFunction func , float duration , float delay = 0f )
23
23
=> Milease ( func , func , null , duration , delay ) ;
@@ -32,37 +32,37 @@ public static MilInstantAnimator Milease(this object target, MileaseHandleFuncti
32
32
EaseFunction easeFunction = EaseFunction . Quad , EaseType easeType = EaseType . In ,
33
33
MilAnimation . BlendingMode blendingMode = MilAnimation . BlendingMode . Default )
34
34
{
35
- var animation = new MilInstantAnimator ( ) ;
36
- var ani = MilAnimation . SimplePart ( handleFunction , resetFunction , duration , delay , easeFunction , easeType , blendingMode ) ;
37
- animation . Collection . Add ( new List < RuntimeAnimationPart > ( )
35
+ var animator = new MilInstantAnimator ( ) ;
36
+ var ani = MilAnimation . SimplePart ( duration , delay , easeFunction , easeType , blendingMode ) ;
37
+ animator . Collection . Add ( new List < RuntimeAnimationPart > ( )
38
38
{
39
- new ( target , ani , handleFunction , resetFunction )
39
+ new ( target , animator , ani , handleFunction , resetFunction )
40
40
} ) ;
41
- return animation ;
41
+ return animator ;
42
42
}
43
43
44
44
public static MilInstantAnimator MileaseTo ( this object target , string memberName , object toValue ,
45
45
float duration , float delay = 0f , EaseFunction easeFunction = EaseFunction . Quad ,
46
46
EaseType easeType = EaseType . In )
47
47
{
48
- var animation = new MilInstantAnimator ( ) ;
48
+ var animator = new MilInstantAnimator ( ) ;
49
49
var type = target . GetType ( ) ;
50
50
var members = type . GetMember ( memberName ) ;
51
51
if ( members . Length == 0 )
52
52
{
53
53
throw new MilMemberNotFoundException ( memberName ) ;
54
54
}
55
55
var info = members [ 0 ] ;
56
- animation . Collection . Add ( new List < RuntimeAnimationPart > ( )
56
+ animator . Collection . Add ( new List < RuntimeAnimationPart > ( )
57
57
{
58
- new ( target , MilAnimation . SimplePartTo ( toValue , duration , delay , easeFunction , easeType ) , info . MemberType switch
58
+ new ( target , animator , MilAnimation . SimplePartTo ( toValue , duration , delay , easeFunction , easeType ) , info . MemberType switch
59
59
{
60
60
MemberTypes . Field => ( ( FieldInfo ) info ) . FieldType ,
61
61
MemberTypes . Property => ( ( PropertyInfo ) info ) . PropertyType ,
62
62
_ => null
63
63
} , info )
64
64
} ) ;
65
- return animation ;
65
+ return animator ;
66
66
}
67
67
68
68
public static MilInstantAnimator MileaseAdditive ( this object target , string memberName , object startValue ,
@@ -74,24 +74,24 @@ public static MilInstantAnimator Milease(this object target, string memberName,
74
74
float delay = 0f , EaseFunction easeFunction = EaseFunction . Quad , EaseType easeType = EaseType . In ,
75
75
MilAnimation . BlendingMode blendingMode = MilAnimation . BlendingMode . Default )
76
76
{
77
- var animation = new MilInstantAnimator ( ) ;
77
+ var animator = new MilInstantAnimator ( ) ;
78
78
var type = target . GetType ( ) ;
79
79
var members = type . GetMember ( memberName ) ;
80
80
if ( members . Length == 0 )
81
81
{
82
82
throw new MilMemberNotFoundException ( memberName ) ;
83
83
}
84
84
var info = members [ 0 ] ;
85
- animation . Collection . Add ( new List < RuntimeAnimationPart > ( )
85
+ animator . Collection . Add ( new List < RuntimeAnimationPart > ( )
86
86
{
87
- new ( target , MilAnimation . SimplePart ( startValue , delay , easeFunction , easeType , blendingMode ) , info . MemberType switch
87
+ new ( target , animator , MilAnimation . SimplePart ( startValue , delay , easeFunction , easeType , blendingMode ) , info . MemberType switch
88
88
{
89
89
MemberTypes . Field => ( ( FieldInfo ) info ) . FieldType ,
90
90
MemberTypes . Property => ( ( PropertyInfo ) info ) . PropertyType ,
91
91
_ => null
92
92
} , info )
93
93
} ) ;
94
- return animation ;
94
+ return animator ;
95
95
}
96
96
97
97
public static MilInstantAnimator MileaseAdditive ( this object target , string memberName , object startValue ,
@@ -104,47 +104,47 @@ public static MilInstantAnimator Milease(this object target, string memberName,
104
104
object toValue , float duration , float delay = 0f , EaseFunction easeFunction = EaseFunction . Quad ,
105
105
EaseType easeType = EaseType . In , MilAnimation . BlendingMode blendingMode = MilAnimation . BlendingMode . Default )
106
106
{
107
- var animation = new MilInstantAnimator ( ) ;
107
+ var animator = new MilInstantAnimator ( ) ;
108
108
var type = target . GetType ( ) ;
109
109
var members = type . GetMember ( memberName ) ;
110
110
if ( members . Length == 0 )
111
111
{
112
112
throw new MilMemberNotFoundException ( memberName ) ;
113
113
}
114
114
var info = members [ 0 ] ;
115
- animation . Collection . Add ( new List < RuntimeAnimationPart > ( )
115
+ animator . Collection . Add ( new List < RuntimeAnimationPart > ( )
116
116
{
117
- new ( target , MilAnimation . SimplePart ( startValue , toValue , duration , delay , easeFunction , easeType , blendingMode ) , info . MemberType switch
117
+ new ( target , animator , MilAnimation . SimplePart ( startValue , toValue , duration , delay , easeFunction , easeType , blendingMode ) , info . MemberType switch
118
118
{
119
119
MemberTypes . Field => ( ( FieldInfo ) info ) . FieldType ,
120
120
MemberTypes . Property => ( ( PropertyInfo ) info ) . PropertyType ,
121
121
_ => null
122
122
} , info )
123
123
} ) ;
124
- return animation ;
124
+ return animator ;
125
125
}
126
126
127
127
public static MilInstantAnimator Milease ( this object target , string memberName , params MilAnimation . AnimationPart [ ] animations )
128
128
{
129
- var animation = new MilInstantAnimator ( ) ;
129
+ var animator = new MilInstantAnimator ( ) ;
130
130
var type = target . GetType ( ) ;
131
131
var members = type . GetMember ( memberName ) ;
132
132
if ( members . Length == 0 )
133
133
{
134
134
throw new MilMemberNotFoundException ( memberName ) ;
135
135
}
136
136
var info = members [ 0 ] ;
137
- animation . Collection . Add (
137
+ animator . Collection . Add (
138
138
animations . Select ( x =>
139
- new RuntimeAnimationPart ( target , x , info . MemberType switch
139
+ new RuntimeAnimationPart ( target , animator , x , info . MemberType switch
140
140
{
141
141
MemberTypes . Field => ( ( FieldInfo ) info ) . FieldType ,
142
142
MemberTypes . Property => ( ( PropertyInfo ) info ) . PropertyType ,
143
143
_ => null
144
144
} , info )
145
145
) . ToList ( )
146
146
) ;
147
- return animation ;
147
+ return animator ;
148
148
}
149
149
}
150
150
}
0 commit comments