Ejemplo n.º 1
0
        public void DoDismemberment(Grabber grabbedBy)
        {
            if (ReplaceGrabbableWith && grabbedBy != null)
            {
                if (grabbedBy.HeldGrabbable)
                {
                    grabbedBy.HeldGrabbable.DropItem(grabbedBy, true, true);
                }

                if (ReplaceGrabbableWith)
                {
                    ReplaceGrabbableWith.SetActive(true);
                    Grabbable g = ReplaceGrabbableWith.GetComponent <Grabbable>();
                    g.transform.parent     = null;
                    g.transform.localScale = Vector3.one;
                    g.UpdateOriginalParent();

                    grabbedBy.GrabGrabbable(g);
                }
            }

            if (ShrinkBone)
            {
                ShrinkBone.localScale = Vector3.zero;
                ShrinkBone.gameObject.SetActive(false);
            }

            if (EnableOnDetach)
            {
                EnableOnDetach.SetActive(true);
            }
        }