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 AwesomeFaceHD · Mar 14, 2014 at 11:44 PM · c#guilistinventoryguilayout

Method is called, but GUI doesn't show up

I have a chest that is supposed to display either player inventory or the chest's inventory. The first menu has buttons to choose which of the inventories to display, when I click the buttons, it stays on the same screen, but I put a debug.log in each of them and the both get called when I click the button for them. Unless I made a stupid mistake, the menu system isn't the problem, I've been using it for months. I don't know what is though. I would really appreciate some help with this, it's driving me crazy.

Here is the chest script: http://pastebin.com/NvwBPtdU

Here is the inventory script that it relies on: http://pastebin.com/6UkaqgfL

And here is the item script that they both rely on: http://pastebin.com/DcwUtMBs

The places to look in the chest script are InvChest() and InvMine()

Also, sorry for posting whole scripts, I just don't know where the problem is being caused from.

Comment
Add comment · Show 2
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 VioKyma · Mar 15, 2014 at 12:21 AM 1
Share

Going through your code, I spotted something see$$anonymous$$gly unrelated to your problem, but thought I would mention it. In the Chest class, canClick is never set to false again:

 void OnTriggerEnter(Collider other) {
         canClick = true;
     }
  
     void OnTriggerExit(Collider other){
         canClick = true;
     }
avatar image AwesomeFaceHD · Mar 15, 2014 at 12:38 AM 0
Share

Whoops, thanks for that.

1 Reply

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

Answer by VioKyma · Mar 15, 2014 at 12:28 AM

The actual problem seems to be here:

 if(open == true) {
             currentMenu = "Sel";
             player.GetComponent<FirstPersonController>().enabled = false;
                         //player.GetComponent<BasicSettings>().enabled = false;
 }

It will always set it back to "Sel" each time an Update occurs.

Maybe set the if statement to something like:

     if(open == true && currentMenu == "") {

So it will only set it if the menu is not currently open.

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 AwesomeFaceHD · Mar 15, 2014 at 12:42 AM 0
Share

Ah, I didn't even think about that. Thank you, it works now.

avatar image VioKyma · Mar 15, 2014 at 12:52 AM 1
Share

No problem, glad I could help :)

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

21 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

Related Questions

Using an On-Screen GUI Button to show a GUI? 1 Answer

Help with GUILayout and tooltip(C#) 1 Answer

GUI.Button is acting funky. 2 Answers

Staggering buttons with GUI.SelectionGrid 1 Answer

ScrollWindow AutoUpdating value help :( 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