Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Replicating Unity Launcher functionalities in Options menu?

Discussion in 'General Discussion' started by darkhog, Dec 7, 2014.

  1. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    As you know, Unity launcher just sucks. It's ugly (if it would be at least skinnable, but no...) and simply doesn't look very professional.

    So what do you need to replicate functions of the launcher in game's option menu? I.e.:

    - Getting available/changing resolution
    - Fullscreen mode
    - Key rebinding
     
  2. Brainswitch

    Brainswitch

    Joined:
    Apr 24, 2013
    Posts:
    270
    For resolution and fullscreen options, check put the Screen class.
    Key rebinding is more complicated, I recommend using an addon rather than rolling your own solution. I use Rewired which works great.
     
  3. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    Currently, the screen/detail options can be set at run-time, but you can't currently access the input settings during run-time. This is something that is likely changing, but who knows exactly when. Going by what I remember in the [official] input thread, it will be in some 5.x version, but not 5.0.

    There are some assets on the store that can help with this. Re-wired is one. But if you want one that works much like Unity's internal system, use cInput 2.0. The functions are very close to Unity's system, and it uses Unity's input system internally(adding tons of inputs to the input dialog to make it happen). But to the user that doesn't matter any. The only defect is that since it internally is using Unity's input system, it comes with whatever defects that this has, including joystick axis/button limits, etc... Rewired uses it's own system completely(as some other assets probably do too) so it gets around any of those limits. But you have to learn a new system for that, which can suck if you already have a game going.
     
  4. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    What are those functions for screen/res? As for input, I could probably cook up my own system for that. Doesn't seem too hard since Unity provides support for getting raw keys. Then it's matter of setting up lookup dictionary.
     
  5. lorenalexm

    lorenalexm

    Joined:
    Dec 14, 2012
    Posts:
    307
  6. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,490
    :D

    Once you get started you'll quickly see that Unity's system is a serious mess... Then as you dig deeper you'll discover even more problems. Take a look at Problems with Unity Input on my site for a still incomplete list of the issues.

    Rewired's API was written to be an almost effortless drop-in replacement in your code for Unity input. Instead of Input.GetButton("Fire"), you use player.GetButton("Fire"). It's really trivial to convert a game from Unity input to Rewired, but you get a ton of extra features on top that Unity and cInput just don't offer. Most users who have switched to Rewired have said the conversion process was super simple. Some have even done integrations with other packages like uFPS very quickly and easily.

    Rewired uses Unity's input manager for Webplayer and all platforms that don't have native input libraries. At this time, only Windows Standalone, OSX, and Windows App Store uses native libraries. For these platforms, Rewired uses Raw Input, Direct Input, XInput, and OSX I/O kit to get access to devices directly, meaning you have full joystick hot-plugging support, much better identification of which joystick is which, no 20 button or 11 joystick limit, and access to native features such as vibration on XInput. All other platforms, Rewired does something similar to cInput and others by adding several hundred entries into the InputManager so as to get access to all of Unity's devices. Ultimately, everything is abstracted so the developer and users don't need to worry about cross-platform issues.
     
    Last edited: Dec 18, 2014
    Brainswitch and Ryiah like this.