public void RecycleUFO() { for (int i = 0; i < ufos.Count; i++) { if (ufos[i].transform.position.z < -18) { ufoFactory.FreeUFO(ufos[i]); ufos.Remove(ufos[i]); } } }
public bool RoundStop() { if (round > 3) { start = false; if (Manager.IsAllFinished()) { if (ManagerofNow) { Destroy(this.gameObject.GetComponent <CCPhysisActionManager>()); } else { Destroy(this.gameObject.GetComponent <CCActionManager>()); } DF.FreeUFO(); return(true); } else { return(false); } } else { return(false); } }
public void Hit(Vector3 pos) { Ray ray = Camera.main.ScreenPointToRay(pos); RaycastHit[] hits = Physics.RaycastAll(ray); foreach (RaycastHit hit in hits) { //射线打中物体 if (hit.collider.gameObject.GetComponent <UFOData>() != null) { for (int j = 0; j < UFOFlyingList.Count; j++) { if (hit.collider.gameObject.GetInstanceID() == UFOFlyingList[j].gameObject.GetInstanceID()) { UFOFlyingList.Remove(hit.collider.gameObject); AddScore(hit.collider.gameObject); UFOfactory.FreeUFO(hit.collider.gameObject); return; } } } } }