Search Issue Tracker

Fixed in 2017.2.X

Votes

56

Found in

5.6.0b9

Issue ID

882791

Regression

Yes

Editor crashes when adding text component to game object in play mode via the script

UI

-

How to reproduce:
1. Open the attached project
2. Open and play ExampleScene
Result: Editor freezes and crashes after some time

Note: crash log is not generated. If one comments this part uiText = uiTextGameObject.AddComponent<Text>(); from DrawableLabel.cs line 96 project doesn't crash. it somehow forces the OnDisabled Unity message fire up for the AFPSCounter.cs MonoBehaviour. It leads to the infinite cycle of the OnDisable \ OnEnable messages

Reproducible: 5.6.0b8, 5.6.0b10
Not reproducible: 5.6.0b7

Comments (6)

  1. jiuer7845

    Mar 27, 2020 13:06

    http://www.supplyyeezy.us.com/ Yeezy Supply
    http://www.pandorabijouxfr.fr/ Pandora
    http://www.yeezyadidas.fr/ Yeezy
    http://www.airforce1.de/ Air Force 1
    http://www.nikeairforce1.de/ Nike Air Force 1
    http://www.nikeairmax270.de/ Nike Air Max 270
    http://www.kobebryant-jersey.us/ Kobe Bryant Jersey
    http://www.kobebryantjerseysforsale.us/ Kobe Bryant Jerseys For Sale
    http://www.kobebryantjersey24.us/ Kobe Bryant Jersey 24
    http://www.kobebryantwebsiteofficial.us/ Kobe Bryant Website Official
    http://www.pandorasoldes2020.fr/ Pandora Bijoux
    http://www.yeezy-shoe.us.com/ Yeezy
    http://www.yeezymafia.us.com/ Yeezy
    http://www.supplyyeezy.us.com/ Yeezy Shoes
    http://www.nikeshoes.us.org/ Nike Shoes
    http://www.nfl-jerseys.us.org/ NFL Jerseys
    http://www.yeezyboost350.us.com/ Yeezy Boost 350
    http://www.yeezy350.us.com/ Yeezy
    http://www.yeezy-shoes.in.net/ Yeezy Shoes
    http://www.yeezys.me.uk/ Yeezy
    http://www.yeezy-350.org.uk/ Yeezy
    http://www.yeezy350.org.uk/ Yeezy 350
    http://www.yeezys.us.com/ Yeezy
    http://www.yeezy.com.co/ Yeezy Shoes
    http://www.adidasyeezy.us.com/ Adidas Yeezy
    http://www.yeezy700.org.uk/ Yeezy 700
    http://www.yeezyboost350v2.de/ Yeezy Boost 350 V2
    http://www.nikeoutletstoreonlineshopping.us/ Nike Outlet
    http://www.yeezy-shoes.in.net/ Yeezy Shoes
    http://www.mlbshop.us.com/ MLB Shop
    http://www.adidasyeezy.de/ Adidas Yeezy
    http://www.mlbjerseys.us.com/ MLB Jerseys
    http://www.yeezy380.us/ Yeezy 380
    http://www.yeezy380.us.com/ Yeezy 380
    http://www.nikefactory.us.com/ Nike Outlet
    http://www.humanraces.us.com/ Human Races
    http://www.humanracesshoes.us/ Human Race Shoes
    http://www.uggs-officialsite.org/ Uggs Official Site
    http://www.pandoraonline-shop.de/ Pandora
    http://www.basketball-jerseys.us.com/ Basketball Jerseys
    http://www.jerseysbasketball.us/ Basketball Jerseys
    http://www.jerseys-nba.us/ Cheap NBA Jerseys
    http://www.nikes-shoes.us.com/ Nike Outlet
    http://www.pandoraoutletcanada.ca/ Pandora Canada
    http://www.pandora-charms.org/ Pandora Charms
    http://www.jewelrypandora.org/ Pandora Jewelry
    http://www.pandora-outlet.us.org/ Pandora Outlet
    http://www.pandorajewelryofficialwebsite.us.com/ Pandora Jewelry Official Site
    http://www.mlbjerseysofficial.us.com/ MLB Jerseys
    http://www.pandoras.fr/ Pandora
    http://www.pandorabijouxfr.fr/ Pandora Bijoux
    http://www.yeezyadidas.fr/ Adidas Yeezy
    http://www.pandorasoldes2020.fr/ Pandora Soldes 2020
    http://www.yeezy-shoe.us.com/ Yeezy Shoes
    http://www.yeezymafia.us.com/ Yeezy Mafia
    ウレ

  2. Krstn

    Jun 08, 2017 07:41

    When can we expect this to be released?
    5.6.1f1 still has this bug.

  3. HarryCodder

    Apr 10, 2017 07:24

    Yeah but this workaround will not work in an Awake call because of this bug :
    https://issuetracker.unity3d.com/issues/error-when-creating-a-recttransform-component-in-an-awake-call-of-an-instantiated-monobehaviour
    The change you mentioned seems to cause a lot of UI related problems, how did it make it to so many branches ?

  4. karl_jones

    Mar 01, 2017 16:48

    We have made some changes that require us to disable and then reenable the entire transform hierarchy whenever we replace a Transform with a RectTransform. This has created the undesirable side effect of calling OnDisable/OnEnable on all scripts attached to the hierarchy. This is a behaviour that we intend to address in the future.

    There is a simple workaround for this though. The problem is caused by when we swap the transform, so a simple solution is to add a RectTransform or UI element to the GameObject on creation so that the swap does not need to be performed.

    For example
    var go = new GameObject("Canvas", typeof(RectTransform));

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.