void OnTriggerEnter2D(Collider2D other) { if (other.transform.position.y < transform.position.y && other.transform.position.x < transform.position.x) { TypeFlower newType = getTypeFlower(other); if (typeFlower != newType) { if (typeFlower != TypeFlower.NONE) { gameController.resetGame(); } else { gameController.updateUpGame(); } typeFlower = newType; } else { gameController.updateUpGame(); } } }
public void init() { this.typeFlower = TypeFlower.NONE; }