Exemplo n.º 1
0
 private void FixedUpdate()
 {
     if (ss.vivo)
     {
         if (Input.GetKeyDown(KeyCode.Backspace) || Input.GetButtonDown("Back"))//autodestruição
         {
             ss.Damage(999999);
         }
         if ((Input.GetKeyDown(KeyCode.F) || Input.GetButtonDown("Fire1")) && !GameManagerScript.gm.danoInimigosNaTela)//bomba
         {
             if (ss.souls >= 100)
             {
                 GameObject go = Instantiate(bomb, transform.position, transform.rotation, null);
                 GameManagerScript.gm.danoInimigosNaTela = true;
                 ss.SubSouls(100);
             }
         }
     }
 }
Exemplo n.º 2
0
    void OnTriggerEnter2D(Collider2D collision)
    {
        if (doNothing(collision.gameObject.tag))
        {
            return;
        }
        try
        {
            StatsScript ss = collision.gameObject.GetComponent <StatsScript>();
            if (ss == null || !ss.vivo)
            {
                return;
            }

            if (ss != null)
            {
                ss.Damage(poder);
            }
        }catch (UnityException ue)
        {
            //
        }
        splash();
    }