Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (sora == null)
        {
            return;
        }

        sora.DispatchEvents();

        if (!MultiRecv)
        {
            if (trackId != 0)
            {
                var image = renderTarget.GetComponent <UnityEngine.UI.RawImage>();
                sora.RenderTrackToTexture(trackId, image.texture);
            }
        }
        else
        {
            foreach (var track in tracks)
            {
                var image = track.Value.GetComponent <UnityEngine.UI.RawImage>();
                sora.RenderTrackToTexture(track.Key, image.texture);
            }
        }
    }
 public void Update()
 {
     if (sora != null)
     {
         sora.DispatchEvents();
         sora.OnRender();
         if (clientType == ClientType.Player)
         {
             if (trackId != 0 && receiveTexture != null)
             {
                 sora.RenderTrackToTexture(trackId, receiveTexture);
                 OnVideoTrack.Invoke(receiveTexture);
             }
         }
     }
 }