예제 #1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag.Equals("Ship"))
        {
            if (objectType == ObjectType.Rock)
            {
                ParticleFactory.CreateRockCollision(transform);
                AudioSourceFactory.CreateSmallRangeSource(gameObject.transform, Resources.Load <AudioClip>("SFX/Collision/Rock"));
            }

            else
            {
                ParticleFactory.CreateShipCollision(transform);
            }

            if (destroyOnCollision)
            {
                Destroy(gameObject);
            }
        }
    }