Scripting Reference

◆ memberName [1/2]

TArgument this[[NotNull] string Sisus.Init.MonoBehaviour< TFirstArgument, TSecondArgument, TThirdArgument, TFourthArgument, TFifthArgument >.memberName

Assigns an argument received during initialization to a field or property by the memberName given name.

Because reflection is used to set the value it is possible to use this to assign to init only fields and properties. Properties that do not have a set accessor and are not auto-implemented are not supported however.

memberNameName of the field or property to which to assign the value.
InvalidOperationExceptionThrown if this method is called outside of the context of the client object being initialized.
ArgumentNullExceptionThrown if the provided memberName is null.
MissingMemberExceptionThrown if no field or property by the provided name is found or if property by given name is not auto-implemented and does not have a set accessor.