StartListening() публичный статический Метод

public static StartListening ( string eventName, UnityAction listener ) : void
eventName string
listener UnityAction
Результат void
Пример #1
0
        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);
            });
        }
Пример #2
0
        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);
        }
Пример #4
0
        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);
 }