Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 /
This question was closed Oct 10, 2014 at 02:14 AM by Kirbyrawr for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Kirbyrawr · Jul 29, 2012 at 02:30 AM · androidmenulanguages

Language menu problem

Hi , this is my first time on unity answers.

Here is my code:

 #pragma strict
 var customGuiStyle : GUIStyle;
 var customGuiStyle2 : GUIStyle;
 var Menu : Menu;
 var tex1 : Texture;
 var Opciones : Opciones;
 var Ayuda : Ayuda;
 var Desenfoque : GameObject;
 var exit : Texture;
  
 Desenfoque.active = false;
 print (Application.systemLanguage);
 function OnGUI () {
 GUI.Box (Rect (0,0,256,30),"Lg  " + Application.systemLanguage.ToString());
 if (Application.systemLanguage.Spanish){
  if (Screen.width == 480 && Screen.height == 320){ 
  GUI.Box (Rect (150,2,256,100), tex1, customGuiStyle2);
  if (GUI.Button (Rect (350,255,128,64), "Ayuda", customGuiStyle)) {
  
  Menu.enabled = false;
  Opciones.enabled = false;
  Ayuda.enabled =true;
  }
  if (GUI.Button (Rect (350,185,128,64), "Opciones", customGuiStyle)) {
  
  Menu.enabled = false;
  Opciones.enabled = true;
  
  }
  if (GUI.Button (Rect (350,115,128,64), "Nuevo", customGuiStyle)) {
  Application.LoadLevel (1); 
  }
  
  if (GUI.Button (Rect (350,45,128,64), "Continuar", customGuiStyle)) {
  Application.LoadLevel ("fk");
  }
  
  
  
  
  }
  
  else if (Screen.width == 800 && Screen.height == 480){ 
  GUI.Box (Rect (250,2,256,128), tex1, customGuiStyle2);
  if (GUI.Button (Rect (600,255,128,64), "Ayuda", customGuiStyle)) {
  Menu.enabled = false;
  Opciones.enabled = false;
  Ayuda.enabled =true;
  }
  if (GUI.Button (Rect (600,185,128,64), "Opciones", customGuiStyle)) {
  
  Menu.enabled = false;
  Opciones.enabled = true;
  
  }
  if (GUI.Button (Rect (600,115,128,64), "Nuevo", customGuiStyle)) {
  Application.LoadLevel (1); 
  }
  
  if (GUI.Button (Rect (600,45,128,64), "Continuar", customGuiStyle)) {
  Application.LoadLevel ("fk");
  }
  
  
  
  
  }
  else if (Screen.width +800 && Screen.height +480){ 
  GUI.Box (Rect (400,2,256,128), tex1, customGuiStyle2);
  if (GUI.Button (Rect (710,255,128,64), "Ayuda", customGuiStyle)) {
  Menu.enabled = false;
  Opciones.enabled = false;
  Ayuda.enabled =true;
  }
  if (GUI.Button (Rect (710,185,128,64), "Opciones", customGuiStyle)) {
  
  Menu.enabled = false;
  Opciones.enabled = true;
  }
  if (GUI.Button (Rect (710,115,128,64),"Nuevo", customGuiStyle)) {
  Application.LoadLevel (1); 
  }
  
  if (GUI.Button (Rect (710,45,128,64), "Continuar", customGuiStyle)) {
  Application.LoadLevel ("fk");
  
 }
 }
 else if (Application.systemLanguage.English){
  if (Screen.width == 480 && Screen.height == 320){ 
  GUI.Box (Rect (150,2,256,100), tex1, customGuiStyle2);
  if (GUI.Button (Rect (350,255,128,64), "Help", customGuiStyle)) {
  Menu.enabled = false;
  Opciones.enabled = false;
  Ayuda.enabled =true;
  }
  if (GUI.Button (Rect (350,185,128,64), "Settings", customGuiStyle)) {
  Menu.enabled = false;
  Opciones.enabled = true;
  
  }
  if (GUI.Button (Rect (350,115,128,64), "New", customGuiStyle)) {
  Application.LoadLevel (1); 
  }
  
  if (GUI.Button (Rect (350,45,128,64), "Continue", customGuiStyle)) {
  Application.LoadLevel ("fk");
  }
  
  
  
  
  }
  
  else if (Screen.width == 800 && Screen.height == 480){ 
  GUI.Box (Rect (250,2,256,128), tex1, customGuiStyle2);
  if (GUI.Button (Rect (600,255,128,64), "Help", customGuiStyle)) {
  Menu.enabled = false;
  Opciones.enabled = false;
  Ayuda.enabled =true;
  }
  if (GUI.Button (Rect (600,185,128,64), "Settings", customGuiStyle)) {
  
  Menu.enabled = false;
  Opciones.enabled = true;
  
  }
  if (GUI.Button (Rect (600,115,128,64), "New", customGuiStyle)) {
  Application.LoadLevel (1); 
  }
  
  if (GUI.Button (Rect (600,45,128,64), "Continue", customGuiStyle)) {
  Application.LoadLevel ("fk");
  }
  
  
  
  
  }
  else if (Screen.width +800 && Screen.height +480){ 
  GUI.Box (Rect (400,2,256,128), tex1, customGuiStyle2);
  if (GUI.Button (Rect (710,255,128,64), "Help", customGuiStyle)) {
  Menu.enabled = false;
  Opciones.enabled = false;
  Ayuda.enabled = true;
  }
  if (GUI.Button (Rect (710,185,128,64), "Settings", customGuiStyle)) {
  Menu.enabled = false;
  Opciones.enabled = true;
  
  }
  if (GUI.Button (Rect (710,115,128,64), "New", customGuiStyle)) {
  Application.LoadLevel (1); 
  }
  
  if (GUI.Button (Rect (710,45,128,64), "Continue", customGuiStyle)) {
  Application.LoadLevel ("fk");
  
  
  } 
 }
 }
 }
 }

