using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class DelectPanel : MonoBehaviour { public Button SureButton; public Button CancelButton; public GameObject VideoItem; // Start is called before the first frame update void Start() { SureButton.onClick.AddListener(SureClick); CancelButton.onClick.AddListener(CancelClick); } private void OnDestroy() { SureButton.onClick.RemoveListener(SureClick); CancelButton.onClick.RemoveListener(CancelClick); } private void CancelClick() { gameObject.SetActive(false); } private void SureClick() { var videoData = VideoItem.GetComponent().videoData; VideoFileCtrl.Instance.DelectVideoAndUpdateJson(videoData.Url, videoData.Mode); Destroy(VideoItem); gameObject.SetActive(false); } }