Esempio n. 1
0
        /// <summary>
        /// Callback method for the TransitionPoint#OnTriggerEnter2D method.
        /// If we go through a transition while being paused, we can only let the transition occur if we
        /// unpause first and then let the original method continue.
        /// </summary>
        /// <param name="orig">The original method.</param>
        /// <param name="self">The TransitionPoint instance.</param>
        /// <param name="obj">The collider that enters the trigger.</param>
        private void TransitionPointOnOnTriggerEnter2D(
            On.TransitionPoint.orig_OnTriggerEnter2D orig,
            TransitionPoint self,
            Collider2D obj
            )
        {
            // Skip this if the transition point is a door, since it isn't a enter-and-teleport transition,
            // but requires input to transition, so it can't happen in the pause menu
            if (!self.isADoor)
            {
                ImmediateUnpauseIfPaused();
            }

            // Execute original method
            orig(self, obj);
        }
Esempio n. 2
0
        /**
         * If we go through a transition while being based, we can only let the transition
         * occur if we unpause first and then let the original method continue
         */
        private void TransitionPointOnOnTriggerEnter2D(
            On.TransitionPoint.orig_OnTriggerEnter2D orig,
            TransitionPoint self,
            Collider2D obj
            )
        {
            // Unpause if paused
            if (UIManager.instance != null)
            {
                if (UIManager.instance.uiState.Equals(UIState.PAUSED))
                {
                    UIManager.instance.TogglePauseGame();
                }
            }

            // Execute original method
            orig(self, obj);
        }