Ejemplo n.º 1
0
 public void AddAllowedToInteractModifier(AllowedToInteractModifier modifier)
 {
     if (allowedToInteractModifiers.Count == 0)
     {
         SetAllowedToInteract(false);
     }
     allowedToInteractModifiers.Add(modifier);
 }
Ejemplo n.º 2
0
    public void RemoveAllowedToInteractModifier(AllowedToInteractModifier modifier)
    {
        allowedToInteractModifiers.Remove(modifier);

        if (allowedToInteractModifiers.Count == 0)
        {
            SetAllowedToInteract(true);
        }
    }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
    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;
        }
    }
Ejemplo n.º 5
0
 void ResumeGame()
 {
     player.AssignedAvatar().RemoveAllowedToInteractModifier(allowedToInteract);
     allowedToInteract = null;
     ContinueGame();
 }