using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class SavemapButtonTest : MonoBehaviour { // Start is called before the first frame update void Start() { this.GetComponent<Button>().onClick.AddListener(OnSavemapBtnClick); } private void OnDestroy() { this.GetComponent<Button>().onClick.RemoveListener(OnSavemapBtnClick); } private void OnSavemapBtnClick() { API_GSXR_Slam.GSXR_SaveMap(); } }