Question regarding the startingState object derived from State type

So during this specific course we make a new object from State class

State state

Just so we could access the method of GetStoryState?
We already made State type object called startingState and we can access GetStateStory from there… so if we want to access the storyText, we can simply write without declaring a new “state” object:

textBlock.text = startingState.GetStoryState();

Why not like that?
Is it correct?
Is it fine if I use it like that or will it lead to errors which I will have hard time finding in the future?

Hi Nikolas,

Rick prepared the next lecture in this video. At the moment, state and startingState seem to be the same but in the next lectures, it’ll hopefully become obvious why we need two different variables.

Your code is correct for the current state of our project but we don’t want to display the text of the startingState object only.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms