Legacy Documentation: Version 2018.2 (Go to current version)
LanguageEnglish
  • C#

Selectable.Select

public void Select();

Description

Selects this Selectable.

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(); } }
对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答