Selectable.FindSelectableOnLeft

Switch to Manual
public UI.Selectable FindSelectableOnLeft ();

Returns

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

Description

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

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 left of the main button. Selectable newSelectable = btnMain.FindSelectableOnLeft();

Debug.Log(newSelectable.name); } }