📜  设置焦点 ui unity - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:20.244000             🧑  作者: Mango

代码示例2
using UnityEngine;
using UnityEngine.EventSystems;

public class MainMenu : MonoBehaviour
{
    public EventSystem eventSystem;

    public void SetSelected(GameObject setSelected)
    {
        eventSystem.SetSelectedGameObject(setSelected, null);
    }
}