Ejemplo n.º 1
0
        // Exclude from simulation and keep object in scene
        static void FadeExclude(RayfireRigid scr)
        {
            // Set faded
            scr.fading.state = 2;

            // Not going to be reused
            if (scr.reset.action == RFReset.PostDemolitionType.DestroyWithDelay)
            {
                scr.DestroyRb(scr.physics.rigidBody);
                scr.DestroyCollider(scr.physics.meshCollider);
                scr.DestroyRigid(scr);
            }

            // Going to be reused
            else if (scr.reset.action == RFReset.PostDemolitionType.DeactivateToReset)
            {
                scr.physics.rigidBody.isKinematic = true;
                scr.physics.meshCollider.enabled  = false; // TODO CHECK CLUSTER COLLIDERS
                scr.StopAllCoroutines();
            }
        }