Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

43 lines
1.1 KiB

//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: This object will get hover events and can be attached to the hands
//
//=============================================================================
using UnityEngine;
using UnityEngine.Events;
using System.Collections;
namespace Valve.VR.InteractionSystem
{
//-------------------------------------------------------------------------
public class Interactable : MonoBehaviour
{
public delegate void OnAttachedToHandDelegate( Hand hand );
public delegate void OnDetachedFromHandDelegate( Hand hand );
[HideInInspector]
public event OnAttachedToHandDelegate onAttachedToHand;
[HideInInspector]
public event OnDetachedFromHandDelegate onDetachedFromHand;
//-------------------------------------------------
private void OnAttachedToHand( Hand hand )
{
if ( onAttachedToHand != null )
{
onAttachedToHand.Invoke( hand );
}
}
//-------------------------------------------------
private void OnDetachedFromHand( Hand hand )
{
if ( onDetachedFromHand != null )
{
onDetachedFromHand.Invoke( hand );
}
}
}
}