@@ -21,7 +21,6 @@ internal sealed class ArrayEditor : ResoniteCancelableEventHandlerMonkey<ArrayEd
21
21
private static readonly MethodInfo _addListReferenceProxying = AccessTools . Method ( typeof ( ArrayEditor ) , nameof ( AddListReferenceProxying ) ) ;
22
22
private static readonly MethodInfo _addListValueProxying = AccessTools . Method ( typeof ( ArrayEditor ) , nameof ( AddListValueProxying ) ) ;
23
23
private static readonly Type _iWorldElementType = typeof ( IWorldElement ) ;
24
- private static readonly Type _particleBurstType = typeof ( ParticleBurst ) ;
25
24
26
25
private static readonly MethodInfo _setLinearPoint = AccessTools . Method ( typeof ( ArrayEditor ) , nameof ( SetLinearPoint ) ) ;
27
26
private static readonly MethodInfo _setCurvePoint = AccessTools . Method ( typeof ( ArrayEditor ) , nameof ( SetCurvePoint ) ) ;
@@ -184,41 +183,6 @@ private static void AddListValueProxying<T>(SyncArray<T> array, SyncElementList<
184
183
} ;
185
184
}
186
185
187
- private static void AddParticleBurstListProxying ( SyncArray < LinearKey < ParticleBurst > > array , SyncElementList < ValueGradientDriver < int2 > . Point > list )
188
- {
189
- foreach ( var burst in array )
190
- {
191
- var point = list . Add ( ) ;
192
- point . Position . Value = burst . time ;
193
- point . Value . Value = new int2 ( burst . value . minCount , burst . value . maxCount ) ;
194
- }
195
-
196
- AddUpdateProxies ( array , list , list . Elements ) ;
197
-
198
- list . ElementsAdded += ( list , startIndex , count ) =>
199
- {
200
- var addedElements = list . Elements . Skip ( startIndex ) . Take ( count ) . ToArray ( ) ;
201
- var buffer = addedElements . Select ( point => new LinearKey < ParticleBurst > ( point . Position , new ParticleBurst ( ) { minCount = point . Value . Value . x , maxCount = point . Value . Value . y } ) ) . ToArray ( ) ;
202
-
203
- if ( ! _skipListChanges )
204
- {
205
- array . Changed -= ArrayChanged ;
206
- array . Insert ( buffer , startIndex ) ;
207
- array . Changed += ArrayChanged ;
208
- }
209
- AddUpdateProxies ( array , list , addedElements ) ;
210
- } ;
211
-
212
- list . ElementsRemoved += ( list , startIndex , count ) =>
213
- {
214
- if ( _skipListChanges ) return ;
215
- if ( array . Count < startIndex + count ) return ;
216
- array . Changed -= ArrayChanged ;
217
- array . Remove ( startIndex , count ) ;
218
- array . Changed += ArrayChanged ;
219
- } ;
220
- }
221
-
222
186
private static void AddTubePointProxying ( SyncArray < TubePoint > array , SyncElementList < ValueGradientDriver < float3 > . Point > list )
223
187
{
224
188
foreach ( var tubePoint in array )
@@ -271,23 +235,6 @@ private static void AddUpdateProxies<T>(SyncArray<LinearKey<T>> array,
271
235
}
272
236
}
273
237
274
- private static void AddUpdateProxies ( SyncArray < LinearKey < ParticleBurst > > array ,
275
- SyncElementList < ValueGradientDriver < int2 > . Point > list , IEnumerable < ValueGradientDriver < int2 > . Point > elements )
276
- {
277
- foreach ( var point in elements )
278
- {
279
- point . Changed += field =>
280
- {
281
- if ( _skipListChanges ) return ;
282
- var index = list . IndexOfElement ( point ) ;
283
- var key = new LinearKey < ParticleBurst > ( point . Position , new ParticleBurst ( ) { minCount = point . Value . Value . x , maxCount = point . Value . Value . y } ) ;
284
- array . Changed -= ArrayChanged ;
285
- array [ index ] = key ;
286
- array . Changed += ArrayChanged ;
287
- } ;
288
- }
289
- }
290
-
291
238
private static void AddUpdateProxies < T > ( SyncArray < T > array , SyncElementList < Sync < T > > list , IEnumerable < Sync < T > > elements )
292
239
where T : IEquatable < T >
293
240
{
@@ -366,11 +313,6 @@ private static bool BuildArray(ISyncArray array, string name, FieldInfo fieldInf
366
313
var syncLinearType = syncLinearGenericParameters ? . First ( ) ;
367
314
var syncCurveType = syncCurveGenericParameters ? . First ( ) ;
368
315
369
- var isParticleBurst = syncLinearType == _particleBurstType ;
370
-
371
- if ( isSyncLinear && isParticleBurst )
372
- syncLinearType = typeof ( int2 ) ;
373
-
374
316
var proxySlotName = $ "{ name } -{ array . ReferenceID } -Proxy";
375
317
var proxiesSlot = ui . World . AssetsSlot ;
376
318
var newProxy = false ;
@@ -395,10 +337,7 @@ private static bool BuildArray(ISyncArray array, string name, FieldInfo fieldInf
395
337
396
338
if ( attachedNew )
397
339
{
398
- if ( isParticleBurst )
399
- AddParticleBurstListProxying ( ( SyncArray < LinearKey < ParticleBurst > > ) array , ( SyncElementList < ValueGradientDriver < int2 > . Point > ) list ) ;
400
- else
401
- _addLinearValueProxying . MakeGenericMethod ( syncLinearType ) . Invoke ( null , [ array , list ] ) ;
340
+ _addLinearValueProxying . MakeGenericMethod ( syncLinearType ) . Invoke ( null , [ array , list ] ) ;
402
341
}
403
342
}
404
343
else if ( isSyncCurve && SupportsLerp ( syncCurveType ! ) )
@@ -494,13 +433,6 @@ void ArrayDriveCheck(IChangeable changeable)
494
433
return true ;
495
434
}
496
435
497
- // doesn't work?
498
- static void SetParticlePoint ( ValueGradientDriver < int2 > . Point point , LinearKey < ParticleBurst > arrayElem )
499
- {
500
- point . Position . Value = arrayElem . time ;
501
- point . Value . Value = new int2 ( arrayElem . value . minCount , arrayElem . value . maxCount ) ;
502
- }
503
-
504
436
static void SetLinearPoint < T > ( ValueGradientDriver < T > . Point point , LinearKey < T > arrayElem ) where T : IEquatable < T >
505
437
{
506
438
point . Position . Value = arrayElem . time ;
@@ -569,7 +501,6 @@ static void ArrayChanged(IChangeable changeable)
569
501
var isSyncCurve = TryGetGenericParameters ( typeof ( SyncCurve < > ) , array . GetType ( ) , out var syncCurveGenericParameters ) ;
570
502
var syncLinearType = syncLinearGenericParameters ? . First ( ) ;
571
503
var syncCurveType = syncCurveGenericParameters ? . First ( ) ;
572
- var isParticleBurst = syncLinearType == _particleBurstType ;
573
504
574
505
if ( ! TryGetGenericParameters ( typeof ( SyncArray < > ) , array . GetType ( ) , out var genericParameters ) )
575
506
return ;
@@ -582,10 +513,7 @@ static void ArrayChanged(IChangeable changeable)
582
513
583
514
if ( isSyncLinear && SupportsLerp ( syncLinearType ! ) )
584
515
{
585
- if ( isParticleBurst )
586
- SetParticlePoint ( ( ValueGradientDriver < int2 > . Point ) elem ! , ( LinearKey < ParticleBurst > ) array . GetElement ( i ) ) ;
587
- else
588
- _setLinearPoint . MakeGenericMethod ( syncLinearType ) . Invoke ( null , [ elem , array . GetElement ( i ) ] ) ;
516
+ _setLinearPoint . MakeGenericMethod ( syncLinearType ) . Invoke ( null , [ elem , array . GetElement ( i ) ] ) ;
589
517
}
590
518
else if ( isSyncCurve && SupportsLerp ( syncCurveType ! ) )
591
519
{
0 commit comments