private void InstanceOnActionSequenceCompleted() { LivesLeft--; LifeChange?.Invoke(LivesLeft); if (LivesLeft <= 0) { Explode(); } }
void Update() { if (transform.position.y < -6f) { LifeChange.LifeDec(); Destroy(gameObject); } if (fallSpeed <= 0.1) { fallSpeed = 0.1f; } transform.position -= new Vector3(0, fallSpeed * Time.deltaTime, 0); if (Input.GetKey("escape")) { SceneManager.LoadScene("main"); //Lose } if (bomb) { ScoreChange.ScoreUP(); Destroy(gameObject); } }