@@ -204,7 +204,7 @@ public class CuiElement
204
204
205
205
[ JsonProperty ( "fadeOut" ) ]
206
206
public float FadeOut { get ; set ; }
207
-
207
+
208
208
[ JsonProperty ( "update" , NullValueHandling = NullValueHandling . Ignore ) ]
209
209
public bool Update { get ; set ; }
210
210
}
@@ -428,10 +428,13 @@ public class CuiNeedsKeyboardComponent : ICuiComponent
428
428
public string Type => "NeedsKeyboard" ;
429
429
}
430
430
431
- public class CuiRectTransformComponent : ICuiComponent
431
+ public class CuiRectTransformComponent : CuiRectTransform , ICuiComponent
432
432
{
433
433
public string Type => "RectTransform" ;
434
+ }
434
435
436
+ public class CuiRectTransform
437
+ {
435
438
// The normalized position in the parent RectTransform that the lower left corner is anchored to
436
439
[ JsonProperty ( "anchormin" ) ]
437
440
public string AnchorMin { get ; set ; }
@@ -449,6 +452,72 @@ public class CuiRectTransformComponent : ICuiComponent
449
452
public string OffsetMax { get ; set ; }
450
453
}
451
454
455
+ public class CuiScrollViewComponent : ICuiComponent
456
+ {
457
+ public string Type => "UnityEngine.UI.ScrollView" ;
458
+
459
+ [ JsonProperty ( "contentTransform" ) ]
460
+ public CuiRectTransform ContentTransform { get ; set ; }
461
+
462
+ [ JsonProperty ( "horizontal" ) ]
463
+ public bool Horizontal { get ; set ; }
464
+
465
+ [ JsonProperty ( "vertical" ) ]
466
+ public bool Vertical { get ; set ; }
467
+
468
+ [ JsonProperty ( "movementType" ) ]
469
+ [ JsonConverter ( typeof ( StringEnumConverter ) ) ]
470
+ public ScrollRect . MovementType MovementType { get ; set ; }
471
+
472
+ [ JsonProperty ( "elasticity" ) ]
473
+ public float Elasticity { get ; set ; }
474
+
475
+ [ JsonProperty ( "inertia" ) ]
476
+ public bool Inertia { get ; set ; }
477
+
478
+ [ JsonProperty ( "decelerationRate" ) ]
479
+ public float DecelerationRate { get ; set ; }
480
+
481
+ [ JsonProperty ( "scrollSensitivity" ) ]
482
+ public float ScrollSensitivity { get ; set ; }
483
+
484
+ [ JsonProperty ( "horizontalScrollbar" ) ]
485
+ public CuiScrollbar HorizontalScrollbar { get ; set ; }
486
+
487
+ [ JsonProperty ( "verticalScrollbar" ) ]
488
+ public CuiScrollbar VerticalScrollbar { get ; set ; }
489
+ }
490
+
491
+ public class CuiScrollbar
492
+ {
493
+ [ JsonProperty ( "invert" ) ]
494
+ public bool Invert { get ; set ; }
495
+
496
+ [ JsonProperty ( "autoHide" ) ]
497
+ public bool AutoHide { get ; set ; }
498
+
499
+ [ JsonProperty ( "handleSprite" ) ]
500
+ public string HandleSprite { get ; set ; }
501
+
502
+ [ JsonProperty ( "size" ) ]
503
+ public float Size { get ; set ; }
504
+
505
+ [ JsonProperty ( "handleColor" ) ]
506
+ public string HandleColor { get ; set ; }
507
+
508
+ [ JsonProperty ( "highlightColor" ) ]
509
+ public string HighlightColor { get ; set ; }
510
+
511
+ [ JsonProperty ( "pressedColor" ) ]
512
+ public string PressedColor { get ; set ; }
513
+
514
+ [ JsonProperty ( "trackSprite" ) ]
515
+ public string TrackSprite { get ; set ; }
516
+
517
+ [ JsonProperty ( "trackColor" ) ]
518
+ public string TrackColor { get ; set ; }
519
+ }
520
+
452
521
public class ComponentConverter : JsonConverter
453
522
{
454
523
public override void WriteJson ( JsonWriter writer , object value , JsonSerializer serializer )
@@ -504,6 +573,10 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
504
573
type = typeof ( CuiRectTransformComponent ) ;
505
574
break ;
506
575
576
+ case "UnityEngine.UI.ScrollView" :
577
+ type = typeof ( CuiScrollViewComponent ) ;
578
+ break ;
579
+
507
580
default :
508
581
return null ;
509
582
}
0 commit comments