Tanoda
AttachmentHandEnableDisable.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9using Leap.Unity;
11using System.Collections;
12using System.Collections.Generic;
13using UnityEngine;
14
15namespace Leap.Unity.Attachments {
16
17 public class AttachmentHandEnableDisable : MonoBehaviour {
18
20
21 void Update() {
22 // Deactivation trigger
23 if (!attachmentHand.isTracked && attachmentHand.gameObject.activeSelf) {
24 attachmentHand.gameObject.SetActive(false);
25 }
26
27 // Reactivation trigger
28 if (attachmentHand.isTracked && !attachmentHand.gameObject.activeSelf) {
29 attachmentHand.gameObject.SetActive(true);
30 }
31 }
32
33 }
34
35}
This MonoBehaviour is managed by an AttachmentHands component on a parent MonoBehaviour....
bool isTracked
Gets the chirality of this AttachmentHand. This is set automatically by the AttachmentHands parent ob...