Version: 2017.1

Selectable.FindSelectableOnRight

切换到手册
public UI.Selectable FindSelectableOnRight ();

返回

Selectable 位于当前对象右侧的 Selectable 对象。

描述

查找此对象右侧的可选择对象。

using UnityEngine;
using System.Collections;
using UnityEngine.UI; // required when using UI elements in scripts

public class ExampleClass : MonoBehaviour { public Button btnMain;

public void Start() { //Finds and assigns the selectable to the Right of the main button. Selectable newSelectable = btnMain.FindSelectableOnRight();

Debug.Log(newSelectable.name); } }