예제 #1
0
    /*void GrappleAim()
     * {
     *  if (grapplingState == GrapplingState.Normal)
     *  {
     *      GameObject close;
     *
     *      if (Physics.Raycast(cameraTransform.position, cameraTransform.forward, out grappleHit, maxDistance, whatIsGrappleable))
     *      {
     *
     *          autoAim = false;
     *          aimPoint.transform.position = grappleHit.point;
     *          aimPoint.SetActive(true);
     *          grapplePoint = grappleHit.point;
     *      }
     *      else if (playerControl.GetGrapplingAutoAimStatus() && (close = FindGrapplePoint()) != null)
     *      {
     *          // should i make it actually shoot to the player
     *
     *
     *          aimPoint.transform.position = close.transform.position;
     *          aimPoint.SetActive(true);
     *      }
     *      else
     *      {
     *          aimPoint.SetActive(false);
     *      }
     *  }
     *
     * }*/


    void StartGrapple()
    {
        if (grapplingState == GrapplingState.Normal)
        {
            GameObject close;


            if (Physics.Raycast(cameraTransform.position, cameraTransform.forward, out grappleHit, maxDistance, whatIsGrappleable))
            {
                showRope         = true;
                lr.positionCount = 2;
                //autoAim = false;
                StartGrappleHelper(grappleHit.collider.gameObject);
                grapplePoint = grappleHit.point;
            }
            else if (playerControl.GetGrapplingAutoAimStatus() && (close = FindGrapplePoint()) != null)
            {
                // should i make it actually shoot to the player
                showRope         = true;
                lr.positionCount = 2;
                //autoAim = true;
                crosshair.ChangeCrossHairSize();
                StartGrappleHelper(close.gameObject);
                grapplePoint = close.GetComponent <Renderer>().bounds.center;
            }
        }
    }