-
Notifications
You must be signed in to change notification settings - Fork 1
/
TextureManager.cs
40 lines (33 loc) · 964 Bytes
/
TextureManager.cs
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
40
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TechXR.Core.Sense;
public class TextureManager : MonoBehaviour
{
public Animator menuCanvas;
public Transform menuContainer, playerHead;
public MeshRenderer startGobj;
private MeshRenderer currentGobj;
// Start is called before the first frame update
void Start()
{
currentGobj = startGobj;
}
// Update is called once per frame
void Update()
{
if (SenseInput.GetButtonDown(ButtonName.C))
{
menuCanvas.SetTrigger("openclose");
}
menuContainer.eulerAngles = new Vector3(menuContainer.eulerAngles.x, playerHead.eulerAngles.y, menuContainer.eulerAngles.z);
}
public void SetGameObjectType(MeshRenderer gameObj)
{
currentGobj = gameObj;
}
public void SetTextureOfGameObj(Texture texture)
{
currentGobj.material.mainTexture = texture;
}
}