Tree Hugging Sim Code Sample:

/*
 * Programmer: Dylan McDonald
 * 
 * Description: Handles the players movement in a level,
 *  hug detection, laser firing ability, and if the game has
 *  been paused.
*/

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.SceneManagement;
using Valve.VR;

public class VR_MovementController : MonoBehaviour
{
    //
    // * Other functions and variables where omitted *
    //

    /*
     * Function: Detect Hug
     * 
     * Description: Checks to see if both hand colliders are touching.
     *  If so, a third collider is then enabled. If the third collider 
     *  is making contact with a tree, that tree has been hugged :D.
    */
    private void DetectHug()
    {
        //if the player is allowed to pause the game, then the hug detection 
        // will continue
        if (canPause)
        {
            //vairables which will be used whether the player goes for a 
            // great or sick hug
            Animator treeAnimator;
            bool canBeHugged;

            //(GREAT HUG CHECK) if both the wrist colliders touch eachother...
            if (leftWristCollider.bounds.Intersects(rightWristCollider.bounds))
            {
                treeHugCollider.enabled = true;

                //if the collider is connected to a tree object...
                if (isHugging)
                {
                    //check to see if the tree can be hugged or not
                    canBeHugged = treeCollider.gameObject.GetComponentInParent<TreeController>().canBeHugged;
                    treeAnimator = treeCollider.gameObject.GetComponent<Animator>();

                    //if it can be hugged, then...
                    if (canBeHugged)
                    {
                        treeCollider.gameObject.GetComponentInParent<TreeController>().HugTree();
                        islandGM.AddTree();
                        cutManager.PlayGreatHug();
                        oxygenScript.Gain10();
                        InGameSoundScript.PlaySoundEffect("Great");
                    }
                    //if it can't be hugged, then...
                    else if (!canBeHugged && !treeAnimator.GetBool("isHugged"))
                    {
                        cutManager.PlayNoConsentCutscene();

                        //only play this sound effect once when the hug is 
                        // first rejected
                        if (!consentSoundGreat)
                        {
                            InGameSoundScript.PlaySoundEffect("Consent");
                            consentSoundGreat = true;
                        }
                    }
                }
            }
            //resets a boolean so that the non-consent sound effect can be 
            // played again if and when the tree is hugged
            else
            {
                consentSoundGreat = false;
            }

            //
            // * The "sick hug" detection function is what follows *
            //
        }
    }

    //
    // * Many functions where omitted *
    //
}

/*
 * Programmer: Dylan McDonald
 * 
 * Description: Checks if there are "bad" objects
 *  nearby. Determines if this particular tree has 
 *  been hugged or not.
*/

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TreeController : MonoBehaviour
{
    //
    // * Other functions and variables where omitted *
    //

    //called by the player movement script when a hug
    // has been detected
    public void HugTree()
    {
        //if this tree hasn't been hugged already, then 
        // consider it hugged
        if (canBeHugged)
        {
            treeAnimator.SetBool("isHugged", true);
            canBeHugged = false;
            hasBeenHugged = true;
        }
    }
}