public bool IsHas4Dianding() { for (int i = DiandingList.Count - 1; i >= 0; i--) { if (DiandingList[i] && !DiandingList[i].activeSelf) { DiandingList.Remove(DiandingList[i]); } } if (DiandingList.Count < 3) { return(false); } //for (int i = DiandingList.Count - 1; i >= 0; i--) //{ // if (DiandingList[i] == null) return false; // if (!DiandingList[i].activeSelf) // { // DiandingList.Remove(DiandingList[i]); // return false; // } //} return(true); }
private void RemoveDieDiandingInList() { for (int i = DiandingList.Count - 1; i >= 0; i--) { if (DiandingList[i] == null || !DiandingList[i].activeSelf) { DiandingList.Remove(DiandingList[i]); } } }