Last active
December 13, 2018 15:34
-
-
Save unitycoder/10805d820bea9f78259e to your computer and use it in GitHub Desktop.
Revisions
-
unitycoder revised this gist
Dec 13, 2018 . 1 changed file with 9 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,17 @@ using UnityEngine; using UnityEngine.UI; // makes button selected at Start (to force Highlighted color on it) // this is required to allow pressing Fire / Submit key to press button (without having to select button first) public class InitButton : MonoBehaviour { void Start () { if (GetComponent<Button>()) { GetComponent<Button>().Select(); Destroy(this); } } } -
unitycoder created this gist
Aug 8, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ using UnityEngine; using System.Collections; using UnityEngine.UI; public class InitButton : MonoBehaviour { void Start () { // now you can press fire on xbox controller to select this button GetComponent<Button>().Select(); Destroy(this); } }