Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using Microsoft.MixedReality.Toolkit.Input;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class Kalender : MonoBehaviour, IMixedRealityTouchHandler
{
public TextMeshPro textMesh;
void Start()
{
SetTextVisibility(false); // Initial unsichtbar
}
public void OnTouchStarted(HandTrackingInputEventData eventData)
{
SetTextVisibility(true); // Sichtbar machen
}
public void OnTouchCompleted(HandTrackingInputEventData eventData)
{
SetTextVisibility(false); // Wieder unsichtbar machen
}
public void OnTouchUpdated(HandTrackingInputEventData eventData) { }
void SetTextVisibility(bool isVisible)
{
if (isVisible)
{
textMesh.color = new Color(textMesh.color.r, textMesh.color.g, textMesh.color.b, 1.0f); // Voll sichtbar
}
else
{
textMesh.color = new Color(textMesh.color.r, textMesh.color.g, textMesh.color.b, 0.0f); // Unsichtbar
}
}
}