Example #1
0
        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));
                }
            }
        }
Example #2
0
        private IEnumerator DisableBodyCoroutine(HumanRigidBody body)
        {
            yield return(new WaitForSeconds(3));

            body.BodyEnabled = false;
        }