Tanoda
HandColorer.cs
Go to the documentation of this file.
1#if !UNITY_WEBGL
2using System.Collections;
3using System.Collections.Generic;
4using NaughtyAttributes;
5using UnityEngine;
6using ViveHandTracking;
7
8public class HandColorer : MonoBehaviour
9{
10 public SkinnedMeshRenderer smr;
11 public Material alpha, standard;
12 //private float revert = 0.0f;
13 //private bool running = false;
14 private ModelRenderer mr;
15
16 void Start()
17 {
18 mr = GetComponent<ModelRenderer>();
19 mr.SetMaterials(alpha, standard);
20 mr.SetSMR(smr);
21 }
22
23 public void ChangeColor(Color value)
24 {
25 mr.ChangeColor(value);
26 }
27
28 [Button()]
29 void teszt()
30 {
31 ChangeColor(Color.red);
32 }
33#if UNITY_EDITOR
34 [Button]
35 private void ChangeTrackedState()
36 {
37 var hp = GetComponent<HandPredicter>();
38 hp.TrackingChanged();
39 }
40
41#endif
42}
43#endif
UnityEngine.UI.Button Button
Definition: Pointer.cs:7
UnityEngine.Color Color
Definition: TestScript.cs:32
SkinnedMeshRenderer smr
Definition: HandColorer.cs:10
void ChangeColor(Color value)
Definition: HandColorer.cs:23
Material alpha
Definition: HandColorer.cs:11
Material standard
Definition: HandColorer.cs:11