Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by Owen Swick · Aug 13, 2011 at 01:40 PM · guierrorlerpz

How do I correct the following error on the Lerpz Tutortial GUI

The GUI Script runs but does not display the buttons correctly and gives me this error -

MissingMethodException: Method not found: 'UnityEngine.GUI.button'. Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.ProduceExtensionDispatcher () Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.Create () Boo.Lang.Runtime.RuntimeServices.DoCreateMethodDispatcher (System.Object target, System.Type targetType, System.String name, System.Object[] args) Boo.Lang.Runtime.RuntimeServices.CreateMethodDispatcher (System.Object target, System.String name, System.Object[] args) Boo.Lang.Runtime.RuntimeServices+c_AnonStorey12.<>m_6 () Boo.Lang.Runtime.DynamicDispatching.DispatcherCache.Get (Boo.Lang.Runtime.DynamicDispatching.DispatcherKey key, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object[] args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) Boo.Lang.Runtime.RuntimeServices.Invoke (System.Object target, System.String name, System.Object[] args) StartMenuGUI.OnGUI () (at Assets/StartMenuGUI.js:22)

Here is my script (The error is on line 22)-

 //Make the script also execute in edit mode
 @script ExecuteInEditMode()
 
  var gSkin : GUISkin;
  var backdrop : Texture2D;    //our backdrop image goes here.
  private var isLoading = false; //if true, we'll display the "Loading..." message.
  
  function OnGUI()
  {
      if (gSkin)
          GUI.skin = gSkin;
      else
          Debug.Log("StartMenuGUI : GUI Skin object missing!");
      
      var backgroundStyle : GUIStyle = new GUIStyle();
      backgroundStyle.normal.background = backdrop;
      GUI.Label ( Rect((Screen.width - (Screen.height * 2)) * 0.75, 0, Screen.height * 2, Screen.height), "", backgroundStyle);
      
      GUI.Label ( Rect((Screen.width/2)-197,50,400,100), "Lerpz Escapes", "mainMenuTitle");
      
      if(GUI.button( Rect((Screen.width/2)-70, Screen.height -160,140,70),"Play"))
          {
              isLoading = true;
              Application.LoadLevel("TheGame");
          }
  
  var isWebPlayer = (Application.platform == RuntimePlatform.OSXWebPlayer || Application.platform == RuntimePlatform.WindowsWebPlayer);
  if(!isWebPlayer)
      {
          if(GUI.Button( Rect((Screen.Width/2)-70, Screen.height -80,140,70), "Quit")) Application.Quit();
      }
  
  if(isLoading)
      {
      GUI.Label ( Rect((Screen.width/2)-110, (Screen.height/2) -60,400,70), "Loading...", "mainMenuTitle");
      }     
 }

If anyone can tell me what the error means and what I should be looking for to fix it that would be great.

Thank you!

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

1 Reply

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

Answer by Julien-Lynge · Aug 13, 2011 at 08:03 PM

Looks like capitalization to me :). I don't know anything about GUI.buttons, but I do know that GUI.Buttons work.

Comment
Add comment · Show 1 · 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 Owen Swick · Aug 13, 2011 at 08:53 PM 0
Share

Thank you very much NOAA_Julien!!! $$anonymous$$y GUI is up and running. This is my second attempt at a GUI, so thanks again for the look and answer!

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

2 People are following this question.

avatar image avatar image

Related Questions

Setting Scroll View Width GUILayout 1 Answer

Tracking Down GUI Errors 0 Answers

"NullReferenceException" while trying to draw a texture (C#) 1 Answer

script connection 1 Answer

LevelStatus in the 3D Platformer tutorial refuses to work(Using Unity 3.5). 0 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