Example #1
0
    public void PullInput(InputType type)
    {
        switch (type)
        {
        case InputType.Down:
            pull.StartPull();

            if (pull.HasTarget)
            {
                lineRenderer.ActivateLine();
                lineRenderer.UpdateLine(transform.position, jointController.GetGrapplePoint());
            }

            break;

        case InputType.Hold:
            pull.UpdatePull();

            if (pull.HasTarget)
            {
                lineRenderer.UpdateLine(transform.position, jointController.GetGrapplePoint());
            }
            else
            {
                lineRenderer.DeactivateLine();
            }

            break;

        case InputType.Release:
            pull.EndPull();
            lineRenderer.DeactivateLine();
            break;
        }
    }