Search Unity

How to include a DLL in an Asset Bundle without changing the type of a DLL file?

Discussion in 'Asset Bundles' started by DiamondStudioGAMES, Dec 30, 2019.

  1. DiamondStudioGAMES

    DiamondStudioGAMES

    Joined:
    Sep 20, 2019
    Posts:
    16
    Hello!

    My question is this: when I try to push Dll into the Asset Bundle, I get an error:
    Unrecognized assets cannot be included in Asset Bundle: /Assets/res/lol.dll

    Help, but don’t write how to change the type of a DLL file to .bytes for me this does not work.

    THANKS so much in advance for your reply!
     
  2. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    A dll is not a valid Unity asset, so you cannot have them in asset bundles. How were you even planning on loading it?
     
  3. DiamondStudioGAMES

    DiamondStudioGAMES

    Joined:
    Sep 20, 2019
    Posts:
    16
    Where I can edit Unity source code to make dll valid asset? Or where are c++ code of Unity?
     
  4. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    Unity source code is only available if you pay them lots of money.

    Anyway: what is it you're trying to do? Because no platform would be able to load a DLL from inside an asset bundle even if you made it a valid asset. Is this for a mobile game?
     
  5. DiamondStudioGAMES

    DiamondStudioGAMES

    Joined:
    Sep 20, 2019
    Posts:
    16
    Yes
     
  6. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    I'm assuming that you hace a C# dll you want to update via the internet from inside your game. That's not really possible. Maybe, with lots of hacks, you could get that to work on Android, because it still supports Mono JIT, but it would not work on IOS because you can only use IL2CPP (where all your C# code is converted to C++ and compiled into a native executable during build), so there's no support for loading code that is downloaded by the app itself.

    If you want to update code, there no other way, you need to make a new build of your game.