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 robert 1 · Feb 07, 2011 at 04:29 PM · toggle

toggle button pproblems

var ren : Renderer; // renderer material var male : Texture2D; var female : Texture2D; var a1 = 0; var myskin : GUISkin; var togglemale : boolean = false; var togglefemale : boolean = true;

function OnGUI () { GUI.skin = myskin; togglemale= GUI.Toggle(Rect(Screen.width*(4.1/6.55),Screen.height*( (4.7/6.3),Screen.width*(1.3/6.55),Screen.height*(.5/6.3)),togglemale,"MALE"); togglefemale = GUI.Toggle(Rect(Screen.width*(4.1/6.55),Screen.height*(5.7/6.3),Screen.width*(1.3/6.55),Screen.height*(.5/6.3)),togglefemale,"FEMALE");

if (togglemale== true) { ren.renderer.material.mainTexture = male; Debug.Log ("mmm"); }

if (togglefemale== true) { ren.renderer.material.mainTexture = female; Debug.Log ("fff"); }

}

i am new to unity my probelm is i am using a gui.toggle button named as MALE and FEMALE my need is when i select Male button male texture should display when i click FEMALE button female texture should display. But toggle button is not working properly .I have used renderer as cube

Comment
Add comment · Show 5
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 Uriel_96 · Feb 07, 2011 at 04:42 PM 1
Share

robert don't repeat the same question: http://answers.unity3d.com/questions/39622/toggle-button-problem , you put the same question and you already have an answer in the other question, if something is wrong you need to comment in the answer and says that it doesn't works.

avatar image Bunny83 · Feb 07, 2011 at 04:50 PM 1
Share

Right, don't ask two times the same question and use search before asking new questions. And by the way, take a look into the FAQs http://answers.unity3d.com/faq

avatar image robert 1 · Feb 07, 2011 at 05:08 PM 0
Share

i want both male and female toggle button so kindly help to sole this

avatar image robert 1 · Feb 07, 2011 at 05:13 PM 0
Share

that answer does not work for me i want both male and female toggle button to work simultanseouly

avatar image Uriel_96 · Feb 08, 2011 at 11:03 PM 0
Share

so in that answer you can comment that you want to use the both, but when there this kind of problems you don't have to put the same question.

0 Replies

· Add your reply
  • Sort: 

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

No one has followed this question yet.

Related Questions

SetActive(true) is working, SetActive(false) not 2 Answers

Toggle Group on Instantiated Toggles? 0 Answers

Toggling through music 1 Answer

GUI window popup button 1 Answer

C# MOUSE EVENT TOGGLE 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