Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

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