-
Notifications
You must be signed in to change notification settings - Fork 0
IDString
Ondřej Kačírek edited this page May 3, 2025
·
1 revision
IDString
is a serializable wrapper for a string with auto-formatted ID logic.
This class ensures a clean, space-free ID by automatically replacing spaces with underscores during serialization or assignment.
- Auto-replaces spaces with underscores in the string
- Serializable in Unity
- Implicit conversion to
string
IDString myID = new IDString("My Custom ID");
Debug.Log(myID); // Outputs "My_Custom_ID"
-
private string id
— the internal string representation.
-
string ID
— gets or sets the ID. Trims leading whitespace and replaces spaces with underscores.
-
implicit operator string(IDString)
— allows implicit conversion to string.