holopy3/Assets/SteamVR/InteractionSystem/Core/Scripts/DestroyOnDetachedFromHand.cs

23 lines
644 B
C#
Raw Normal View History

2020-12-10 14:25:12 +00:00
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Destroys this object when it is detached from the hand
//
//=============================================================================
using UnityEngine;
using System.Collections;
namespace Valve.VR.InteractionSystem
{
//-------------------------------------------------------------------------
[RequireComponent( typeof( Interactable ) )]
public class DestroyOnDetachedFromHand : MonoBehaviour
{
//-------------------------------------------------
private void OnDetachedFromHand( Hand hand )
{
Destroy( gameObject );
}
}
}