Skip to content

Instantly share code, notes, and snippets.

Created August 10, 2016 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/22db9e4d173fb116d69eeafdb559a02b to your computer and use it in GitHub Desktop.
Save anonymous/22db9e4d173fb116d69eeafdb559a02b to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public class Bricks : MonoBehaviour {
public int maxHits;
private int TimesHit;
private LevelManager levelManager;
// Use this for initialization
void Start () {
levelManager=GameObject.FindObjectOfType<LevelManager>();
TimesHit=0;
}
// Update is called once per frame
void Update () {
}
void OnCollisionEnter2D (Collision2D collision){
TimesHit++;
SimulateWin ();
}
//TODO Remove this method once we can actually win!
void SimulateWin(){
levelManager.LoadNextLevel ();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment