マウスクリックボタンをシミュレートするUnityスクリプト



Unity Script Simulate Mouse Click Button



using UnityEngine using UnityEngine.UI using System.Collections using System.Collections.Generic public class buttonTest : MonoBehaviour { public Button btn //Enter the button that needs to be simulated click at the script mount void Update () { btn.onClick.Invoke() //Simulate mouse click } }