public DespawnMeteorite ( Meteorite, meteorite ) : void | ||
meteorite | Meteorite, | |
return | void |
public void DespawnMeteorite(Meteorite meteorite)
{
meteorite.gameObject.SetActiveRecursively (false);
meteoritePool.Enqueue (meteorite);
}
void Update() // Move forward! (The rigidbody is kinematic, so movement comes from the transform) { if (transform.position.magnitude > maxDistance) { demoControl.DespawnMeteorite(this); } transform.position += transform.forward * speed * Time.deltaTime; }