![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
![]() |
#11 |
The Old Man
![]() Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 28
Uploads: 3
|
![]()
Here's an example:
[SHType] public class MinMax { /// <summary> /// Minimum value. /// </summary> public float Min; /// <summary> /// Maximum value. /// </summary> public float Max; } With the attribute [SHType] and 'class' for this type, it means S3D (and the game) will expect the 'Min' and 'Max' field names preceding the actual value (followed by nullchar). public struct MinMax { /// <summary> /// Minimum value. /// </summary> public float Min; /// <summary> /// Maximum value. /// </summary> public float Max; } Make it a struct, and remove the attribute, then the field names are not 'expected' and the size of the field is explicit by field type (float in this case). This struct is a mere total of 8 bytes, much less then the first 'class' (at 24 bytes).
__________________
![]() SH5 mods: Speech Recognition for SH5 | Digital UI Clock Tutorials: [TEC] Import/export 3D models to/from game using S3D [TEC] How to work with the model viewer in S3D - VIDEO |
![]() |
![]() |
|
|