The problem is i can get english work Thanks

Comment
Add comment · Show 6
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 Seth-Bergman · Jul 29, 2012 at 03:58 AM 0
Share

I formatted your code for you, so others can read it:)

next time be sure and select all the code, and hit the "010101" button to format it

avatar image Kirbyrawr · Jul 29, 2012 at 04:05 AM 0
Share

Thanks sir ^^

avatar image Seth-Bergman · Jul 29, 2012 at 04:16 AM 0
Share

what's with this line:

else if (Screen.width +800 && Screen.height +480){

doesn't look right. what is this meant to check?

avatar image Kirbyrawr · Jul 29, 2012 at 04:19 AM 0
Share

This is for devices likes tablets or galaxy nexus, resolutions up to this numbers it works Pd: Thanks for reply and waste your time on my script

avatar image Seth-Bergman · Jul 29, 2012 at 04:40 AM 0
Share

cool thx for the info, didn't know that:)

Show more comments

1 Reply

  • Sort: 
avatar image
1
Best Answer

Answer by Seth-Bergman · Jul 29, 2012 at 04:22 AM

what's with this line:

else if (Screen.width +800 && Screen.height +480){

doesn't look right. what is this meant to check?

either way, your brackets are wrong, the Engish part is inside the spanish part, add a bracket here like this:

  if (GUI.Button (Rect (710,45,128,64), "Continuar", customGuiStyle)) {
  Application.LoadLevel ("fk");
 }
 }
 }    // add bracket here
 else if (Application.systemLanguage.English){

and get rid of one at the end :)

EDIT:

make sure you saved, this is DEFINITELY an issue.

if you do this, all of the buttons with spanish are enclosed in the if statement:

if (Application.systemLanguage.Spanish){

but maybe the other problem is you should say

if (Application.systemLanguage == SystemLanguage.Spanish){

since it's an enum, this is how you should compare, I think

Comment
Add comment · Show 2 · 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 Seth-Bergman · Jul 29, 2012 at 04:45 AM 0
Share

see my edit

avatar image Kirbyrawr · Jul 29, 2012 at 04:49 AM 0
Share

You save my life sir , you are awesome , many thanks ^w^

Have a nice day :)

Follow this Question

Answers Answers and Comments

6 People are following this question.

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

Related Questions

Pause Menu Not Pausing 3 Answers

Create Android Menu Item (3 vertical dots and Back Arrow button) 0 Answers

Android Button Text 1 Answer

Changing level on Android 3 Answers

Whats the best way to implement different languages? 2 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