Exemplo n.º 1
0
    public void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "Player")
        {
            luanda = collision.GetComponent <LuandaScript>();
            luanda.TakeDamage(20);
            gameObject.SetActive(false);
            //XpLODE();
            GameObject spawnbullet = Instantiate(dust, transform.position, Quaternion.identity) as GameObject;
        }

        if (collision.gameObject.tag == "Rocks")
        {
            //enemy = collision.GetComponent<EnemyScript>();
            //enemy.TakeDamage(20);
            gameObject.SetActive(false);
            //XpLODE();
            GameObject spawnbullet = Instantiate(dust, transform.position, Quaternion.identity) as GameObject;
        }
    }
Exemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     luanda = FindObjectOfType <LuandaScript>();
 }