Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class TNEventReceiver : MonoBehaviour
- {
- protected virtual void OnError (string msg) { }
- protected virtual void OnConnect (bool success, string msg) { }
- protected virtual void OnDisconnect () { }
- protected virtual void OnJoinChannel (int channelID, bool success, string message) { }
- protected virtual void OnLeaveChannel (int channelID) { }
- protected virtual void OnPlayerJoin (int channelID, Player p) { }
- protected virtual void OnPlayerLeave (int channelID, Player p) { }
- protected virtual void OnRenamePlayer (Player p, string previous) { }
- protected virtual void OnSetServerData (string path, DataNode node) { }
- protected virtual void OnSetChannelData (Channel ch, string path, DataNode node) { }
- protected virtual void OnSetPlayerData (Player p, string path, DataNode node) { }
- protected virtual void OnEnable ()
- {
- TNManager.onError += OnError;
- TNManager.onConnect += OnConnect;
- TNManager.onDisconnect += OnDisconnect;
- TNManager.onJoinChannel += OnJoinChannel;
- TNManager.onLeaveChannel += OnLeaveChannel;
- TNManager.onPlayerJoin += OnPlayerJoin;
- TNManager.onPlayerLeave += OnPlayerLeave;
- TNManager.onRenamePlayer += OnRenamePlayer;
- TNManager.onSetServerData += OnSetServerData;
- TNManager.onSetChannelData += OnSetChannelData;
- TNManager.onSetPlayerData += OnSetPlayerData;
- }
- protected virtual void OnDisable ()
- {
- TNManager.onError -= OnError;
- TNManager.onConnect -= OnConnect;
- TNManager.onDisconnect -= OnDisconnect;
- TNManager.onJoinChannel -= OnJoinChannel;
- TNManager.onLeaveChannel -= OnLeaveChannel;
- TNManager.onPlayerJoin -= OnPlayerJoin;
- TNManager.onPlayerLeave -= OnPlayerLeave;
- TNManager.onRenamePlayer -= OnRenamePlayer;
- TNManager.onSetServerData -= OnSetServerData;
- TNManager.onSetChannelData -= OnSetChannelData;
- TNManager.onSetPlayerData -= OnSetPlayerData;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement