IEnumerator NextLevel() { yield return(new WaitForSeconds(3.0f)); Save.SetPoints(Points); Save.SetLifes(PlayerLifes); Save.SetScorePerLife(pointsCounterperlife); SceneManager.LoadScene(1); }
private byte movingDirection; //0 left, 1 right // Use this for initialization void Start() { Cursor.visible = false; Save.SetLifes(3); Save.SetPoints(0); Save.SetScorePerLife(0); PlayerAnimator = Player.GetComponent <Animator>(); RedAnimator = Red.GetComponent <Animator>(); PinkAnimator = Pink.GetComponent <Animator>(); LightBlueAnimator = LightBlue.GetComponent <Animator>(); LightYellowAnimator = LightYellow.GetComponent <Animator>(); PLayerSpriteRenderer = Player.GetComponent <SpriteRenderer>(); StartCoroutine(MainScreen()); movingDirection = 0; }