StartListening() public static method

public static StartListening ( string eventName, UnityAction listener ) : void
eventName string
listener UnityAction
return void
        public void Start()
        {
            if (leftHandedMenuAnchor == null)
            {
                throw new UnassignedReferenceException("leftHandedMenuAnchor");
            }

            if (rightHandedMenuAnchor == null)
            {
                throw new UnassignedReferenceException("rightHandedMenuAnchor");
            }

            if (screenMenuAnchor == null)
            {
                throw new UnassignedReferenceException("screenMenuAnchor");
            }

            _currentKind = MenuAnchor.Kind.UNKNOWN;

            KomodoEventManager.StartListening("menu.setRightHanded", () =>
            {
                SetCurrentMenuAnchor(MenuAnchor.Kind.RIGHT_HANDED);
            });

            KomodoEventManager.StartListening("menu.setLeftHanded", () =>
            {
                SetCurrentMenuAnchor(MenuAnchor.Kind.LEFT_HANDED);
            });

            KomodoEventManager.StartListening("menu.setScreen", () =>
            {
                SetCurrentMenuAnchor(MenuAnchor.Kind.SCREEN);
            });
        }
        public static void Initialize()
        {
            startCapture += Start_Record;
            stopCapture  += End_Record;

            KomodoEventManager.StartListening("capture.start", startCapture);
            KomodoEventManager.StartListening("capture.stop", stopCapture);
        }
示例#3
0
        void Start()
        {
            _enable += Enable;

            KomodoEventManager.StartListening("drawTool.enable", _enable);

            _disable += Disable;

            KomodoEventManager.StartListening("drawTool.disable", _disable);
        }
        public void Start()
        {
            KomodoEventManager.StartListening("tools.setRightHanded", () =>
            {
                SetCurrentToolAnchor(ToolAnchor.Kind.RIGHT_HANDED);
            });

            KomodoEventManager.StartListening("tools.setLeftHanded", () =>
            {
                SetCurrentToolAnchor(ToolAnchor.Kind.LEFT_HANDED);
            });

            KomodoEventManager.StartListening("tools.setScreen", () =>
            {
                SetCurrentToolAnchor(ToolAnchor.Kind.SCREEN);
            });
        }
示例#5
0
        public void Start()
        {
            if (socketIODisplay == null)
            {
                Debug.LogError("socketIODisplay Text component was not assigned in ConnectionAdapter");
            }

            NetworkUpdateHandler netHandler = NetworkUpdateHandler.Instance;

            KomodoEventManager.StartListening("connection.leaveAndRejoin", () =>
            {
                SocketIOAdapter.Instance.LeaveAndRejoin();
            });

            KomodoEventManager.StartListening("connection.closeConnectionAndRejoin", () =>
            {
                SocketIOAdapter.Instance.CloseConnectionAndRejoin();
            });
        }
示例#6
0
        public void Start()
        {
            if (!menuPlacement)
            {
                throw new UnassignedReferenceException("menuPlacement");
            }

            if (!colorImageObject)
            {
                throw new UnassignedReferenceException("colorImageObject");
            }

            colorRectTransform = colorImageObject.GetComponent <RectTransform>();

            if (colorRectTransform == null)
            {
                throw new MissingComponentException("RectTransform on colorImageObject");
            }

            RawImage colorImage = colorImageObject.GetComponent <RawImage>();

            if (colorImage == null)
            {
                throw new MissingComponentException("RawImage on colorImageObject");
            }

            colorTexture = (Texture2D)colorImage.texture;

            if (!colorTexture)
            {
                throw new MissingReferenceException("texture in colorImage");
            }

            foreach (var lineRenderer in lineRenderers)
            {
                var triggerDraw = lineRenderer.GetComponent <TriggerDraw>();

                if (triggerDraw == null)
                {
                    Debug.LogError("There is no TriggerDraw.cs in Color Tool LineRenderer ", gameObject);

                    continue;
                }

                triggers.Add(triggerDraw);
            }

            if (!selectedColorCursor.transform)
            {
                throw new MissingFieldException("transform on selectedColorCursor");
            }

            if (!previewColorCursor.transform)
            {
                throw new MissingFieldException("transform on previewColorCursor");
            }

            previewColorCursorRectTransform = previewColorCursor.GetComponent <RectTransform>();

            if (!previewColorCursorRectTransform)
            {
                throw new MissingComponentException("RectTransform on previewColorCursor");
            }

            selectedColorCursorRectTransform = selectedColorCursor.GetComponent <RectTransform>();

            if (!selectedColorCursorRectTransform)
            {
                throw new MissingComponentException("RectTransform on selectedColorCursor");
            }

            TryGrabPlayerDrawTargets();

            _enable += Enable;

            KomodoEventManager.StartListening("drawTool.enable", _enable);

            _disable += Disable;

            KomodoEventManager.StartListening("drawTool.disable", _disable);
        }
示例#7
0
 void OnEnable()
 {
     KomodoEventManager.StartListening("MandatoryHeightCalibration", ShowCalibrationPromptListener);
     KomodoEventManager.StartListening("FinishedHeightCalibration", HideCalibrationPromptListener);
     KomodoEventManager.StartListening("TeleportedTwice", TeleportationCountListener);
 }