Example #1
0
    /// <summary>
    /// Sends grapple hook to the ceiling
    /// </summary>
    /// <returns></returns>
    void GrappleTarget()
    {
        // Set this grapple's state to LOCKED
        state = GrappleStates.LOCKED;

        // Enable the line renderer
        grappleLine.enabled = true;

        // Draw line from grapple to anchorpoint
        DrawGrappleLine();
    }
Example #2
0
    /// <summary>
    /// Initialize
    /// </summary>
    private void Start()
    {
        // Delegate HandleTriggerPress method to the PRESS event
        EventManager.AddTriggerPressListener(HandleTriggerPress);

        // Delegate HandleTriggerRelease method to the RELEASE event
        EventManager.AddTriggerReleaseListener(HandleTriggerRelease);

        // Get the reference to root controller: This grapples grandparent
        rootTransform = gameObject.transform.parent.parent;

        // Get reference to the line renderer that's attached to this grapple gameobject
        grappleLine = GetComponent <LineRenderer>();

        // Set state to default (IDLE)
        state = GrappleStates.IDLE;

        // Turn line renderer off
        grappleLine.enabled = false;
    }
Example #3
0
 /// <summary>
 /// Removes the grapple from its anchorpoint on the ceiling
 /// </summary>
 void ReleaseGrapple()
 {
     state = GrappleStates.IDLE;
     grappleLine.enabled = false;
 }