private void OnTriggerEnter(Collider other) { if (other.GetComponent <BallComp>()) { controller.activeBonus = true; controller.numTilesWithBonus = controller.bonusDuration; controller.UpdateValueBonus(); Destroy(gameObject); } }
private void OnTriggerEnter(Collider other) { if (other.GetComponent <BallComp>()) { if (controller.activeBonus) { --controller.numTilesWithBonus; if (controller.numTilesWithBonus == 0) { controller.activeBonus = false; } controller.UpdateValueBonus(); } controller.SpawnsProxTile(); Destroy(transform.parent.gameObject, tempoVidaTile); } }