|
@@ -3,8 +3,11 @@ using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
+using NRKernal;
|
|
|
using UnityEngine;
|
|
|
using UnityEngine.EventSystems;
|
|
|
+using UnityEngine.UI;
|
|
|
+
|
|
|
namespace SC.XR.Unity.Module_InputSystem {
|
|
|
|
|
|
public class SCInputModule : StandaloneInputModule {
|
|
@@ -92,8 +95,17 @@ namespace SC.XR.Unity.Module_InputSystem {
|
|
|
RayCasterCamera.transform.position = posture.position;
|
|
|
RayCasterCamera.transform.rotation = posture.rotation;
|
|
|
|
|
|
+ List<ICanvasRaycastTarget> list = CanvasTargetCollector.GetCanvases();
|
|
|
+ for (int i = 0; i < list.Count; i++)
|
|
|
+ {
|
|
|
+ if (list[i].canvas.gameObject.GetComponent<CanvasCollection>() == null)
|
|
|
+ {
|
|
|
+ list[i].canvas.gameObject.AddComponent<CanvasCollection>();
|
|
|
+ list[i].canvas.gameObject.AddComponent<GraphicRaycaster>();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- foreach(var canvas in CanvasCollection.CanvasList) {
|
|
|
+ foreach (var canvas in CanvasCollection.CanvasList) {
|
|
|
canvas.worldCamera = RayCasterCamera;
|
|
|
}
|
|
|
|