Example #1
0
    // -----
    // Interactions, etc
    // -----

    bool VexTargetInteract(int pressed)
    {
        if (moduleSolved)
        {
            return(false);
        }

        VexBlock target = VexAtPosition(pressed);

        // Pressed the empty square?
        if (target == null)
        {
            bombAudio.PlaySoundAtTransform("ClickDown", vexButtonTargets[pressed].transform);
            currentlyHeldVex.SetPosition(openPosition);
            currentlyHeldVex = null;
            openPosition     = -1;
            return(false);
        }

        // Already holding something? Set it down before picking up.
        if (currentlyHeldVex != null)
        {
            currentlyHeldVex.SetPosition(pressed);
            bombAudio.PlaySoundAtTransform("ClickDown", vexButtonTargets[pressed].transform);
        }
        else
        {
            openPosition = target.GetPosition();
        }
        target.PickUp();
        currentlyHeldVex = target;
        return(false);
    }