MerlinVR / UdonSharp

An experimental compiler for compiling C# to Udon assembly
MIT License
671 stars 87 forks source link

Add a method attribute to export private methods for use in SendCustomEventDelayed / SendCustomNetworkEvent #112

Open TheHelpfulHelper opened 3 years ago

TheHelpfulHelper commented 3 years ago

Feature Description: In order for a method/event to be accessible to SendCustomEventDelayed / SendCustomNetworkEvent it needs to be exported. However making it public, means that now all other scripts can also call this method. This makes the intent of the method unclear (Is it just public so you can call it with SCED/SCNE or am I allowed to call it from other scripts as well?). Adding an attribute like that would make it clear that youre not "supposed" to call the method from another script. (Ofcourse you could still call it with SCE from another behaviour, but the main argument is showing use-intent for people using UdonSharp and for Intellisense. sort of like [SerializeField] for variables.)