I love that we’re being shown how to use Getters this early on. It’s something I wish I knew earlier on in order to protect yourself with unnecessary access to variables from other scripts. Thanks, @garypettie!
1 Like
While the Get method works, I prefer to use properties for such simple tasks.
[TextArea(2, 6)]
[SerializeField]
private string question = "Enter new question text here";
public string Question => question;
And it is now even better
[field: TextArea(2, 6), SerializeField] public string Question { get; private set; }
2 Likes