public void Start() { gameManager = GetComponentInParent <CannonizerManager>(); SetParentTo = gameManager.transform; enemySpawnner = new EnemySpawnner( SpawnPoints, DirectionsForEnemiesToGo, PrefabsToSpawn, SetParentTo, SpawnFrequencyInSeconds, MovementSpeed); gameManager.EnemySpawnnerReference = enemySpawnner; }
private void Start() { spriteOutline = GetComponent <SpriteOutline>(); spriteOutline.outlineSize = 9; spriteOutline.color = Color.green; gameManager = GetComponentInParent <CannonizerManager>(); targetRotation = transform.rotation; ballDirection = Vector2.left; canFire = true; gameManager.ButtonEvents.OnUpButtonPressed += HandleUpButtonPressed; gameManager.ButtonEvents.OnDownButtonPressed += HandleDownButtonPressed; gameManager.ButtonEvents.OnLeftButtonPressed += HandleLeftButtonPressed; gameManager.ButtonEvents.OnRightButtonPressed += HandleRightButtonPressed; gameManager.ButtonEvents.OnActionButtonStateChanged += HandleActionButtonPressed; }
private void Start() { gameManager = GetComponentInParent <CannonizerManager>(); }