예제 #1
0
 private void Start()
 {
     numberAnimation = GameObject.FindGameObjectWithTag("GameController").GetComponent <NumberAnimation>();
     gameController  = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>();
     highScore       = GameObject.FindGameObjectWithTag("HighScore").GetComponent <TextMeshProUGUI>();
     highScore.text  = PlayerPrefs.GetFloat("HighScore", 0f).ToString("#.##");
 }
예제 #2
0
 private void Start()
 {
     Advertisement.Initialize(GooglePlayID, testMode);
     hbarCanvas      = GameObject.FindGameObjectWithTag("hbarcanvas").GetComponent <CanvasGroup>();
     playerCube      = GameObject.FindGameObjectWithTag("playercube");
     explotionObj    = GameObject.FindGameObjectWithTag("explosion");
     explosion       = explotionObj.GetComponent <ParticleSystem>();
     explosionSource = explotionObj.GetComponent <AudioSource>();
     currentHealth   = maxHealth;
     healthBar.SetMaxHealth(maxHealth);
     numberAnimation = gameObject.GetComponent <NumberAnimation>();
     damageAmount    = 5.5f;
     decHealth       = false;
     restartStarted  = true;
     vibrate         = true;
     if ((PlayerPrefs.GetInt("ads", 0)) % 3 == 0 && Advertisement.IsReady())
     {
         Advertisement.Show();
     }
     else
     {
         PlayerPrefs.SetInt("ads", PlayerPrefs.GetInt("ads", 0) + 1);
     }
 }
예제 #3
0
 private void Start()
 {
     gameController  = GameObject.Find("Game Controller").GetComponent <GameController>();
     numberAnimation = GameObject.Find("Game Controller").GetComponent <NumberAnimation>();
 }