Selects this Selectable.
#pragma strict // required when using UI elements in scripts // Required when using Event data. public var myInputField; //Do this OnClick. public function SaveGame() { //Makes the Input Field the selected UI Element. myInputField.Select(); }
using UnityEngine; using System.Collections; using UnityEngine.UI; // required when using UI elements in scripts using UnityEngine.EventSystems;// Required when using Event data.
public class ExampleClass : MonoBehaviour// required interface when using the OnSelect method. { public InputField myInputField;
//Do this OnClick. public void SaveGame() { //Makes the Input Field the selected UI Element. myInputField.Select(); } }