Пример #1
0
        public void IgnoreGrabbableCollisions(Grabbable grab, bool ignorePhysics) {

            var grabColliders = grab.GetComponentsInChildren<Collider>();

            // Ignore all other hand collider
            for (int x = 0; x < grabColliders.Length; x++) {
                Collider thisGrabCollider = grabColliders[x];

                for (int y = 0; y < handColliders.Count; y++) {
                    Physics.IgnoreCollision(thisGrabCollider, handColliders[y], ignorePhysics);
                }
            }
        }
Пример #2
0
        void disableGrabbable(Grabbable grab)
        {
            if (DisableColliders)
            {
                disabledColliders = grab.GetComponentsInChildren <Collider>(false).ToList();
                for (int x = 0; x < disabledColliders.Count; x++)
                {
                    disabledColliders[x].enabled = false;
                }
            }

            // Disable the grabbable. This is picked up through a Grab Action
            grab.enabled = false;
        }
Пример #3
0
        void disableGrabbable(Grabbable grab)
        {
            if (DisableColliders)
            {
                disabledColliders = grab.GetComponentsInChildren <Collider>(false).ToList();
                foreach (var c in disabledColliders)
                {
                    c.enabled = false;
                }
            }

            // Disable the grabbable. This is picked up through a Grab Action
            grab.enabled = false;
        }
Пример #4
0
        public void AutoPopulateGrabPoints()
        {
            if (grabbable)
            {
                var newPoints = new List <Transform>();

                foreach (var gp in grabbable.GetComponentsInChildren <GrabPoint>())
                {
                    if (gp != null && gp.gameObject.activeInHierarchy)
                    {
                        newPoints.Add(gp.transform);
                    }
                }

                grabbable.GrabPoints = newPoints;
            }
        }