/*///////////////////////////////////////////////////////////////////////////////////////////*/ /// <summary> /// fire the grapple hook /// </summary> /*///////////////////////////////////////////////////////////////////////////////////////////*/ void FireGrappleHook() { //note: this could be a problem if the target is actually at (0,0,0) if (targetPosition != Vector3.zero) { lr.enabled = true; grappleStatus = GrappleHookStatus.PULLING; UpdateDistanceToTarget(); } }
/*///////////////////////////////////////////////////////////////////////////////////////////*/ /// <summary> /// depending on status, either aim or fire the grapple hook /// </summary> /*///////////////////////////////////////////////////////////////////////////////////////////*/ public override void Shoot() { if (grappleStatus == GrappleHookStatus.AIMING) { FireGrappleHook(); } else if (grappleStatus == GrappleHookStatus.INACTIVE) { grappleStatus = GrappleHookStatus.AIMING; } }
/*///////////////////////////////////////////////////////////////////////////////////////////*/ /// <summary> /// reset the grapple status and timer so we can fire again /// </summary> /*///////////////////////////////////////////////////////////////////////////////////////////*/ void ResetGrapple() { grappleStatus = GrappleHookStatus.INACTIVE; lr.enabled = false; timer = 0; }