Skip to content

Commit bef8302

Browse files
authored
Merge pull request #41 from juliusdeblaaij/patch-1
Update creating-custom-class.md (fixes #40)
2 parents 3fe3440 + fdaeae0 commit bef8302

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Documentation~/docs/4-fundamentals/creating-custom-class.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ namespace Custom.Variable
1616
{
1717
}
1818

19+
[Serializable]
1920
public struct Health
2021
{
2122
public float current;
@@ -26,3 +27,6 @@ namespace Custom.Variable
2627

2728
Creating custom class is encouraged as you can setup the namespace in accordance to your projects.
2829
This is beneficial if you try to track references, so that you don't ended up in a general Kassets' namespace.
30+
31+
**Serializable**
32+
It is important to note that your custom struct or class needs to have the Serializable attribute. Otherwise you will see null reference exceptions as the editor inspector cannot find the value of the class.

0 commit comments

Comments
 (0)