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

question about destroy gameobject in Addressable

Discussion in 'Addressables' started by Rocksuit, Jan 10, 2022.

  1. Rocksuit

    Rocksuit

    Joined:
    Sep 11, 2019
    Posts:
    5
    If I use the api Addressables.LoadSceneAsync to load a scene, how i destroy the gameObject belong to this scene. I means this gameObject is instantiated at the same time when the scene is loaded, it's part of the scene.
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,862
    Pretty sure you just destroy them as normal. What are you worried about exactly?
     
  3. Rocksuit

    Rocksuit

    Joined:
    Sep 11, 2019
    Posts:
    5
    I just worry about if I using the normal API GameObject.Destroy(), maybe i will break the rule to cause something asset can't unload. The document explain the reference count, the load or unload of the asset is depending on the reference count inside addressable system. I just want to make sure the which way to destroy is right.