void CheckInfected() { var colls = Physics.OverlapSphere(mCitizen.transform.position, CitizenMgr.MaxSafeDist); foreach (Collider co in colls) { Citizen p = co.gameObject.GetComponent <Citizen>(); if (p && (p.CitizenType == CitizenType.Ill || p.CitizenType == CitizenType.Latent)) { if (p != null && !CitizenMgr.SafeDistance(mCitizen, p)) { if (Random.Range(0.0f, 1.0f) < mCitizen.InfectRate) { mFSMSystem.TransitionFSMState(FSMTransition.Infected); return; } } } } }