/** * Destroys a HandModel instance if HandController.destroyHands is true (the default). * If you set destroyHands to false, you must destroy the hand instances elsewhere in your code. */ protected void DestroyHand(HandModel hand_model) { handEvent handHandler = onDestroyHand; if (handHandler != null) { handHandler(hand_model); } if (destroyHands) { Destroy(hand_model.gameObject); } else { hand_model.SetLeapHand(null); } }
/** Creates a new HandModel instance. */ protected HandModel CreateHand(Hand leap_hand, HandModel model) { HandModel hand_model = Instantiate(model, transform.position, transform.rotation) as HandModel; hand_model.gameObject.SetActive(true); Leap.Utils.IgnoreCollisions(hand_model.gameObject, gameObject); hand_model.transform.SetParent(transform); hand_model.SetLeapHand(leap_hand); hand_model.MirrorZAxis(mirrorZAxis); hand_model.SetController(this); handEvent handHandler = onCreateHand; if (handHandler != null) { handHandler(hand_model); } return(hand_model); }
/** Creates a new HandModel instance. */ protected HandModel CreateHand(Hand leap_hand, HandModel model) { HandModel hand_model = Instantiate(model, transform.position, transform.rotation) as HandModel; hand_model.gameObject.SetActive(true); Leap.Utils.IgnoreCollisions(hand_model.gameObject, gameObject); hand_model.transform.SetParent(transform); hand_model.SetLeapHand(leap_hand); hand_model.MirrorZAxis(mirrorZAxis); hand_model.SetController(this); //Marcamos con la etiqueta "Manos" para una posterior detección por colisiones hand_model.gameObject.tag = "Manos"; handEvent handHandler = onCreateHand; if (handHandler != null) { handHandler(hand_model); } return(hand_model); }