Search Issue Tracker

Fixed in 4.5.X

Votes

0

Found in

4.0.0f1

Issue ID

496529

Regression

No

Combining namespaces MBs with default params break

Mono

-

1) What happened
Combining namespaces MBs with default params break

Having a default parameter value specified for a method in a mono behaviour in a namespace will result in great weirdness - including the behaviour no longer being addable to GameObjects.

2) How can we reproduce it using the example you attached.
In ImpactCamera.cs and TouchGestures.cs you'll find some TODOs around workarounds for this problem. Flip the commenting on the code involved and try adding either component to a GO.

Comments (11)

  1. felixmann

    Apr 30, 2017 06:20

    Still experiencing this on Unity 5.51f1 :(

  2. Randomman159

    Oct 31, 2015 02:30

    Currently having the issue in 5.1.3f1 on Windows 8.1

  3. ilya_ca

    Sep 29, 2014 02:32

    The issue is still present on Mac OS X.

  4. mstevenson

    Jul 08, 2014 21:48

    This issue appears to have been fixed in Unity 4.5 on Windows, however it is still easily reproducible on OS X.

  5. genail

    Apr 10, 2014 13:23

    Still present in 4.3.4.

  6. cjke.7777

    Feb 23, 2014 11:41

    Yep this is still happening. Super easy to reproduce

  7. Rob-A

    Feb 06, 2014 08:49

    "NOT" FIXED. I am still having this issue in version 4.3.1f. It even happens with scriptable objects which is just logical while this seems to be an compiler issue to me.

  8. Aurore

    Feb 03, 2014 15:41

    Just had a look at the bug, it's fixed in the next version of Unity, which is why it's marked as fixed now. We can see this isn't very clear and will try to resolve this.

  9. codestage

    Feb 03, 2014 07:44

    I'd like to add issue described here is not exactly what we see today.

    We see message:
    The class defined in script file named 'Tester' does not match the file name!
    if class Tester is placed into namespace, have method with default parameter and derives from MonoBehavior.

    Just like I described in comments here: http://issuetracker.unity3d.com/issues/a-monobehaviour-cant-be-in-a-namespace-and-have-optional-parameters-in-its-method-signature-at-the-same-time

  10. jedy

    Feb 02, 2014 19:50

    It still reproduces.

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.