Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Want to know the principle of converting C# to WebAssembly?

Discussion in 'Project Tiny' started by silveryw, Oct 9, 2019.

  1. silveryw

    silveryw

    Joined:
    Sep 21, 2014
    Posts:
    12
    Blazor? Mono wasm?
     
  2. kevinmv

    kevinmv

    Unity Technologies

    Joined:
    Nov 15, 2018
    Posts:
    51
    Broadly speaking, the build pipeline to output WebAssembly used today is,
    c# source files → Rosyln c# compiler→ IL2cpp emscripten → WASM/ASMJS output files.

    Hope this helps,
    Kev
     
    Antypodish likes this.
  3. egonaraujo

    egonaraujo

    Joined:
    Jan 21, 2015
    Posts:
    18
    Is it possible to control the emscripten configuration?
    My idea is to add/change some lines so I would be able to call JS functions from my C#..
    Maybe I could have some headers that both C# and emscripen will look for when building the end file...
     
  4. silveryw

    silveryw

    Joined:
    Sep 21, 2014
    Posts:
    12
    Thank you, I thought it was:
    c# source files → Mono → LLVM IR → emscripten → WASM/ASMJS
     
  5. yossi_horowitz_artie

    yossi_horowitz_artie

    Joined:
    Jan 30, 2019
    Posts:
    87
    One of the sample projects that comes with Tiny (as well as the source for the Tiny engine itself) show calls from C# code to both Javascript and C++.
     
    egonaraujo likes this.