Ejemplo n.º 1
0
        public void DelegateOnCollisionEnter(Collision other)
        {
            var bullet = other.gameObject.GetComponent <Bullet>();

            if (bullet != null && !dead)
            {
                if (fxDeath != null)
                {
                    GameObject.Instantiate(fxDeath, fxDeathPosition.position, Quaternion.identity);
                }

                dead = true;
                OnDeath();
                Destroy(gameObject);
                loop.AddScore();
            }
        }