예제 #1
0
        static void Character_UpdateReviveInteraction_Pre(Character __instance)
        {
            #region quit
            if (!_interactionToggle)
            {
                return;
            }
            #endregion

            Transform reviveTransform = __instance.transform.Find("ReviveInteraction");
            if (reviveTransform != null)
            {
                InteractionRevive      interaction = reviveTransform.GetComponent <InteractionRevive>();
                InteractionTriggerBase triggerBase = reviveTransform.GetComponent <InteractionTriggerBase>();
                float distance = _interactionDistance.Value - PLAYER_INTERACT_RADIUS;

                // Change
                interaction.HoldActivationTime      = _interactionDuration.Value;
                triggerBase.DetectionPriority       = _interactionPrioritize.Value ? int.MinValue : DEFAULT_DETECTION_PRIORITY;
                triggerBase.DetectionColliderRadius = distance;
                if (triggerBase.InteractionCollider != null)
                {
                    triggerBase.InteractionCollider.As <SphereCollider>().radius = distance;
                }
            }
        }
예제 #2
0
            public static bool Prefix(InteractionRevive __instance)
            {
                var self = __instance;

                if (Instance.CurrentGame == GameModes.NONE)
                {
                    return(true);
                }
                else
                {
                    if (At.GetValue(typeof(InteractionBase), self as InteractionBase, "m_lastCharacter") is Character m_lastCharacter && m_lastCharacter.IsLocalPlayer)
                    {
                        RPCManager.Instance.SendUIMessageLocal(m_lastCharacter, "You cannot revive players during a game!");
                        Instance.StartCoroutine(Instance.FixReviveInteraction(self, self.OnActivationEvent));
                        self.OnActivationEvent = null;
                    }

                    return(false);
                }
            }