As a programmer coming from Java, what does this mean?

 var explosionPrefab : Transform; function OnCollisionEnter (collision : Collision) { if (collision.gameObject.tag == "Hammer") { Debug.Log("Die ball!"); var boom : GameObject = Instantiate(explosionPrefab, transform.position, Quaternion.identity); Destroy(gameObject, 0.1); // also sometimes destroying right away causes problems } } 

I found this snippet of code on the Unity forums, and was confused by these two line, the bold part in particular.

var explosionPrefab : Transform;

var boom : GameObject = Instantiate(explosionPrefab, transform.position, Quaternion.identity);

What exactly do they mean, and whats with the colons?

by ProLudum via /r/csharp

Leave a Reply