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
0
Question by Dok101 · May 08, 2014 at 08:34 PM · javascriptguigui-buttonscripterrorguilayer

help with errors

Hello In one of my scripts I keep getting the errors BCE0023: No appropriate version of 'UnityEngine.GUI.Button' for the argument list '(UnityEngine.Rect, System.Type)' was found. and BCE0023: No appropriate version of 'UnityEngine.GUI.Label' for the argument list '(UnityEngine.Rect, String, System.Type)' was found. Here is my code

  #pragma strict
         var Friendly_Race = Texture;
         var League = Texture;
         var Tournament = Texture;
         var One_on_One = Texture;
         var Time_Lap = Texture;
         var Stats = Texture;
         var money_GUI_Style = GUIStyle;
         var smaller_option_GUI_Style = GUIStyle;
         var two_smaller_option_GUI_Style = GUIStyle;
         var Career_GUI_Skin = GUISkin;
         
         
         
         function Start () {
     var career : Career_Variables = Career_Variables.GetComponent(Career_Variables);
         }
         
         function Update () {
     
         }
         
         function OnGUI()
         {
                         
             GUI.Label(new Rect(605, 8, 20, 20),  Career_Variables.money.ToString(), money_GUI_Style);
             GUI.Label(new Rect(850, 100, 20, 20),  Career_Variables.Races_Completed.ToString(), smaller_option_GUI_Style);
             GUI.Label(new Rect(1155, 100, 20, 20),  Career_Variables.Fame.ToString(), two_smaller_option_GUI_Style);
             GUI.Label(new Rect(1319, 140, 20, 20),  Career_Variables.Races_won.ToString(), two_smaller_option_GUI_Style);
     
             if (GUI.Button(new Rect(5,170,400,220), Friendly_Race))
             {
                 Application.LoadLevel ("Level Select");
                 }
             if (GUI.Button (new Rect (5,390,400,220), League))
             {
                 Application.LoadLevel ("BuySell_Cars");
                 }
             if (GUI.Button (new Rect (425,390,400,220), Tournament))
             {
                 Application.LoadLevel ("My Garage");
                 }
             if (GUI.Button(new Rect(5,170,400,220), One_on_One))
             {
                 Application.LoadLevel ("Level Select");
                 }
             if (GUI.Button (new Rect (5,390,400,220), Time_Lap))
             {
                 Application.LoadLevel ("BuySell_Cars");
                 }
             if (GUI.Button (new Rect (425,390,400,220), Stats))
             {
                 Application.LoadLevel ("My Garage");
             }
         }

The variables money, Races_Completed, Fame and Races_won are from my script Career_Variables. Im not sure if the errors are stemming from the GUI part of my script or some other part. Thank you in advance

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
4
Best Answer

Answer by matteonite · May 08, 2014 at 08:41 PM

I don't use javascript but isn't it

var League : Texture;

not an = sign?

I might be wrong.

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 Dok101 · May 08, 2014 at 08:43 PM 0
Share

Still in C# mode. Sorry I was just translating this from C# and that is the problem

avatar image
0

Answer by ForeignGod · May 08, 2014 at 08:56 PM

Remove "new" from labels

works for me

Also, as matteonite said

Change your texture variables

from = Texture; to : Texture;

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.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

make key as a button 1 Answer

Move the text in a GUI Button/Box 1 Answer

How to make the tab key to show/hide GUIlayer 1 Answer

Setting Scroll View Width GUILayout 1 Answer

[Solved]The Right way of doing PopUp 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