Search Unity

Define a Resource but don't load it

Discussion in 'iOS and tvOS' started by bpritchard, May 31, 2012.

  1. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    I haven't done any research on this yet, but if we were to put a bunch of textures in the Resources folder, and then define them as a Texture2D on objects would they all get loaded with the level? Or can we use Resources.Load to load them when we want? This is mainly for localizing textures... since we don't want to load all the language textures for each build we do them all as resources via a path at start. but we ran into an issue w/duplicate names (there are a ton) and its requiring a different approach.
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    you actually are forced to use Resources.Load
    Anything assigned on scene objects is loaded along the scene.

    As for the path problem: put every language in a different subfolder so something like

    Resources/en-gb/xxxx
    Resource/de-de/xxxx

    then you can use the same name for xxxx without a problem