@@ -71,6 +71,26 @@ public static void DeserializeProperty(Type fieldType, Action<object> setter, Js
7171 {
7272 setter ( element . GetSingle ( ) ) ;
7373 }
74+ else if ( fieldType == typeof ( byte ) && element . ValueKind == JsonValueKind . Number )
75+ {
76+ setter ( element . GetByte ( ) ) ;
77+ }
78+ else if ( fieldType == typeof ( sbyte ) && element . ValueKind == JsonValueKind . Number )
79+ {
80+ setter ( element . GetSByte ( ) ) ;
81+ }
82+ else if ( fieldType == typeof ( ushort ) && element . ValueKind == JsonValueKind . Number )
83+ {
84+ setter ( element . GetUInt16 ( ) ) ;
85+ }
86+ else if ( fieldType == typeof ( short ) && element . ValueKind == JsonValueKind . Number )
87+ {
88+ setter ( element . GetInt16 ( ) ) ;
89+ }
90+ else if ( fieldType == typeof ( uint ) && element . ValueKind == JsonValueKind . Number )
91+ {
92+ setter ( element . GetUInt32 ( ) ) ;
93+ }
7494 else if ( fieldType == typeof ( int ) && element . ValueKind == JsonValueKind . Number )
7595 {
7696 setter ( element . GetInt32 ( ) ) ;
@@ -692,8 +712,12 @@ public static void SerializeProperty(Type fieldType, string name, Func<object> g
692712 if ( fieldType == typeof ( bool ) ||
693713 fieldType == typeof ( float ) ||
694714 fieldType == typeof ( double ) ||
695- fieldType == typeof ( int ) ||
715+ fieldType == typeof ( byte ) ||
716+ fieldType == typeof ( sbyte ) ||
717+ fieldType == typeof ( ushort ) ||
718+ fieldType == typeof ( short ) ||
696719 fieldType == typeof ( uint ) ||
720+ fieldType == typeof ( int ) ||
697721 fieldType == typeof ( string ) )
698722 {
699723 if ( parameters )
@@ -733,13 +757,46 @@ public static void SerializeProperty(Type fieldType, string name, Func<object> g
733757
734758 break ;
735759
736- case Type t when t == typeof ( int ) :
760+ case Type t when t == typeof ( byte ) :
737761
738762 sceneComponent . parameters . Add ( new SceneComponentParameter ( )
739763 {
740764 name = name ,
741765 type = SceneComponentParameterType . Int ,
742- intValue = ( int ) getter ( ) ,
766+ intValue = ( byte ) getter ( ) ,
767+ } ) ;
768+
769+ break ;
770+
771+ case Type t when t == typeof ( sbyte ) :
772+
773+ sceneComponent . parameters . Add ( new SceneComponentParameter ( )
774+ {
775+ name = name ,
776+ type = SceneComponentParameterType . Int ,
777+ intValue = ( sbyte ) getter ( ) ,
778+ } ) ;
779+
780+ break ;
781+
782+ case Type t when t == typeof ( ushort ) :
783+
784+ sceneComponent . parameters . Add ( new SceneComponentParameter ( )
785+ {
786+ name = name ,
787+ type = SceneComponentParameterType . Int ,
788+ intValue = ( ushort ) getter ( ) ,
789+ } ) ;
790+
791+ break ;
792+
793+ case Type t when t == typeof ( short ) :
794+
795+ sceneComponent . parameters . Add ( new SceneComponentParameter ( )
796+ {
797+ name = name ,
798+ type = SceneComponentParameterType . Int ,
799+ intValue = ( short ) getter ( ) ,
743800 } ) ;
744801
745802 break ;
@@ -755,6 +812,38 @@ public static void SerializeProperty(Type fieldType, string name, Func<object> g
755812
756813 break ;
757814
815+ case Type t when t == typeof ( int ) :
816+
817+ sceneComponent . parameters . Add ( new SceneComponentParameter ( )
818+ {
819+ name = name ,
820+ type = SceneComponentParameterType . Int ,
821+ intValue = ( int ) getter ( ) ,
822+ } ) ;
823+
824+ break ;
825+
826+ case Type t when t == typeof ( ulong ) :
827+
828+ sceneComponent . parameters . Add ( new SceneComponentParameter ( )
829+ {
830+ name = name ,
831+ type = SceneComponentParameterType . Int ,
832+ intValue = ( int ) ( ulong ) getter ( ) ,
833+ } ) ;
834+
835+ break ;
836+
837+ case Type t when t == typeof ( long ) :
838+
839+ sceneComponent . parameters . Add ( new SceneComponentParameter ( )
840+ {
841+ name = name ,
842+ type = SceneComponentParameterType . Int ,
843+ intValue = ( int ) ( long ) getter ( ) ,
844+ } ) ;
845+
846+ break ;
758847
759848 case Type t when t == typeof ( string ) :
760849
0 commit comments