DemoControl.DespawnMeteorite C# (CSharp) Method

DespawnMeteorite() public method

public DespawnMeteorite ( Meteorite, meteorite ) : void
meteorite Meteorite,
return void
    public void DespawnMeteorite(Meteorite meteorite)
    {
        meteorite.gameObject.SetActiveRecursively (false);
        meteoritePool.Enqueue (meteorite);
    }

Usage Example

Ejemplo n.º 1
0
    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;
    }