コード例 #1
0
        internal void OnUpdate()
        {
            if (!reportedXRStateSwitch)
            {
                reportedXRStateSwitch = true;
                OnXRChange?.Invoke(xrState, viewsCount, leftRect, rightRect);
            }
            if (!updatedControllersOnEnd)
            {
                updatedControllersOnEnd = true;
                UpdateControllersOnEnd();
            }
            if (visibilityStateChanged)
            {
                visibilityStateChanged = false;
                OnVisibilityChange?.Invoke(visibilityState);
            }
            if (this.xrState == WebXRState.NORMAL)
            {
                return;
            }
            UpdateXRCameras();
            bool hasHandsData = false;

            if (OnHandUpdate != null && this.xrState != WebXRState.NORMAL)
            {
                if (GetHandFromHandsArray(0, ref leftHand))
                {
                    OnHandUpdate?.Invoke(leftHand);
                }

                if (GetHandFromHandsArray(1, ref rightHand))
                {
                    OnHandUpdate?.Invoke(rightHand);
                }

                hasHandsData = leftHand.enabled || rightHand.enabled;
            }

            if (!hasHandsData && OnControllerUpdate != null && this.xrState != WebXRState.NORMAL)
            {
                if (GetGamepadFromControllersArray(0, ref controller1))
                {
                    OnControllerUpdate?.Invoke(controller1);
                }

                if (GetGamepadFromControllersArray(1, ref controller2))
                {
                    OnControllerUpdate?.Invoke(controller2);
                }
            }

            if (OnViewerHitTestUpdate != null && this.xrState == WebXRState.AR)
            {
                if (GetHitTestPoseFromViewerHitTestPoseArray(ref viewerHitTestPose))
                {
                    OnViewerHitTestUpdate?.Invoke(viewerHitTestPose);
                }
            }
        }
コード例 #2
0
ファイル: PanelUI.cs プロジェクト: pseudo20/Pipeline-Dreams
    public void ShowDialogue()
    {
        visible = true;

        OnVisibilityChange?.Invoke(visible);
        Panel.SetActive(visible);
    }
コード例 #3
0
ファイル: PanelUI.cs プロジェクト: pseudo20/Pipeline-Dreams
    public void HideDialogue()
    {
        visible = false;

        OnVisibilityChange?.Invoke(visible);
        Panel.SetActive(visible);
    }
コード例 #4
0
        public void SetVisibility(float target, bool instant = false)
        {
            if (float.IsNaN(target)) target = 0;
            target = Mathf.Clamp(target, 0, 1);

            if (target == TargetVisibility) return;
            
            IsVisible = target > 0;
            TargetVisibility = target;
            Transitioning = true;

            if (instant)
            {
                FinishReveal();
            }

            OnVisibilityChange?.Invoke(Element, IsVisible);
        }
コード例 #5
0
 internal void AddVisibilityListener(OnVisibilityChange listener)
 {
     visibilityListeners.Add(listener);
 }
コード例 #6
0
 internal void AddVisibilityListener(FieldInfo field, OnVisibilityChange listener)
 {
     GetFieldVisibility(field).AddVisibilityListener(listener);
 }