Search Unity

I've made an awesome and kewl AAA in-game settings menu for Unity. Get it here completely gratis!

Discussion in 'Made With Unity' started by TwiiK, Aug 5, 2015.

  1. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729

    http://twiik.net/unity/in-game-settings-menu

    Note: I cleared the lightmap before I uploaded the project because it doubled the size of the project. So remember to bake it again when you open the project.

    Here's some of the key features:
    • Can be used with mouse, keyboard or gamepad. It probably works just fine with touch as well seeing as that is pretty much the same as a mouse.
    • Let's you choose graphics presets or customize everything just the way you want it with what I feel is the most intuitive approach I've seen in any game. The game environment is visible at all times and every setting updates immediately giving you instant feedback on what it does.
    • Every setting clearly shows what it's currently set to and what its min and max values are. No guesswork involved like in a lot of games where "Ultra" is the highest for some settings, but others just go to "High". Or games which only show the current setting with a previous/next arrow forcing you to click the next arrow for every single setting just to be sure they are maxed out, or even worse, doing so makes them loop back around to the lowest setting, arrgh.
    • The code is broken up into separate classes per graphics setting which lets you easily add new graphics settings and set their defaults per preset. I still have some more work to do here with a namespace perhaps and some other stuff, but it's a good starting point.
    • A field of view slider which clearly states that it's vertical field of view, but also shows the current horizontal field of view for your screen setup. Total Biscuit would be proud. It even goes from zero to infinity, pretty much.
    • Audio sliders for everything you want which are mapped logarithmically to the audio mixer giving you a natural volume curve from min to max.
    • Mouseover and click sounds for everything, and tick sounds when you increase/decrease the sliders.
    • Keeps track of the selected UI element. Moving your mouse pointer over an element selects it for the keyboard so pressing up on the keyboard continues from that element. Remembers which button you clicked to open a panel and selects it again when you return.
    • The scroll view can be scrolled both with a keyboard and a gamepad.
    • Includes my brightness slider image effect which is the first image effect I've ever made. It's extremely simple, but still very useful. :p
    Try it out or download the entire project from the link above. Hope you like it, and I hope you use it in one form or another in your own project. I see way too many Unity projects use the default launcher. No more, I say! Customize or go home!

    The only thing I ask in return for your time is that you critique it a bit. Both the menu itself and my code. I learned a lot of new stuff with this project and I tried even more new stuff. :)

    And last, but not least. Some questions I hope you can help me with:
    • Soft particles can't be set through script?
    • Shadow quality can't be set through script?
    • Shadows ON, soft, hard can't be set through script?
    • Do you still need a third party solution to remap controls runtime in Unity?
    Ohh, and there's a few things I made a note about when I was making this project:
    • Calling Select() on a selectable doesn't invoke OnSelect() This seems a bit odd to me.
    • Color Swap should really be an option for color transition in addition to Color Tint. I had to implement my own. A neat effect I use often in web design is to have an invisible button which turns opaque on mouseover. You can't tint something invisible. :p That's why swapping colors is preferable. And it's much easier to work with I feel. I don't know what the end result would be if I applied a red tint to a green button - brown? I would much rather have the button fade from green to red.
    • This isn't related to the UI system, but working with prefabs can be really scary. Especially if you make a lot of changes to each instance. I was considering making just the "base" of a panel into a prefab, with the content unique per instance, but then if I accidentally hit "Revert" on a panel I would lose all the content in it. My sliders, buttons etc. are instances now, but if you accidentally revert one of them you lose a lot of customization. Should perhaps be able to lock the instance or something.
     
    Last edited: Aug 5, 2015
  2. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    The scroll view seems to be completely broken in the Web Player on Mac. No idea what's that about. I've never had notable differences between Mac and Windows in Unity before. It works just like it should in the Editor on Mac, and when I build a standalone build for Mac.

    I'll check it out when I have some spare time to see if I've done something weird or stupid. If it turns out to be just a Web Player related issue I may not bother with it seeing as the Web Player will practically be gone by next month anyway.
     
  3. Kloper

    Kloper

    Joined:
    Jan 28, 2014
    Posts:
    93
    On my mac it doesn't work at all.. after I click any button the whole menu disappears.
     
  4. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    The Web Player or in the editor?
     
  5. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    Dat title though... looks great!
     
  6. Kloper

    Kloper

    Joined:
    Jan 28, 2014
    Posts:
    93
    web player
     
  7. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Hmm i might gonna use this, i loved this kind of layout menu Thanks man :)
     
  8. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
  9. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    @hippocoder Yeah, I didn't find them there. :p What I meant was if anyone knew of any workarounds for it? I mean there's plenty of released Unity titles. Surely you have to at least be able to set shadow quality in the graphics settings for those games? Like Cities Skylines for example.

    @mortos360 Ok, I was away for the weekend, but I'll have a look. There seems to be some issues with it in the Web Player on Mac.
     
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Twiik, I don't understand? That's precisely what I posted. You can change all that at run time.
     
  11. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    How? They are not listed on the page you linked to and I've "searched" for them with the autocomplete in Visual Studio without luck. :)
     
  12. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    Great work! Many thanks
     
  13. CaoMengde777

    CaoMengde777

    Joined:
    Nov 5, 2013
    Posts:
    813
    EAGLETHRUSTASTIC!!!

    lols awesome dude thanks alot!! .. this kind of thing was needed!

    hmm, is it possible to have resolution change? at runtime?
    oh and fullscreen/windowed/windowed fullscreen
    and aspect ratio

    im using this InputManager, its MIT license http://forum.unity3d.com/threads/free-custom-input-manager.223321/ ..havent really gotten around to really playing with it, but of the ones i found it seemed really nice, you can change gamepad to keyboard too during game, and supports the newUI, i guess theres some that can be better, but i like this one..

    not sure what else to consider.. if i think of anything ill say, ill have to play around with this tomorrow or so
     
    Last edited: Sep 3, 2015
  14. VertexRage

    VertexRage

    Joined:
    Dec 18, 2018
    Posts:
    69
    First, sorry for the necro...
    I recently found the post and was inspired by it to make my own custom menu. The look & feel is similar, the implementation is totally different as my settings are going beyond what unity offers (like changing different post processing or stuff like grass distance). You can view draft version of it here:


    Thank you @TwiiK for the inspiration! :)