The following property declarations will now be compiled by UdonSharp.
public string Property1 => "Some Value";
public string Property2 { get; }
public string Property3 { get; set; }
// This will cause synchronization to be performed on the auto-generated internal field.
[field: UdonSynced]
public string Property4 { get; private set; }
private string _backingField;
public string Property5
{
get => _backingField;
set
{
if (_backingField != value)
NotifiyPropertyChanged(nameof(Property5));
_backingField = value;
}
}
In this pull request, the compiler internally converts to UdonAssembly as method declarations and method calls, just like in real C#.
For example, public string SomeProperty { get; private set; } will be converted into UdonAssembly as shown below:
The concern is that it is currently a low priority and may reduce the maintainability of the compiler; also, many users can build UdonSharp code without this feature without any problems.
The following property declarations will now be compiled by UdonSharp.
In this pull request, the compiler internally converts to UdonAssembly as method declarations and method calls, just like in real C#. For example,
public string SomeProperty { get; private set; }
will be converted into UdonAssembly as shown below:Also, property calls (like
_instance.SomeProperty
) are converted as follows:The concern is that it is currently a low priority and may reduce the maintainability of the compiler; also, many users can build UdonSharp code without this feature without any problems.