Пример #1
0
 void OnCollisionEnter(Collision collision)
 {
     collision.gameObject.SendMessage("Damage", damage, SendMessageOptions.DontRequireReceiver);
     collider.enabled = false;
     gameObject.GetComponent <SpriteRenderer>().enabled = false;
     if (projector != null)
     {
         projector.Disable();
     }
     for (int i = 0; i < explosionParticles; i++)
     {
         particleSystem.Emit(transform.position, new Vector3(Random.value * 10 - 5, Random.value * 10 - 5, 0f), Random.value, Random.value * 2, particleSystem.startColor);
     }
     rigidbody.isKinematic = true;
 }