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 Apr 02, 2014 at 07:55 PM by Eric5h5 for the following reason:

Question is off-topic or not relevant

avatar image
0
Question by Geta-Ve · Apr 02, 2014 at 07:34 PM · uilogiccreationflowunderstand

Understanding UI Logic

So, a simple question, with, probably, a not so simple answer. I am really having a hard time wrapping my head around UI logic and how to approach it programmatically.

Don't get me wrong, I can create buttons, text, sliders, windows, what have you. But I am really struggling with the logic behind it all, how one flows into the next without the need for reproducing similar assets (IE score text, or buttons).

I feel like the understanding is within arms reach, but I feel so blind right now by my own ignorance. And part of that is not even knowing where to begin to search for answers (apart from simply asking here, as I am doing). I am not sure that I even know what I am asking. I have an issue, but I am not quite certain what the question actually is.

Hopefully someone can point me in the right direction.


As an aside, I have already approached my UI design from a few different angles. At first I was basing everything on button presses. Example: PlayButton does X things. Then I tried creating things functionally. Exmaple: ShowMenuScreen(); ShowHighScoreScreen(); etc. But that seemed like I would be rewriting alot of the same code for minimal change. So then I thought, alright, why not make a UI based on 2D planes. when I need a certain "screen" just instance the plane; but again I thought that would lead to alot of repetition in creation, what if I needed a certain button in multiple places?

Obviously this shows a huge lack of understanding regarding programming in general, which I don't deny, but this aspect of game creation is really eluding me right now.

So, thank you to anyone that can shed a little bit of light on the subject.

Cheers!

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 Geta-Ve · Apr 02, 2014 at 07:37 PM 0
Share

I guess I should mention that I had not approached UI via scenes, simply because I had hoped to keep everything in one scene -- the game is very small (just a test thing).

Also, this may sound silly, I had an animated background and didn't want it to change from scene to scene.

avatar image perchik · Apr 02, 2014 at 07:39 PM 0
Share

So I'm not sure what you're asking. Perhaps you can post some code that you feel is being reproduced unnecessarily?

avatar image Geta-Ve · Apr 02, 2014 at 07:51 PM 0
Share

That's the thing, code-wise I am not quite sure where to even start.

For instance, my current iteration of my game is one scene, with all my UI elements as GUIText elements and GameObjects (used with the text as buttons / colliders).

Right now to go from the Start Screen to the Play Screen, all I am doing is setting the alpha on the objects I don't / do want to see. I$$anonymous$$ hide play button, show score text.

This however I felt was a really bad way to go about UI design, since all the code for switching "scenes" is within each button, and if I had a pause, play, restart, etc buttons, that is alot of code spread out over alot of elements.

So then I had thought about having some kind of "ScreenHandler" object where I would make a function for each screen in an ON phase and an OFF phase. I$$anonymous$$ $$anonymous$$ain$$anonymous$$enuScreenON(); and $$anonymous$$ain$$anonymous$$enuScreenOFF(); The idea was that I could call each function as needed from anywhere else within my game.

However, even this seemed needlessly complicated, since I had to then reference the ScreenHandler object from alot of different places.

So, now I have stepped back and tried to re-evaluate my logic, and found that I am actually having a hard time understanding how I should approach the issue.

...

Hopefully that helps a bit with my $$anonymous$$dset, and my issue? :p Sorry!

avatar image Eric5h5 · Apr 02, 2014 at 07:55 PM 0
Share

You should post this on the forums; UnityAnswers is for specific questions that have an objective answer, and this is a discussion/debate question, which this site software can't really handle.

avatar image Geta-Ve · Apr 02, 2014 at 08:01 PM 0
Share

Fair enough.

0 Replies

  • Sort: 

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

Click an object to show its group / structure / tree ? 0 Answers

Conditionals in UI Drag and Drop? 2 Answers

Additive Flow Texture in a UI Shader 0 Answers

(Logic) Switch GameObjects With Slider Using Arrays 0 Answers

How to have set different results from same UI button 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