You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 22, 2018. It is now read-only.
The use case would be making sure that every entity has all required components. For example, a player controller component (move the player with the keyboard) needs a camera.
publicclassPlayerControllerComponent:SyncScript{//Game Studio doesn't seem to check this, which makes it rather useless[NotNull]publicCameraComponentCamera{get;set;}}
Though, only public properties which can be edited in the game studio should be checked.
The text was updated successfully, but these errors were encountered:
That is not the purpose of NotNull. It is a design-time only attribute used to let ReSharper do a static analysis to detect wrong usages of nullability.
@Kryptos-FR Oh, I assumed that it didn't have anything to do with that [NotNull] attribute, since it's defined inside SiliconStudio.Core.Annotations.
Well, what would be an alternative to achieve what I want to achieve? It's not that uncommon that a component needs a reference to another component to work properly.
Checking it in code would require me to write a lot of extra code that I would prefer to avoid writing. Also, it would be a runtime check rather than a game-studio-time check.
Dependency injection would be one alternative that I can think of right now.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The use case would be making sure that every entity has all required components. For example, a player controller component (move the player with the keyboard) needs a camera.
Though, only public properties which can be edited in the game studio should be checked.
The text was updated successfully, but these errors were encountered: