• 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
0
Question by Incindiary gamer · Nov 18, 2014 at 02:34 AM · compiler-error

Assets/6by7/ProGrids/Scripts/Editor/ProGrids_GUI.js(163,1): BCE0044: expecting EOF, found '}'.

I need to find this, please help, this is the last compiler error on my program. Please help! Full code:

import System.Reflection;

class ProGrids_GUI extends ProGrids_Base { @MenuItem("Window/6by7/ProGrids (v1.5.1, Free)") static function Initialize() { var window = GetWindow(ProGrids_GUI, false, "Grid"); window.Show(); }

 function OnEnable()
 {
     InitProGrids();
     OnSelectionChange();
 }

 function OnDisable()
 {
     pb_ToggleSnapToGrid(false);
 }

 function InitProGrids()
 {
     if(GameObject.Find("_grid")) //if a scene manager is present, connect to it and Rebuild()
     {
         proGrids = GameObject.Find("_grid").GetComponent(ProGrids);
         SyncToLocalGrid();
     }
     else //if no scene manager was fount, create a new scene manager
     {
         var proGridsObject = Instantiate((Resources.LoadAssetAtPath("Assets/6by7/ProGrids/_grid.prefab", typeof(GameObject))), Vector3(-1,0,0), Quaternion.identity);
         proGridsObject.name = "_grid";
         proGrids = proGridsObject.GetComponent(ProGrids);
         
         //set hide flags
         //var baseHideFlags = HideFlags.NotEditable;
         //proGridsObject.hideFlags = baseHideFlags;
         
         //sync up
         SyncToLocalGrid();
     }

     pb_ToggleSnapToGrid(proGrids.snapToGrid);

     toggleSnapGraphic = snapOnGraphic;
     toggleVisGraphic = visOnGraphic;
     toggleAnglesGraphic = anglesOnGraphic;
     
     snapSizeGraphic = (Resources.LoadAssetAtPath("Assets/6by7/Shared/GUI/icon_GridSize.tga", typeof(Object)));
 }
 
 function OnGUI()
 {
     //pull in correct skin for Unity version...must be a better way, but this is it for now!    
     #if UNITY_3_5
         mySkin = (Resources.LoadAssetAtPath("Assets/6by7/Shared/GUI/CustomSkin_Unity3.guiskin", typeof(Object)));
     #endif
     //
     
     var window = this;
     window.minSize = Vector2(46,205);
     window.maxSize = Vector2(46,205);
     
     if(!proGrids)
     {
         InitProGrids();
     }
     
     if(proGrids)
     {
         var stg : boolean = proGrids.snapToGrid;
         var sgl : boolean = proGrids.showGrid;
         
         GUI.skin = mySkin;
         EditorGUI.BeginChangeCheck();
             
         EditorGUILayout.BeginVertical();    
         GUILayout.Space(4);
         
         //snap on/off toggle
         if(GUILayout.Button(GUIContent(toggleSnapGraphic, "Toggle Snapping On/Off")))
         {
             proGrids.snapToGrid = !proGrids.snapToGrid;
             lastActiveTransform = null;

             if(proGrids.snapToGrid)
                 toggleSnapGraphic = snapOnGraphic;
             else
                 toggleSnapGraphic = snapOffGraphic;
             
             SceneView.RepaintAll();
         }

         //show grids on/off toggle
         if(GUILayout.Button(GUIContent(toggleVisGraphic, "Toggle Grid Visibility On/Off")))
         {
             proGrids.showGrid = !proGrids.showGrid;
             if(proGrids.showGrid)
                 toggleVisGraphic = visOnGraphic;
             else
                 toggleVisGraphic = visOffGraphic;
             
             SceneView.RepaintAll();
         }
         
         //snap selected button
         //if(GUILayout.Button(GUIContent(snapSelectedGraphic, "Snap All Selected items to Nearest Grid Point")))
         //{
         //    EditorUtility.DisplayDialog("Snap Selected", "You can instantly snap all selected objects to the grid. Sorry, not available in the Free Version.", "Okay");
         //}            
         
         //snap size
         if(GUILayout.Button(GUIContent(snapSizeGraphic as UnityEngine.Texture, "Change the Grid Size and Units")))
         {
             EditorUtility.DisplayDialog("Grid Size and Units", "Grid size and units are adjustable at any time! Meters, Centimeters, Feet, and Inches are available. Sorry, not available in the Free Version.", "Okay");
         }

         //show angles on/off toggle
         if(GUILayout.Button(GUIContent(anglesOffGraphic as UnityEngine.Texture, "Toggle Angles Visibility On/Off")))
         {
             EditorUtility.DisplayDialog("Angle Guidelines", "You can view handy Angle Guidelines for precise construction. Sorry, not available in the Free Version.", "Okay");
         };
         }

         //show angles on/off toggle
         if(GUILayout.Button(GUIContent(anglesOffGraphic, "Toggle Angles Visibility On/Off")))
         {
             EditorUtility.DisplayDialog("Angle Guidelines", "You can view handy Angle Guidelines for precise construction. Sorry, not available in the Free Version.", "Okay");
         }
         
         EditorGUILayout.EndVertical();

         //check for changes and apply as needed
         if(EditorGUI.EndChangeCheck ()) 
         {    
             if(Selection.transforms.Length > 0)
                 FindNearestSnapPos(Selection.transforms[0].position);
             else
                 FindNearestSnapPos(Vector3(0,0,0));

             proGrids.gridCenterPos = nearestSnapPos;
             
             pb_ToggleSnapToGrid(proGrids.snapToGrid);

             SceneView.RepaintAll();
         }
         
         //check if snap has been turned on/off
         if(stg != proGrids.snapToGrid)
         {
             SetupSelectionForSnap();

             pb_ToggleSnapToGrid(proGrids.snapToGrid);
         }
     }
 }

 function OnSelectionChange()
 {
     pb_ToggleSnapToGrid(proGrids.snapToGrid);
 }

}

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by robertbu · Nov 18, 2014 at 02:36 AM

The '}' on line 146 closes the 'ProGrids_GUI' class. So the 'OnSelectionChange()' function is outside the class and the '}' on line 152 is extra. If I had to guess, I'd say that the OnSelectionChange() belongs in the class, so the '}' on line 146 should be deleted.

Note that in Monodevelop, if you put your cursor at a bracket, the matching bracket is highlighted. This can be helpful in figure out matching bracket problems like this one.

Comment
Add comment · 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
0

Answer by Bunny83 · Nov 18, 2014 at 02:42 AM

Line 112 and 113 looks like the cause of your problem...

There should only be one "}"

Comment
Add comment · 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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Unity 3d 4.6.f3 Could not find Csharp Compiler. Please help me? 1 Answer

"All compiler errors have to be fixed before you can enter playmode!" 1 Answer

every .js code makes error in compilation 0 Answers

Command/ClientRpc with generic parameter 0 Answers

Error building Player: Extracting referenced dlls failed. 8 Answers


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