TriggerEvent() public static method

public static TriggerEvent ( string eventName ) : void
eventName string
return void
Ejemplo n.º 1
0
        public void Start()
        {
            if (!UIManager.IsAlive)
            {
                Debug.LogWarning("There is no UIManager in the scene, so SetHandednessEvent may not work properly.");
            }

            _manager = UIManager.Instance;

            playerRefs.LeftHandSwitchMenuAction.onFirstClick.AddListener(() =>
            {
                KomodoEventManager.TriggerEvent("menu.setLeftHanded");

                KomodoEventManager.TriggerEvent("tools.setRightHanded");
            });

            playerRefs.RightHandSwitchMenuAction.onFirstClick.AddListener(() =>
            {
                KomodoEventManager.TriggerEvent("menu.setRightHanded");

                KomodoEventManager.TriggerEvent("tools.setLeftHanded");
            });

            KomodoEventManager.TriggerEvent("menu.setScreen");

            KomodoEventManager.TriggerEvent("tools.setScreen");

            _wasInVRLastFrame = false;
        }
Ejemplo n.º 2
0
        public void Start()
        {
            CaptureManager.Initialize();

            eraseTab.onTabSelected.AddListener(() =>
            {
                KomodoEventManager.TriggerEvent("eraseTool.enable");
            });

            eraseTab.onTabDeselected.AddListener(() =>
            {
                KomodoEventManager.TriggerEvent("eraseTool.disable");
            });

            undoButton.onClick.AddListener(() =>
            {
                UndoRedoManager.Instance.Undo();
            });

            drawTab.onTabSelected.AddListener(() =>
            {
                KomodoEventManager.TriggerEvent("drawTool.enable");
            });

            drawTab.onTabDeselected.AddListener(() =>
            {
                KomodoEventManager.TriggerEvent("drawTool.disable");

                KomodoEventManager.TriggerEvent("primitiveTool.disable");
            });

            brushToggle.onValueChanged.AddListener((isOn) =>
            {
                if (isOn)
                {
                    KomodoEventManager.TriggerEvent("drawTool.enable");

                    KomodoEventManager.TriggerEvent("primitiveTool.disable");

                    // TODO(Brandon) - is this the best way to get out of the primitive creation mode?

                    return;
                }

                KomodoEventManager.TriggerEvent("drawTool.disable");
            });

            leaveAndRejoinButton.onClick.AddListener(() =>
            {
                KomodoEventManager.TriggerEvent("connection.leaveAndRejoin");
            });

            closeConnectionAndRejoinButton.onClick.AddListener(() =>
            {
                KomodoEventManager.TriggerEvent("connection.closeConnectionAndRejoin");
            });
        }
Ejemplo n.º 3
0
        public void UpdatePlayerPosition2(Position newData)
        {
            if (teleportationCount >= 2)
            {
                KomodoEventManager.TriggerEvent("TeleportedTwice");
            }
            UpdateCenterEye();

            UpdatePlayerXZPosition(newData.pos.x, newData.pos.z);

            UpdatePlayerYPosition(newData.pos.y);

            teleportationCount += 1;
        }
Ejemplo n.º 4
0
 public void Start()
 {
     recordButtons.onClick.AddListener(() =>
     {
         if (startCapture.activeSelf)
         {
             KomodoEventManager.TriggerEvent("capture.start");
             recordButtons.transform.Find("startCapture").gameObject.SetActive(false);
             recordButtons.transform.Find("stopCapture").gameObject.SetActive(true);
         }
         else if (!startCapture.activeSelf)
         {
             KomodoEventManager.TriggerEvent("capture.stop");
             recordButtons.transform.Find("startCapture").gameObject.SetActive(true);
             recordButtons.transform.Find("stopCapture").gameObject.SetActive(false);
         }
         else
         {
             return;
         }
     });
 }
        public void EndCalibration()
        {
            if (!isCalibratingHeight)
            {
                return;
            }

            var handHeight = minYOfHands;

            var terrainHeight = ComputeGlobalYPositionOfTerrainBelowPlayer();

            var heightToBumpPlayer = terrainHeight - handHeight;

            //Debug.Log($"[HeightCalibration] terrain height: {terrainHeight} / handHeight: {handHeight} / heightToBumpPlayer: {heightToBumpPlayer}");

            onFinishedCalibration.Invoke(heightToBumpPlayer);

            KomodoEventManager.TriggerEvent("FinishedHeightCalibration");

            minYOfHands = float.MaxValue;

            isCalibratingHeight = false;
        }
Ejemplo n.º 6
0
 void Start()
 {
     KomodoEventManager.TriggerEvent("MandatoryHeightCalibration");
 }