Tanoda
HandCollisionManager.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using UnityEngine;
4
5public class HandCollisionManager : MonoBehaviour
6{
8
9 List<GameObject> modifiedGOs = new List<GameObject>();
10
11 // Start is called before the first frame update
12 void Start()
13 {
14 instance = this;
15 }
16
17 public void SetLayer(GameObject[] gameobjects)
18 {
19 foreach (var go in gameobjects)
20 {
21 modifiedGOs.Add(go);
22 Macro.SetLayer(go, "HoldItemLayer");
23 }
24 }
25 public void SetLayer(Collider[] colliders)
26 {
27 foreach (var coll in colliders)
28 {
29 modifiedGOs.Add(coll.gameObject);
30 Macro.SetLayer(coll.gameObject, "HoldItemLayer");
31 }
32 }
33
34 public void ResetLayer(GameObject[] gameobjects)
35 {
36 foreach (var go in gameobjects)
37 {
38 modifiedGOs.Remove(go);
39 if (!modifiedGOs.Contains(go))
40 {
41 Macro.SetLayer(go, "Default");
42 }
43 }
44 }
45
46
47}
void ResetLayer(GameObject[] gameobjects)
void SetLayer(Collider[] colliders)
static HandCollisionManager instance
void SetLayer(GameObject[] gameobjects)
Definition: Macro.cs:12
static void SetLayer(GameObject go, string layerName)
Definition: Macro.cs:546