Exemplo n.º 1
0
    public void OnTriggerEnter(Collider other)
    {
        PowerControl powerControl = other.gameObject.GetComponent <PowerControl>();

        if (powerControl != null)
        {
            powerControl.AddPower(powerup);
            if (TankPowerSound != null)
            {
                AudioSource.PlayClipAtPoint(TankPowerSound, tf.position, 1.0f);
            }
            Destroy(this.gameObject);
        }
    }