123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- namespace EZXR.Glass.Inputs
- {
- public class HandleControllerEffect : MonoBehaviour
- {
- public HandType handType;
- public Texture defaultTexture;
- public Texture[] activeTextures;
- public UnityEngine.Renderer[] activeRenderers;
- private HandleKeyCode[] allKeyCode = new HandleKeyCode[]
- {
- HandleKeyCode.Primary,
- HandleKeyCode.Secondary,
- HandleKeyCode.Return,
- HandleKeyCode.Grid,
- HandleKeyCode.Home,
- HandleKeyCode.Rocker,
- HandleKeyCode.Trigger
- };
- private void Update()
- {
- for (int i = 0; i < allKeyCode.Length; i++)
- {
-
-
-
-
-
-
-
-
-
-
-
- if (HandleControllerManager.Instance.GetButton(handType, allKeyCode[i]))
- {
- if (i < activeTextures.Length && i < activeRenderers.Length)
- activeRenderers[i].material.SetTexture("_MainTex", activeTextures[i]);
- }
- else
- {
- if (i < activeRenderers.Length)
- activeRenderers[i].material.SetTexture("_MainTex", defaultTexture);
- }
- }
- }
- }
- }
|