private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "Deadzone") { BrickSpawner bs = GetComponentInParent <BrickSpawner>(); bs.minusLives(); Destroy(gameObject); } }
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>(); }
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(); } }
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); } }
public SimulationController() { _ballLauncher = ServiceLocator.Get <BallLauncher>(); _brickSpawner = ServiceLocator.Get <BrickSpawner>(); _boardController = ServiceLocator.Get <BoardController>(); }
public void SetBrickSpawner(BrickSpawner spawner) { this.spawner = spawner; }