Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

[Case 1099297]Some scripts in b8 are broken with b9 (missing behaviour & weird component type)

Discussion in '2018.3 Beta' started by aurelien-morel-ubiant, Nov 9, 2018.

  1. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    275
    Hello guys,
    there is a nice, weird news issue in the unity 2018.3b9 build.
    We have a script on a non-prefab element in a scene which is this one (on the previous OR FIRST BETA 9 START) :
    upload_2018-11-9_14-58-38.png

    BUT when I stop my current app execution, and then I look into my hierarchy on the "UI" non-prefab element, I notice this :
    upload_2018-11-9_14-54-10.png
    and in the console I have those 2 warnings.
    upload_2018-11-9_14-54-29.png

    So my first idea was to do a Reimport as I always do in 2018.3 beta each time there is a weird missing reference issue. And this time, the warning disappear BUT the script type change to this weird thing :
    upload_2018-11-9_14-58-10.png
    And then when I press play, the 2 previous screen / patterns happen again :/

    I will try to reproduce it maybe in a little project, but as usual with those bug I don't know if it's something hard related to our project or if it's something more global that could happen in every projects.

    If we go back to Unity 2018.3b8 everything works again.
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    As far as I remember, this issue occurs if the MonoBehaviour name does not match the filename where it's located in. Means, the class "PlanCreatorUIManager" must be located in a file called "PlanCreatorUIManager.cs".

    Is this perhaps the issue?
     
  3. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    275
    I suspected this but not in the same way than you just said.
    Cause our class is in a namespace named :
    Code (CSharp):
    1. namespace Designer.PlanCreator.UI
    that's why I thought it's odd it seems the object change its name with the last namespace element (even I don't think it's due to that")
    But the class "PlanCreatorUIManager" is definietly in a script file named "PlanCreatorUIManager.cs".
    So sadly it's not the same issue.
     
    Last edited: Nov 9, 2018
  4. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    275
    @LeonhardP any news on this issue ? Cause in the actual state the b9 is just broken for us.
     
  5. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    275
    I just had a reply for your QA and they reproduced my bug. I just need to simplify it maybe in a sample project with just the scripts needed to repro and it would be good.
     
  6. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    275
    I found my issue ! One entiere afternoon !

    1. Code (CSharp):
      1. namespace Designer.PlanCreator.UI
      2. {
      3. using UnityEngine;
      4.     public class PlanCreatorUIManager : MonoBehaviour
      5.     {
      6. #if UNITY_EDITOR || !UNITY_WEBGL
      7. #endif
      8.     }
      9. }
    The issue come from the combination of namespace around a #if SOMETHING || !SOMETHING_ELSE

    An easy fix if you have the same pattern is to add parenthesis around second member :
    #if UNITY_EDITOR || (!UNITY_WEBGL)


    The placement of the #if doesn't matter.

    Even this, make it crash

    Code (CSharp):
    1. namespace Designer.PlanCreator.UI
    2. {
    3. #if UNITY_EDITOR || !UNITY_WEBGL
    4. #endif
    5. }

    I will report my ultra light project and I think it will be good !

    I think it's an issue that appeared in 2018.2.15 and that has been backported to 2018.3b9
     
    Last edited: Nov 15, 2018
    SugoiDev likes this.
  7. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    SugoiDev likes this.
  8. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    275
    @LeonhardP I found another one which is similar to this one cause it's a compiler issue on #if logic.
    So just to be sure I reported it this morning, the case number is 1104428

    This time the only thing people have to due to deal with it is if they write :
    Code (CSharp):
    1. #if(SOMETHING)
    They must replace it by the same thing but with a space between the "#if" and the "(" :
    Code (CSharp):
    1. #if (SOMETHING)
    Could you tell me if the b12 fix will impact this one or will it be a different fix in another beta version ? Thanks in advance !

    P.S : I forget to mention it but this one impact b8 not b9
     
    Last edited: Nov 27, 2018
    LeonhardP likes this.
  9. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Thanks for the report! I'll tell you as soon as I know more.
     
    aurelien-morel-ubiant likes this.
  10. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    275
    @LeonhardP it's fixed in b12 for my 2 cases with compiler trouble. But nothing is mentionned in the release notes, is it normal ? Or some bugfixes are just silent ? Which is not terrible :)
    Cause some bugs could be fixed but we can't know it without downloading and trying the version
     
  11. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Ideally, there shouldn't be silent bug fixes. It must have slipped through. We'll add it now and then re-publish the release-notes :).

    Are you sure the bug you reported yesterday is resolved for you in b12? https://issuetracker.unity3d.com/is...ith-without-a-space-after-the-number-if-logic
     
  12. aurelien-morel-ubiant

    aurelien-morel-ubiant

    Joined:
    Sep 27, 2017
    Posts:
    275
    Last edited: Nov 28, 2018
  13. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136