public IEnumerator Spawn() { yield return(new WaitForSeconds(2.0f)); counting = true; while (timeLeft > 0) { GameObject ball = balls [Random.Range(0, balls.Length)]; Vector3 spawnPosition = new Vector3( transform.position.x + Random.Range(-maxWidth, maxWidth), transform.position.y, 0.0f ); Quaternion spawnRotation = Quaternion.identity; Instantiate(ball, spawnPosition, spawnRotation); yield return(new WaitForSeconds(Random.Range(1.0f, 2.0f))); } yield return(new WaitForSeconds(2.0f)); gameOverText.SetActive(true); SaveInfo.SaveInfo(0, 0, Score.Score()); yield return(new WaitForSeconds(2.0f)); restartButton.SetActive(true); }
/// <summary> /// /// </summary> public void PostInfo() { if (SaveInfo != null) { //send info for save in data base SaveInfo.SaveInfo(KillsInput.text, DeathsInput.text, ScoreInput.text); StartCoroutine(RefreshWait()); KillsInput.text = ""; DeathsInput.text = ""; ScoreInput.text = ""; } else { Debug.LogWarning("Please Login Before open this scene"); PlayerInfo.text = "Please Login"; } }