public void AddAllowedToInteractModifier(AllowedToInteractModifier modifier) { if (allowedToInteractModifiers.Count == 0) { SetAllowedToInteract(false); } allowedToInteractModifiers.Add(modifier); }
public void RemoveAllowedToInteractModifier(AllowedToInteractModifier modifier) { allowedToInteractModifiers.Remove(modifier); if (allowedToInteractModifiers.Count == 0) { SetAllowedToInteract(true); } }
void PauseGame() { ShowMenu(true); Time.timeScale = 0.0f; DebugUtilities.Assert(allowedToInteract == null, "Was already restricting interaction"); allowedToInteract = new AllowedToInteractModifier(); player.AssignedAvatar().AddAllowedToInteractModifier(allowedToInteract); player.playerInteraction.OnAllowedToUseUI(true); }
void SetInteractionForMainCharacter(bool enabled) { var avatar = GetMainAvatar(); if (avatar == null) { return; } if (!enabled) { if (dontInteractModifier == null) { dontInteractModifier = new AllowedToInteractModifier(); avatar.AddAllowedToInteractModifier(dontInteractModifier); } } else if (dontInteractModifier != null) { avatar.RemoveAllowedToInteractModifier(dontInteractModifier); dontInteractModifier = null; } }
void ResumeGame() { player.AssignedAvatar().RemoveAllowedToInteractModifier(allowedToInteract); allowedToInteract = null; ContinueGame(); }