using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; /// /// UI交付的时候左右脚本反了 /// public class UI_FailureOptionsLeft : MonoBehaviour { public UI_FaultSelectionRegistrationPanel mainPanel; public void DeleteSelected() { UI_FaultSituationL2Btn[] faultTogs = GameObject.FindObjectsOfType(); foreach (var item in faultTogs) { if (this.gameObject.name.Equals(item.gameObject.name)) { Toggle tog = item.GetComponent(); tog.isOn = false; break; } } if (gameObject != null) GameObject.DestroyImmediate(gameObject); mainPanel.ResetL2FaultLimitationBySelected(); } // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } }