void Start () { spawner = GetComponent<EnemySpawner>(); details = GetComponent<FormationDetails>(); enemyBounds = GameObject.Find("EnemyZone").GetComponent<BoundingZone>(); curSpeed = new Vector2(0.0f, 0.0f); }
void Start() { gameState = GameObject.FindObjectOfType<GameState>(); enemyTracker = GameObject.FindObjectOfType<EnemyTracker>(); enemyZone = GameObject.Find("EnemyZone").GetComponent<BoundingZone>(); SpawnNextFormation(); }
private void Start() { spriteRenderer = GetComponent<SpriteRenderer>(); playerBounds = GameObject.Find("PlayerZone").GetComponent<BoundingZone>(); transform.position = playerBounds.transform.position; halfSpriteWidth = spriteRenderer.bounds.extents.x; halfSpriteHeight = spriteRenderer.bounds.extents.y; GetWeapons(); }
public static GameObject GetNewWave(GameObject wavePrefab, int difficultyMod, BoundingZone spawnZone) { GameObject newFormation = MonoBehaviour.Instantiate(wavePrefab, wavePrefab.transform.position, Quaternion.identity) as GameObject; FormationDetails details = newFormation.GetComponent<FormationDetails>(); details.Difficulty = difficultyMod; FormationController controller = newFormation.GetComponent<FormationController>(); float xPos = spawnZone.transform.position.x; float yPos = spawnZone.YBoundsTop - details.Height / 2.0f; newFormation.transform.position = new Vector3(xPos, yPos, wavePrefab.transform.position.z); return newFormation; }
// Use this for initialization void Start () { enemyBounds = GameObject.Find("EnemyZone").GetComponent<BoundingZone>(); }