Example #1
0
    private void Initialize(INetworkEngineConnector networkEngineConnector)
    {
        sticky = gameObject.GetComponent <Sticky>();
        image  = sticky.displayImage;
        textureSharingComponent   = gameObject.GetComponent <TextureSharingComponent>();
        textureBroadcastComponent = gameObject.GetComponent <TextureBroadcastComponent>();

        textureSharingComponent.OnReceivedRawTexture
        .Subscribe(tex2d => SetTexture(tex2d))
        .AddTo(this);

        textureBroadcastComponent.OnReceivedRawTexture
        .Subscribe(tex2d => SetTexture(tex2d))
        .AddTo(this);

        networkEngineConnector.OnJoinedRoomAsObservable
        .Where(_ => sticky.displayText.text.Equals(string.Empty))
        .Subscribe(_ => StartTextureSharing())
        .AddTo(this);
    }
Example #2
0
 public void SetTexture4TextureSharing(Texture2D texture2D)
 {
     textureSharingComponent = gameObject.GetComponent <TextureSharingComponent>();
     textureSharingComponent.GetRawTextureDataFromMasterClient(texture2D);
 }
Example #3
0
 private void Start()
 {
     drawableCanvas          = gameObject.GetComponent <DrawableCanvas>();
     textureSharingComponent = gameObject.GetComponent <TextureSharingComponent>();
     textureSharingComponent.OnReceivedRawTexture.Subscribe(tex2d => SetTexture(tex2d));
 }