@@ -41,17 +41,17 @@ public sealed class Live2DExtractor
41
41
private HashSet < string > EyeBlinkParameters { get ; set ; }
42
42
private HashSet < string > LipSyncParameters { get ; set ; }
43
43
44
- public Live2DExtractor ( KeyValuePair < MonoBehaviour , List < Object > > assetGroupKvp , List < AnimationClip > inClipMotions = null , List < MonoBehaviour > inFadeMotions = null , MonoBehaviour inFadeMotionLst = null )
44
+ public Live2DExtractor ( KeyValuePair < MonoBehaviour , List < Object > > assetGroupKvp , List < AnimationClip > selClipMotions = null , List < MonoBehaviour > selFadeMotions = null , MonoBehaviour selFadeMotionLst = null )
45
45
{
46
46
Expressions = new List < MonoBehaviour > ( ) ;
47
- FadeMotions = inFadeMotions ?? new List < MonoBehaviour > ( ) ;
48
- AnimationClips = inClipMotions ?? new List < AnimationClip > ( ) ;
47
+ FadeMotions = selFadeMotions ?? new List < MonoBehaviour > ( ) ;
48
+ AnimationClips = selClipMotions ?? new List < AnimationClip > ( ) ;
49
+ FadeMotionLst = selFadeMotionLst ;
49
50
Texture2Ds = new List < Texture2D > ( ) ;
50
51
EyeBlinkParameters = new HashSet < string > ( ) ;
51
52
LipSyncParameters = new HashSet < string > ( ) ;
52
53
ParameterNames = new HashSet < string > ( ) ;
53
54
PartNames = new HashSet < string > ( ) ;
54
- FadeMotionLst = inFadeMotionLst ;
55
55
ParametersCdi = new List < MonoBehaviour > ( ) ;
56
56
PartsCdi = new List < MonoBehaviour > ( ) ;
57
57
PoseParts = new List < MonoBehaviour > ( ) ;
@@ -61,6 +61,10 @@ public Live2DExtractor(KeyValuePair<MonoBehaviour, List<Object>> assetGroupKvp,
61
61
var searchModelParamCdi = true ;
62
62
var searchModelPartCdi = true ;
63
63
var searchPoseParts = true ;
64
+ var searchFadeMotions =
65
+ selClipMotions == null
66
+ && selFadeMotions == null
67
+ && selFadeMotionLst == null ;
64
68
65
69
Logger . Debug ( "Sorting model assets.." ) ;
66
70
@@ -69,9 +73,9 @@ public Live2DExtractor(KeyValuePair<MonoBehaviour, List<Object>> assetGroupKvp,
69
73
{
70
74
Model = model ;
71
75
PhysicsMono = Model . PhysicsController ;
72
- if ( inFadeMotionLst == null && TryGetFadeList ( Model . FadeController , out var fadeMono ) )
76
+ if ( searchFadeMotions && TryGetFadeList ( Model . FadeController , out var fadeMono ) )
73
77
{
74
- FadeMotionLst = inFadeMotionLst = fadeMono ;
78
+ FadeMotionLst = selFadeMotionLst = fadeMono ;
75
79
}
76
80
if ( TryGetExpressionList ( Model . ExpressionController , out var expressionMono ) )
77
81
{
@@ -122,13 +126,13 @@ public Live2DExtractor(KeyValuePair<MonoBehaviour, List<Object>> assetGroupKvp,
122
126
Expressions . Add ( m_MonoBehaviour ) ;
123
127
break ;
124
128
case "CubismFadeMotionData" :
125
- if ( inFadeMotions == null && inFadeMotionLst == null )
129
+ if ( searchFadeMotions )
126
130
{
127
131
FadeMotions . Add ( m_MonoBehaviour ) ;
128
132
}
129
133
break ;
130
134
case "CubismFadeMotionList" :
131
- if ( inFadeMotions == null && inFadeMotionLst == null )
135
+ if ( searchFadeMotions )
132
136
{
133
137
FadeMotionLst = m_MonoBehaviour ;
134
138
}
@@ -187,7 +191,7 @@ public Live2DExtractor(KeyValuePair<MonoBehaviour, List<Object>> assetGroupKvp,
187
191
}
188
192
break ;
189
193
case AnimationClip m_AnimationClip :
190
- if ( inClipMotions == null )
194
+ if ( selClipMotions == null )
191
195
{
192
196
AnimationClips . Add ( m_AnimationClip ) ;
193
197
}
0 commit comments