Exemplo n.º 1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "Deadzone")
     {
         BrickSpawner bs = GetComponentInParent <BrickSpawner>();
         bs.minusLives();
         Destroy(gameObject);
     }
 }
Exemplo n.º 2
0
 void Awake()
 {
     PScolor  = standardPS.colorOverLifetime;
     tracker  = GameObject.FindWithTag("CollisionTracker").GetComponent <CollisionTracker> ();
     sr       = GetComponent <SpriteRenderer>();
     spawner  = GameObject.FindWithTag("BrickSpawner").GetComponent <BrickSpawner> ();
     gameInit = GameObject.FindWithTag("GameInitializer").GetComponent <GameInitializer> ();
     hb       = GetComponent <HazardBrick>();
     gm       = GameObject.FindWithTag("GameManager").GetComponent <GameSceneManager>();
     hc       = GameObject.FindWithTag("HazardController").GetComponent <HazardController>();
 }
Exemplo n.º 3
0
    protected override void SetUp()
    {
        bs = FindObjectOfType <BrickSpawner>();
        gs = GameObject.FindWithTag("GameSettings").GetComponent <GameSettings>();
        if (gs.currentGameMode == GameModes.TIMED)
        {
            timer = GameObject.FindWithTag("Timer").GetComponent <Timer>();
            if (timer == null)
            {
                Debug.LogError("FreezeAbility::SetUp timer is null");
            }
//			timer.Freeze();
        }
    }
Exemplo n.º 4
0
    private void Awake()
    {
        Instance = this;

        m_LevelOfFinalBrick = PlayerPrefs.GetInt("level_of_final_brick", 1);

        m_BricksRow = new List <BricksRow>();

        // generate rows of bricks on the scene
        for (int i = 0; i < m_SpawningRows; i++)
        {
            m_BricksRow.Add(Instantiate(m_BricksRowPrefab, transform.parent, false));
            m_BricksRow[m_BricksRow.Count - 1].transform.localPosition = new Vector3(0, m_SpawningTopPosition, 0);
            m_BricksRow[m_BricksRow.Count - 1].gameObject.SetActive(false);
        }
    }
Exemplo n.º 5
0
 public SimulationController()
 {
     _ballLauncher    = ServiceLocator.Get <BallLauncher>();
     _brickSpawner    = ServiceLocator.Get <BrickSpawner>();
     _boardController = ServiceLocator.Get <BoardController>();
 }
Exemplo n.º 6
0
 public void SetBrickSpawner(BrickSpawner spawner)
 {
     this.spawner = spawner;
 }