View on Asset Store (opens in new tab)
Package details
- Latest version
- 1.2.5
- Last updated
- First released
- Unity version
- 2022.3.29 or later
- Package size
- 670 KB
- Files
- 76
- Favorites
- 4
- Views in the past week
- 8
Price tracking
- Last checked
- Tracked since
- Lowest recorded
- $39.00 on
Keywords
BinaryFileIO : Real-time Save/Load
- Price drop
Save and load in binary: Async, CRC-validated, and AI-ready.
Lowest recorded price
Get 51% off on Asset Store (opens in new tab)Affiliate link · Purchases support this site
Price history
Last 6 months
USDAsset preview
1 / 4
BinaryFileIO : Real-time Save/Load screenshot 1
About this asset
A replacement for BinaryFormatter to read and write the public fields and properties of class objects/scripts using BinaryReader and BinaryWriter.
Features
- Supports many common objects and collection types, including deeply nested combinations such as List<Dictionary<string, Vector3>>[,,,,,].
- Use public properties to save and restore references such as sprites, materials, addressables, and other Unity component data.
- Read and write asynchronously with Task-based methods or Unity coroutines.
- Update existing GameObjects and ScriptableObjects by reading data directly into them.
- Stores data in a compact binary format instead of a text-based format such as JSON.
- Convert objects to byte arrays for encryption, networking, or other custom processing.
- Convert objects to and from Base64 strings.
- Apply an XOR byte mask to serialized data to make it less human-readable.
- Find and read the first occurrence of a single saved field or property.
- Includes a SKILL.md file to help compatible AI coding assistants use BinaryFileIO correctly.
Deserialization Security
- Uses strongly typed read methods instead of resolving arbitrary serialized type names.
- Does not store or load fully qualified assembly names.
- Explicitly excludes known unsafe or unsupported runtime types.
- Does not invoke parameterized constructors when ordinary objects are recreated from their public fields and properties.
File Integrity
- Uses CRC-32 to detect corrupted or modified file data.
- Path-based writes are completed in a temporary file before being copied over the destination file.
- Uses thread-safe resource locking with SemaphoreSlim to prevent conflicting reads and writes.
Debug Log
- Shows read and write information while playing in the Unity Editor.
- Provides warnings for common configuration and serialization problems.
- Messages and warnings can be disabled and are excluded from final builds.
Tutorial for saving in Unity Loady Dungeons:
From the publisher's Asset Store listing.
Technical details
Supports class/script objects with the following member types:
- Primitive / Scalar = byte, sbyte, short, ushort, int, uint, long, ulong, bool, char, float, double, decimal, string, enum, DateTime, Guid, TimeSpan, Version.
- Collections = Array, Dictionary, SortedList, SortedDictionary, ConcurrentDictionary, List, HashSet, ObservableCollection, Queue, Stack, LinkedList, SortedSet, ConcurrentBag, ConcurrentQueue, ConcurrentStack, BlockingCollection.
- Tuples / Pairs = Tuple, ValueTuple, KeyValuePair.
- Objects / Structs = Classes and structs containing supported public members, including Unity structs such as Vector3, Color, and Quaternion.
- Unity References = MonoBehaviour (script), GameObject, ScriptableObject. Existing instances must be used with ReadInto when loading.
- Polymorphic Collections = Custom type mappings can be added so derived runtime types can be correctly recreated when stored through a base type.
Explicitly does not support the following unsafe types:
- IntPtr, UIntPtr, Uri, WeakReference, HandleRef, GCHandle.
- Delegate types derived from MulticastDelegate.
- Abstract types.
If a public field or property in a class/script object uses an unsupported type, that member is skipped while all other supported members are still read or written. When warnings are enabled, a warning is shown in the Unity Editor.
Compatibility
| Unity version | Built-in | URP | HDRP | Custom |
|---|---|---|---|---|
| 6000.3.25f1 | Compatible | Compatible | Compatible | Compatible |
| 6000.3.17f1 | Compatible | Compatible | Compatible | Compatible |
| 6000.3.0f1 | Compatible | Compatible | Compatible | Compatible |
| 6000.2.4f1 | Compatible | Compatible | Compatible | Compatible |
| 6000.1.4f1 | Compatible | Compatible | Compatible | Compatible |
| 6000.0.23f1 | Compatible | Compatible | Compatible | Compatible |
| 2022.3.29f1 | Compatible | Compatible | Compatible | Compatible |
BinaryFileIO is render-pipeline independent.
Example materials use Built-In Render Pipeline, but can easily be converted to URP.
As listed on the Asset Store.