Hi Belinda,
Nice set of notes there, a couple of remarks as requested in your other topic;
Note 8
One minor thing I would add;
The attribute [SerializeField] doesn’t make a field in the Inspector, it exposes your private field from the class. Your line;
[SerializeField] Text textComponent;
could also be written as;
[SerializeField] private Text textComponent;
private being the access modifier for the member variable (field) in question. C# defaults to private which is why you can get away with not specifying it.
Note 11
Again, a minor thing, as opposed to “taking care of”, it is actually inheriting from ScriptableObject.
A child class (State) can reuse (inherit), extend or modify the behaviour of a parent class (ScriptableObject). anything which is public (or protected / internal) in the parent class will be available within the derived class.
Hierarchy would look like this;
See also;
Note 20 (the first one )
“The textarea code”, we’d refer to that as an attribute.
Note 20 (the second one)
“Story Text”, in case you hadn’t realised, Unity has a built-in prettify feature which will take variable names and make them more readable, so, storyText
became “Story Text” in the Inspector, Unity upper-cased the first letter, and placed a space before the next capital letter.
Note 22
Yes, you could think of a method as a behaviour, something that class can do.
Note 24
It’s not so much the type of the method, but the return type of the method, this indicates that what the method returns, in this case, will be of type string. An error would occur if you tried to return a value of a different type, unless you cast it to a string (if possible) first.
Note 36
You are declaring a variable of type State, the variable is named state
.
Only minor points above, offered for the sake of clarity. All in all a very good write up demonstrating your understanding, well done