Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by sonofmorris · Mar 13, 2015 at 12:02 AM · build error

default parameter specifiers are not permitted

Ive been trying to build the following code that comes up with 3 of the same errors "default parameter specifiers are not permitted".

 public static void SetCameraBounds(Camera cam = null) {                   // error
     // If no Camera was passed in, use the main Camera
     if (cam == null) cam = Camera.main;
     // This makes a couple of important assumptions about the camera!:
     //   1. The camera is Orthographic
     //   2. The camera is at a rotation of R:[0,0,0]
     
     // Make Vector3s at the topLeft and bottomRight of the Screen coords
     Vector3 topLeft = new Vector3( 0, 0, 0 );
     Vector3 bottomRight = new Vector3( Screen.width, Screen.height, 0 );
     
     // Convert these to world coordinates
     Vector3 boundTLN = cam.ScreenToWorldPoint( topLeft );
     Vector3 boundBRF = cam.ScreenToWorldPoint( bottomRight );
     
     // Adjust their zs to be at the near and far Camera clipping planes
     boundTLN.z += cam.nearClipPlane;
     boundBRF.z += cam.farClipPlane;
     
     // Find the center of the Bounds
     Vector3 center = (boundTLN + boundBRF)/2f;
     _camBounds = new Bounds( center, Vector3.zero );
     // Expand _camBounds to encapsulate the extents.
     _camBounds.Encapsulate( boundTLN );
     _camBounds.Encapsulate( boundBRF );
 }
 
 // Checks to see whether the Bounds bnd are within the camBounds //error
 public static Vector3 ScreenBoundsCheck(Bounds bnd, BoundsTest test = BoundsTest.center) {
     return( BoundsInBoundsCheck( camBounds, bnd, test ) );
 }
 
 // Checks to see whether Bounds lilB are within Bounds bigB //error
 public static Vector3 BoundsInBoundsCheck( Bounds bigB, Bounds lilB, BoundsTest test = BoundsTest.onScreen ) {
     



I've already looked at the solution to the problem at http://answers.unity3d.com/questions/176305/default-parameter-specifiers-are-not-permitted.html. The solution says to go change something in the project options, but my project options is grayed out. What do i need to do to fix this?

Comment
Add comment · Show 8
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image incorrect · Mar 13, 2015 at 12:13 AM 0
Share

That absolutely sure depends on .Net version you are using to compile your project. By default in $$anonymous$$onoDevelop it is set to something like 2.0 and thus does not support default parameter specifiers which were implemented in versions 4.x, as I recall.

So if you are using $$anonymous$$onoDevelop, click on Project drop-down menu, select Assembly-CSharp Options, in Build section in left menu pick option General and set option Target framework to $$anonymous$$ono / .Net 4.5.

That should work. If it does not, probably your project did not loaded properly.

avatar image sonofmorris · Mar 13, 2015 at 12:24 AM 0
Share

I dont see Assumble-CSharp Options under project. The only paths i have are create package, active configuration, apply policy, export policy, and solution options.

avatar image incorrect · Mar 13, 2015 at 12:49 AM 0
Share
  1. When you open $$anonymous$$onoDevelop, are there any error messages appear?

  2. On the left side there should be Solution Pad, where you can see your source files. Is everything ok inside it? Can you make a screenshot of that pad?

avatar image sonofmorris · Mar 13, 2015 at 12:58 AM 0
Share

$$anonymous$$onodevelop opens without any error messages. Could it have something to do with unity? When i open unity theres an error at the bottom that says. Assets/__Scripts/Enemy.cs(16,31): error CS1525: Unexpected symbol (', expecting )', ,', ;', [', or ='

avatar image incorrect · Mar 13, 2015 at 01:07 AM 0
Share

That's just compilation error. $$anonymous$$ake a screenshot of your solution, please.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by Bunny83 · Mar 13, 2015 at 02:52 AM

You have to select your project in the Solution Pad in order to have the "Assembly-CSharp Options" button enabled. A solution can contain multiple projects. The easiest way is to select the project "Assembly-CSharp" in the solution pad and right click on it. There you will also find a button called "Options" (almost at the bottom).

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image sonofmorris · Mar 13, 2015 at 03:02 AM 0
Share

Alright that fixed it. Guess i didnt know as much as i thought. Thanks

avatar image EdgarBR · Jul 04, 2015 at 10:43 PM 0
Share

I have the same problem and i cannot solve it by changing the build settings. What can i do?

avatar image EdgarBR · Jul 04, 2015 at 10:56 PM 0
Share

Forget it. I solved it by changing the "Assembly-CSharp" , "Assembly-CSharp-Editor", "Assembly-CSharp-firstPass" and "Assembly-CSharp-Editor-firstPass" build options like its mentioned on the other comments.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How come the exe file disappears when my friend tries to run a build of my project? 1 Answer

Help building with two conflicting plugins: GameAnalytics and Google Play Services 2 Answers

Why does my Mac build to Android fail? "Unable to install apk!" 1 Answer

SetScriptingDefineSymbolsForGroup working is strange 0 Answers

Unable to create Windows x86 build. Error: "Unknown Binary Format" 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges