@@ -21,7 +21,6 @@ internal sealed class ArrayEditor : ResoniteCancelableEventHandlerMonkey<ArrayEd
2121 private static readonly MethodInfo _addListReferenceProxying = AccessTools . Method ( typeof ( ArrayEditor ) , nameof ( AddListReferenceProxying ) ) ;
2222 private static readonly MethodInfo _addListValueProxying = AccessTools . Method ( typeof ( ArrayEditor ) , nameof ( AddListValueProxying ) ) ;
2323 private static readonly Type _iWorldElementType = typeof ( IWorldElement ) ;
24- private static readonly Type _particleBurstType = typeof ( ParticleBurst ) ;
2524
2625 private static readonly MethodInfo _setLinearPoint = AccessTools . Method ( typeof ( ArrayEditor ) , nameof ( SetLinearPoint ) ) ;
2726 private static readonly MethodInfo _setCurvePoint = AccessTools . Method ( typeof ( ArrayEditor ) , nameof ( SetCurvePoint ) ) ;
@@ -184,41 +183,6 @@ private static void AddListValueProxying<T>(SyncArray<T> array, SyncElementList<
184183 } ;
185184 }
186185
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-
222186 private static void AddTubePointProxying ( SyncArray < TubePoint > array , SyncElementList < ValueGradientDriver < float3 > . Point > list )
223187 {
224188 foreach ( var tubePoint in array )
@@ -271,23 +235,6 @@ private static void AddUpdateProxies<T>(SyncArray<LinearKey<T>> array,
271235 }
272236 }
273237
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-
291238 private static void AddUpdateProxies < T > ( SyncArray < T > array , SyncElementList < Sync < T > > list , IEnumerable < Sync < T > > elements )
292239 where T : IEquatable < T >
293240 {
@@ -366,11 +313,6 @@ private static bool BuildArray(ISyncArray array, string name, FieldInfo fieldInf
366313 var syncLinearType = syncLinearGenericParameters ? . First ( ) ;
367314 var syncCurveType = syncCurveGenericParameters ? . First ( ) ;
368315
369- var isParticleBurst = syncLinearType == _particleBurstType ;
370-
371- if ( isSyncLinear && isParticleBurst )
372- syncLinearType = typeof ( int2 ) ;
373-
374316 var proxySlotName = $ "{ name } -{ array . ReferenceID } -Proxy";
375317 var proxiesSlot = ui . World . AssetsSlot ;
376318 var newProxy = false ;
@@ -395,10 +337,7 @@ private static bool BuildArray(ISyncArray array, string name, FieldInfo fieldInf
395337
396338 if ( attachedNew )
397339 {
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 ] ) ;
402341 }
403342 }
404343 else if ( isSyncCurve && SupportsLerp ( syncCurveType ! ) )
@@ -494,13 +433,6 @@ void ArrayDriveCheck(IChangeable changeable)
494433 return true ;
495434 }
496435
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-
504436 static void SetLinearPoint < T > ( ValueGradientDriver < T > . Point point , LinearKey < T > arrayElem ) where T : IEquatable < T >
505437 {
506438 point . Position . Value = arrayElem . time ;
@@ -569,7 +501,6 @@ static void ArrayChanged(IChangeable changeable)
569501 var isSyncCurve = TryGetGenericParameters ( typeof ( SyncCurve < > ) , array . GetType ( ) , out var syncCurveGenericParameters ) ;
570502 var syncLinearType = syncLinearGenericParameters ? . First ( ) ;
571503 var syncCurveType = syncCurveGenericParameters ? . First ( ) ;
572- var isParticleBurst = syncLinearType == _particleBurstType ;
573504
574505 if ( ! TryGetGenericParameters ( typeof ( SyncArray < > ) , array . GetType ( ) , out var genericParameters ) )
575506 return ;
@@ -582,10 +513,7 @@ static void ArrayChanged(IChangeable changeable)
582513
583514 if ( isSyncLinear && SupportsLerp ( syncLinearType ! ) )
584515 {
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 ) ] ) ;
589517 }
590518 else if ( isSyncCurve && SupportsLerp ( syncCurveType ! ) )
591519 {
0 commit comments