bool CheckListCurrent() { GameObject[] obj = GameObject.FindGameObjectsWithTag("MedicineGameTag"); if (obj == null) { return(false); } foreach (GameObject ob in obj) { MedicinTrigger md = ob.GetComponent <MedicinTrigger>(); if (md != null && md.medicinID == game1Manager.currentDisease) { return(true); } } return(false); }
public void CatchObject(Collider other) { MedicinTrigger pro = other.gameObject.GetComponent <MedicinTrigger>(); if (pro) { currentProductID = pro.medicinID; pro.isMove = false; other.GetComponent <Collider>().enabled = false; LeanTween.scale(other.gameObject, Vector3.zero, .5f); LeanTween.moveY(other.gameObject, other.gameObject.transform.position.y - 1, .5f); if (OnCatchingObject != null) { OnCatchingObject(pro.medicinID); } Destroy(other.gameObject, 2f); } }