Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
4e10c4f05This file is pinned to the selected release. Download the original to open it in your design tool.
using Leap.Unity;
using Leap.Unity.Attachments;
using LeapSingleHandedShortcuts;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HideWhenNotTracked : MonoBehaviour
{
public AttachmentHand attachmentHand;
public GameObject itemToHide;
void Update()
{
// Reactivation trigger
if (attachmentHand.isTracked)
{
itemToHide.SetActive(true);
}
else if (!attachmentHand.isTracked)
{
itemToHide.SetActive(false);
}
}
}