public override void Activate(GameObject actor)
 {
     particle.SetActive(true);
     isInteracted = true;
     gameManager.uiManager.CanvasUI.OpenEnycloepdia();
     gameManager.uiManager.CanvasUI.EventDialogueClosed.RemoveListener(gameManager.uiManager.CanvasUI.ForceOpen);
     EventActivated.Invoke(actor);
 }
 public override void Activate(GameObject actor)
 {
     hasBeenHit   = true;
     isInteracted = true;
     PlayAnimOn();
     EventInRange.Invoke(actor);
     EventInteracted.Invoke(actor);
     EventActivated.Invoke(actor);
 }
Exemple #3
0
 public override void Activate(GameObject actor)
 {
     isInteracted = true;
     if (GetComponent <SpriteRenderer>())
     {
         GetComponent <SpriteRenderer>().sprite = on;
     }
     EventActivated.Invoke(actor);
 }
 public override void Interact(GameObject actor)
 {
     if (players.Any(player => player.ID == playerIDRequired) || players.Count > 0 && playerCanTrigger)
     {
         OnSprite();
         isInteracted = !isInteracted;
         EventInteracted.Invoke(actor);
         EventActivated.Invoke(actor);
     }
 }
Exemple #5
0
    public override void Interact(GameObject obj)
    {
        if (isInteracted == true && activateOnce || Time.timeScale == 0 || !canInput)
        {
            return;
        }
        canInput = false;
        StartCoroutine(Delay());
        PlayerController player = obj.GetComponent <PlayerController>();
        SkillActor       actor  = player.GetComponent <SkillActor>();

        Debug.Log(actor);
        if (!actor.skills.Any(item => item.ID == skill.ID) && !giveToSpecificPlayer)
        {
            actor.AddSkill(skill);
        }
        if (!actor.skills.Any(item => item.ID == skill.ID) && giveToSpecificPlayer)
        {
            if (player.ID == playerID && !isInteracted)
            {
                actor.AddSkill(skill);
                if (item != null)
                {
                    gameManager.sharedInventory.AddItem(item);
                }
                GetComponent <SpriteRenderer>().sprite = on;
                isInteracted = true;
                EventActivated.Invoke(obj);
                EventInteracted.Invoke(obj);
            }

            else
            {
                if (Time.timeScale == 1)
                {
                    EventOnWrongPlayer.Invoke();
                }
            }
        }
    }
Exemple #6
0
 public override void Activate(GameObject actor)
 {
     OpenDoor();
     EventActivated.Invoke(actor);
 }