Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

How to integrate photon to Project Tiny

Discussion in 'Project Tiny' started by ankitsinghkushwah107, Aug 8, 2019.

  1. ankitsinghkushwah107

    ankitsinghkushwah107

    Joined:
    Jul 21, 2019
    Posts:
    7
    Hello Team,

    I am trying to make a async multiplayer game. I have already used photon in many projects and thought If I could
    integrate it in project tiny. I tried several ways but I am not able to build and run project without error. Have anyone tried this?

    Thanks.
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    You can not, not the regular Unity SDK at least. Project Tiny does not support the standard .NET frameworks (they are responsible for a few of the regular 20MB minimum build size of Unity WebGL builds) or UnityEngine, upon which the Photon SDK relies.

    But what should work is the BrowserInterop approach with Photon's Websocket solution and feed information from JS > Tiny and Tiny > JS. The related documentation can be found at https://doc-api.photonengine.com/en/javascript/current/index.html
     
  3. ankitsinghkushwah107

    ankitsinghkushwah107

    Joined:
    Jul 21, 2019
    Posts:
    7
    @Dreamora
    Thanks for the response.
    did you try webosocket sharp?
     
  4. khalid_mightybear

    khalid_mightybear

    Joined:
    Sep 10, 2017
    Posts:
    36
    Did anyone manage to integrate photon? I'm not sure how to get the import working.

    In my tsconfig.override, I have this
    Code (JavaScript):
    1. {
    2.     "compilerOptions": {
    3.         "allowJs": true,
    4.         "module": "system"
    5.     },
    6.     "include": [
    7.         "External/Photon/Photon-Javascript_SDK.js",
    8.     ],
    9.     "files": [
    10.         "External/Photon/Photon-Javascript_SDK.d.ts"
    11.     ]
    12. }
    And then to test it, I have
    Code (JavaScript):
    1.  
    2. ///<reference path="./../External/Photon/Photon-Javascript_SDK.d.ts" />
    3.  
    4. import Photon from "./../External/Photon/Photon-Javascript_SDK"
    5.  
    6. namespace game {
    7.     export class TestPhoton extends Photon.LoadBalancing.LoadBalancingClient {
    8.  
    9.     }
    10. }
    11.