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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question Is it possible to change the loading order of resources in a prefab?

Discussion in 'General Discussion' started by dowon951, Jun 8, 2022.

  1. dowon951

    dowon951

    Joined:
    Jun 24, 2019
    Posts:
    12
    I am using addressable.

    The X prefab has a Y material and a Z texture.
    There is an X prefab in the A bundle group. And in the B bundle group there is a Y material, n the C bundle group there is a Z texture

    Now InstantiateAsync the X prefab asynchronously.
    unity works After loading Y,Z in B,C bundle with dependencies, X is instantiated and appears in the game.

    Here is the question.
    Make the X Prefab appear on the screen first and load the material and then the texture.

    Initially, there is no material, so it will not be visible on the screen.
    After that when the material is loaded it will look white and after that the texture will be loaded and you will be able to see it for yourself.

    Is it possible?
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    6,003
    Are you using addressables? You can easily code this yourself, and I've done so with items you could drop in a survival craft game. You drop the item, which is just a game object with an empty mesh renderer and a component.

    The prefab is instantiated, the item is injected into the prefab, and it loads the mesh and material for the item via addressable references asynchronously. You can easily apply the same concept.
     
  3. dowon951

    dowon951

    Joined:
    Jun 24, 2019
    Posts:
    12
    thank you reply but
    It doesn't seem like there's a lot to be said for where to use it.
    I want to apply it to one big town scene. Manual loading with code was also considered, but the amount is too much.