コード例 #1
0
        public static void Deploy()
        {
            Debug.Log("Detouring Input Methods");

            if (_isPressedOriginal == null)
            {
                throw new NullReferenceException("Original IsPressed method not found");
            }

            if (_isKeyUpOriginal == null)
            {
                throw new NullReferenceException("Original IsKeyUp method not found");
            }

            if (_isPressedReplacement == null)
            {
                throw new NullReferenceException("New IsPressed method not found");
            }

            if (_isKeyUpReplacement == null)
            {
                throw new NullReferenceException("New IsKeyUp method not found");
            }

            _revertState1 = RedirectionHelper.RedirectCalls(_isPressedOriginal, _isPressedReplacement);
            _revertState2 = RedirectionHelper.RedirectCalls(_isKeyUpOriginal, _isKeyUpReplacement);
        }
コード例 #2
0
        public static void Deploy()
        {
            if (_isDeployed)
            {
                return;
            }

            _snapDirectionRevertState = RedirectionHelper.RedirectCalls(SnapDirectionOriginalMethodInfo,
                                                                        SnapDirectionOverrideMethodInfo);
            _snapRevertState = RedirectionHelper.RedirectCalls(SnapOriginalMethodInfo, SnapOverrideMethodInfo);

            _isDeployed = true;
        }
コード例 #3
0
        public static void Deploy()
        {
            if (_originalGetLengthSnapMethodInfo == null)
            {
                throw new NullReferenceException("Original GetLengthSnap method not found");
            }

            if (_newGetLengthSnapMethodInfo == null)
            {
                throw new NullReferenceException("New GetLengthSnap method not found");
            }

            _revertState = RedirectionHelper.RedirectCalls(_originalGetLengthSnapMethodInfo,
                                                           _newGetLengthSnapMethodInfo);
        }