using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Canvas_UI : MonoBehaviour { [SerializeField] Button XuanZhuan_Btn; [SerializeField] Button ChongZhi_Btn; [SerializeField] ModelRot modelRot; // Start is called before the first frame update void Start() { XuanZhuan_Btn.onClick.AddListener(() => { modelRot.isRot = !modelRot.isRot; }); ChongZhi_Btn.onClick.AddListener(() => { modelRot.isRot = false; modelRot.ChongZhi_BtnCallBack(); }); } // Update is called once per frame void Update() { } }