Example #1
0
 void OnTriggerExit2D(Collider2D col)
 {
     if (col.tag == "Player")
     {
         if (inScoreBox)
         {
             SpriteScore.AddPoint();
             inScoreBox = false;
             audio.Play();
         }
     }
 }
Example #2
0
    void Start()
    {
        instanceScore = this;
        GameObject player_GO = GameObject.FindGameObjectWithTag("Player");

        if (player_GO == null)
        {
            Debug.LogError("Could not find a GameObject with tag 'Player'.");
        }
        theBird   = player_GO.GetComponent <RigidBodyJumpScript> ();
        score     = 0;
        highScore = PlayerPrefs.GetInt("HighScore", 0);
    }
Example #3
0
 void OnDestroy()
 {
     instanceScore = null;
     PlayerPrefs.SetInt("HighScore", highScore);
 }