private void OnCollisionEnter(Collision other) { if (!isServer) { return; } HumanRigidBody humanRigidBody = other.transform.root.gameObject.GetComponent <HumanRigidBody>(); if (humanRigidBody != null && !humanRigidBody.BodyEnabled) { CleanBodyDictionary(); if (!slippedBodies.ContainsKey(humanRigidBody)) { humanRigidBody.BodyEnabled = true; slippedBodies.Add(humanRigidBody, Time.time); StartCoroutine(DisableBodyCoroutine(humanRigidBody)); } } }
private IEnumerator DisableBodyCoroutine(HumanRigidBody body) { yield return(new WaitForSeconds(3)); body.BodyEnabled = false; }