DoubleDeez / MDFramework

A multiplayer C# game framework for Godot 3.4 Mono.
https://discord.gg/UH49eHK
MIT License
77 stars 13 forks source link

Support Events as MDReplicate OnChange callbacks #84

Closed DoubleDeez closed 3 years ago

DoubleDeez commented 3 years ago

Being able to do this would be nice and clean, currently the Callback does not send the value as an argument. Perhaps it could be auto detected if the registered callback supports the argument and sends it if so?

        [MDReplicated]
        [MDReplicatedSetting(MDReplicatedMember.Settings.OnValueChangedEvent, nameof(OnPlayerNameChangedEvent))]
        public string PlayerName { get; protected set; } = "";
        public event Action<string> OnPlayerNameChangedEvent = delegate { };