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

Bug UGUI Canvas

Discussion in 'UGUI & TextMesh Pro' started by sheng2008, Jul 26, 2023.

  1. sheng2008

    sheng2008

    Joined:
    Aug 18, 2016
    Posts:
    4
    use UGUI, I Create a UI Name A .set SetParent the Canvas Name B. Other GameObject Name C.
    when I Destroy A. the A is B Child. this result is ok. Nothing exist in Memory。But, when I Change Parent to Other Object as C. A.SetParent(C). Now, Destroy A. Sprite has ManagedStaticReferences In Memory. whether this C is Canvas or Other GameObject.So. after Change Parent , What's the solution Can Clear ManagedStaticReferences
     
  2. sheng2008

    sheng2008

    Joined:
    Aug 18, 2016
    Posts:
    4
    I Hav Find New Thing, I give The A AddComponent<Canvas>().When I Change Parent To Other Object.and Destory A. this result is ok. Nothing exist in Memory. I suspect Graphics referenced By Last Canvas.whether A is Change Parent. When Destory A, Can trigger Canvas dereference function。but A Change Parent. Not Find before Canvas. so before Canvas reference A Graphics