using System.Collections; using System.Collections.Generic; using UnityEngine; public class ButtonOperation : MonoBehaviour { [SerializeField] private PowerOffPanel m_PowerOffPanel; // Start is called before the first frame update void Start() { m_PowerOffPanel = transform.parent.parent.GetComponent(); } public void OnBtnClick() { m_PowerOffPanel.OnBtnClickEvent(this.gameObject.name); } }