Exemplo n.º 1
0
 public override void Kill()
 {
     actionScript.OnOffAnimator(false);
     anima.gameObject.GetComponent <PolygonCollider2D>().isTrigger = true;
     anima.SetTrigger("kill");
     characterSelectionManager.CharStats[killed.GetComponent <PlayerStats>().Stats1.Index] = killed.GetComponent <PlayerStats>().Stats1;
     characterSelectionImageDispatcher.SpriteAdder(killed.GetComponent <PlayerStats>().Stats1.Index);
     playerScript.IsTalking = true;
     toDestroy = true;
 }
Exemplo n.º 2
0
 private void OnCollisionStay2D(Collision2D collision)
 {
     if (!playerScript.IsTalking)
     {
         if (collision.gameObject.tag == "Player" && playerScript.IsMoving)
         {
             exitCounter = 0;
             counter++;
             if (counter >= 100)
             {
                 GetComponent <Collider2D>().enabled = false;
                 actionTriggerScript.OnOffAnimator(false);
                 actionTriggerScript.IsTouching        = false;
                 GetComponent <PathFind>().IsColliding = false;
             }
         }
     }
 }
Exemplo n.º 3
0
    void Update()
    {
        if (Npc != null)
        {
            float horizontal = Input.GetAxisRaw("Horizontal");
            float vertical   = Input.GetAxisRaw("Vertical");

            if ((vertical != 0 || horizontal != 0 || Input.anyKeyDown) && Npc.transform.GetChild(1).gameObject.activeSelf)
            {
                TextAppearanceManager textAppearance = Npc.transform.GetChild(1).gameObject.transform.GetComponentInChildren <TextAppearanceManager>();

                //textAppearance.ResetTextAppeareance(Npc.transform.GetChild(1).gameObject.GetComponentInChildren<Text>());
                Npc.transform.GetChild(1).gameObject.SetActive(false);
                actionT.IsDialogueOn = false;
                //textAppearance.IsActive = true;
                //actionTrigger.SetActive(true);

                if (vertical != 0 || horizontal != 0)
                {
                    actionT.OnOffAnimator(false);
                }
            }
        }
    }