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.
  2. Dismiss Notice

Monobehavior::GetInstance() is null, when use AssetBundle, what's the F*** problem

Discussion in 'Editor & General Support' started by ming871, Jul 29, 2014.

  1. ming871

    ming871

    Joined:
    Dec 24, 2012
    Posts:
    7
    Monobehavior::GetInstance() is null, when use lots of little downloaded AssetBundle, what's the F*** problem, the AssetBundle System is so rough so hard to use,And can not relate to "Resources" folder assets,

    Please don't you only focus on marketing, if you open the problems existing in the Unity, the developers will save a lot of time. In AssetBundle we spent more than two weeks to create a flexible DLC systems, but in the end because of the damn AssetBundle implementation, F U C K.
     
    Last edited by a moderator: Jul 29, 2014
  2. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Is this on iOS? If so the lack of script support in asset bundle is pretty well documented.

    PS - calm down. People here don't often respond to ragey posts. You are not the only frustrated person in the world.
     
  3. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah you've been turned pink on account of colourful language. If you want to try and focus and be constructive we can try and help you.
     
  4. ming871

    ming871

    Joined:
    Dec 24, 2012
    Posts:
    7
    The following is my suggestion:
    1.You can consider integrating Resources and the AssetBundle asset, let they can reference each other, reduce resource redundancy repeat;
    2. Provide more BuildAssetBundleOptions option, or to provide more of the underlying interface, can finish the work by the developer;
    3. Solve the problems existing in the Assetbundle, such as: the sky boxes, Sharder lost;
    4. Packing and loading process fully automated, automatic judge resource dependency, the Resources and the Resources in the AssetBundle can mutual reference;

    Other systems advice:
    1.Improve the basic system, such as: network,performance,UI (we will test uGUI)
    2.Server - client mode deployment and implementation approach, the server provides a game contains common function integration, such as: physics, NavMesh, attribute synchronization;
    3.Increased investment in mobile, mobile is the future, other platforms can use is ok;
    4.More perfect document, I don't think the document is good, when there is some bugs, it may become misleading.

    Unity is very good, I hope it become more outstanding, because we need more attention to our products, rather than technology.
     
  5. ming871

    ming871

    Joined:
    Dec 24, 2012
    Posts:
    7
    Yes, on ios
     
  6. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Yeah, you can't include script code in asset bundles on iOS. Well, you can, but they are just text files. It doesn't really matter because including executable code in DLC is a violation of the iOS Developer Agreement and Apple could ban your app if they found it. There are some other threads here about iOS DLC strategies that might help.
     
  7. ming871

    ming871

    Joined:
    Dec 24, 2012
    Posts:
    7
    Thank you for your reply! We use BuildAssetBundleOptions.CollectDependencies,BuildAssetBundleOptions.CompleteAssets,BuildAssetBundleOptions.DeterministicAssetBundle,BuildAssetBundleOptions.UncompressedAssetBundle to build AssetBundle and each asset bundle for each asset, so we generate many assetbundle files. We deal with the dependencies as a complex tree, build and load according to this, we load them with AssetBundle.CreateFromFile and get asset with AssetBundle.mainAsset, follow the document this is OK? right?
     
    Last edited: Jul 30, 2014
  8. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Here's the relevant doc. Note that scripts have to be precompiled and loaded using reflection, but there is no reflection on iOS, ergo no scripts in asset bundles on iOS.
     
  9. ming871

    ming871

    Joined:
    Dec 24, 2012
    Posts:
    7
    I have readed this doc page several times, and our script is just in main app, not with AssetBundle, and there are dll or precompiled dll library build to or load as AssetBundle. IOS works only with AOT,can not use reflection. if we want to download script from server, we will use lua with LuaInterface rather than dll.

    Thank you for tracking this thread
     
  10. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    I'm not sure that .NET dll's can be included in Asset Bundles either since they are not fully precompiled as they need to be on iOS. If I'm wrong, then please let me know, but that's maybe why you are getting the MonoBehavior::GetInstance() issue.

    Lastly, even downloading precompiled dlls or Lua script is technically a violation of the Apple Dev Agreement, which broadly prohibits downloading anything "executable" outside the IPA. Probably other folks do this and probably they won't catch you, but FYI.
     
  11. ming871

    ming871

    Joined:
    Dec 24, 2012
    Posts:
    7
    Thank you very much! May be it's reason raising the error, but in our game there is no downloaded script in any form, will asset bundle contain not precompiled c# script automatically when build it?
     
  12. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    You have to remove everything from the asset bundle that contains any script in any form.
    C#/JS scripts -> Not allowed in asset bundles
    C#/JS scripts as text Assets -> Can not be used because Reflections are missing.
    Dlls/ native plugins -> Can not be loaded from asset bundles.

    Overall like MakeCodeNow said Apple does not allow you to load any code outside of the ipa for security reasons.

    Just include the new scripts in a update and you can still load the art assets in a asset bundle for later download.