protected override void ReceivedPlainMessage(string jsonString, UdpReceiver.ReceivedMessage.Sender sender)
    {
        // You can implement the parsing of your json based received data here.
        // Have a look into the base implementation in JsonConverter.cs to see a possible way how to do this.

        // If you cannot use the received data, call the base method to pass on the DevKit internal json messages.
        base.ReceivedPlainMessage(jsonString, sender);
    }
 private void CallReceivedVideoLoadMessage(VideoLoadAsset videoLoadAsset, UdpReceiver.ReceivedMessage.Sender sender)
 {
     if (ReceivedVideoLoadMessage != null)
     {
         foreach (ReceivedVideoLoadMessageDelegated Callack in ReceivedVideoLoadMessage.GetInvocationList())
         {
             try
             {
                 Callack(videoLoadAsset, sender);
             }
             catch (System.Exception ex)
             {
                 Debug.LogException(ex);
             }
         }
     }
 }
 private void CallReceivedSettingMessage(SettingMessage settingMessage, UdpReceiver.ReceivedMessage.Sender sender)
 {
     if (ReceivedSettingMessage != null)
     {
         foreach (ReceivedSettingMessageDelegated Callack in ReceivedSettingMessage.GetInvocationList())
         {
             try
             {
                 Callack(settingMessage, sender);
             }
             catch (System.Exception ex)
             {
                 Debug.LogException(ex);
             }
         }
     }
 }
 private void CallReceivedFieldOfViewMessage(FieldOfViewAsset fovAsset, UdpReceiver.ReceivedMessage.Sender sender)
 {
     if (ReceivedFieldOfViewMessage != null)
     {
         foreach (ReceivedFieldOfViewMessageDelegated Callack in ReceivedFieldOfViewMessage.GetInvocationList())
         {
             try
             {
                 Callack(fovAsset, sender);
             }
             catch (System.Exception ex)
             {
                 Debug.LogException(ex);
             }
         }
     }
 }
 private void CallReceivedSpawnAsset(SpawnAsset spawnAsset, UdpReceiver.ReceivedMessage.Sender sender)
 {
     if (ReceivedSpawnAsset != null)
     {
         foreach (ReceivedSpawnAssetDelegated Callack in ReceivedSpawnAsset.GetInvocationList())
         {
             try
             {
                 Callack(spawnAsset, sender);
             }
             catch (System.Exception ex)
             {
                 Debug.LogException(ex);
             }
         }
     }
 }
 protected virtual void ReceivedPlainMessage(string jsonString, UdpReceiver.ReceivedMessage.Sender sender)
 {
     try
     {
         EventType eventType = JsonUtility.FromJson <EventType>(jsonString);
         if (eventType.EventIdentifier != EventIdentifierBase.UNKNOWN)
         {
             ReceivedEventMessage(jsonString, eventType.EventIdentifier, sender);
         }
         else
         {
             Debug.LogWarning("Received JSON Message of unknown event type.");
         }
     }
     catch (System.ArgumentException exception)
     {
         Debug.LogException(exception);
         Debug.LogError("The json string, that led to an exception:\n" + jsonString);
     }
 }
    protected override void ReceivedEventMessage(string jsonString, uint eventIdentifier, UdpReceiver.ReceivedMessage.Sender sender)
    {
        switch (eventIdentifier)
        {
        case EventIdentifierVideo.VIDEO_SYNC:
            VideoSyncAsset videoSyncAsset = JsonUtility.FromJson <VideoSyncAsset>(jsonString);
            CallReceivedVideoSyncMessage(videoSyncAsset, sender);
            break;

        case EventIdentifierVideo.VIDEO_START_PAUSE:
            VideoStartPauseAsset videoStartPauseAsset = JsonUtility.FromJson <VideoStartPauseAsset>(jsonString);
            CallReceivedVideoStartPauseMessage(videoStartPauseAsset, sender);
            break;

        case EventIdentifierVideo.VIDEO_LOAD:
            VideoLoadAsset videoLoadAsset = JsonUtility.FromJson <VideoLoadAsset>(jsonString);
            CallReceivedVideoLoadMessage(videoLoadAsset, sender);
            break;

        default:
            base.ReceivedEventMessage(jsonString, eventIdentifier, sender);
            break;
        }
    }
        protected virtual void ReceivedEventMessage(string jsonString, uint eventIdentifier, UdpReceiver.ReceivedMessage.Sender sender)
        {
            //Debug.Log("Received JSON: " + jsonString);

            switch (eventIdentifier)
            {
            case EventIdentifierBase.ASSET_TRANSFORM:
                TransformAsset transformAsset = JsonUtility.FromJson <TransformAsset>(jsonString);
                CallReceivedTransformAsset(transformAsset, sender);
                break;

            case EventIdentifierBase.ASSET_SPAWN:
                SpawnAsset spawnAsset = JsonUtility.FromJson <SpawnAsset>(jsonString);
                CallReceivedSpawnAsset(spawnAsset, sender);
                break;

            case EventIdentifierBase.ASSET_FOV:
                FieldOfViewAsset fovAsset = JsonUtility.FromJson <FieldOfViewAsset>(jsonString);
                CallReceivedFieldOfViewMessage(fovAsset, sender);
                break;

            case EventIdentifierBase.SETTING_MESSAGE:
                SettingMessage settingMessage = JsonUtility.FromJson <SettingMessage>(jsonString);
                if (settingMessage.valueType == SettingMessage.ValueType.FLOAT)
                {
                    SettingMessageFloat settingMessageFloat = JsonUtility.FromJson <SettingMessageFloat>(jsonString);
                    CallReceivedSettingMessage(settingMessageFloat, sender);
                }
                else
                {
                    Debug.LogWarning("Setting Message was received, but value type has not yet been implemented. This message is dismissed.");
                }
                break;

            default:
                Debug.LogWarning("Received Event of Type " + EventIdentifierBase.GetIdentifierName(eventIdentifier) + "(" + eventIdentifier + ") but it was not handled.");
                break;
            }
        }