예제 #1
0
	void Start () 
	{
        spawner = GetComponent<EnemySpawner>();
		details = GetComponent<FormationDetails>();
        enemyBounds = GameObject.Find("EnemyZone").GetComponent<BoundingZone>();
		curSpeed = new Vector2(0.0f, 0.0f);
	}
예제 #2
0
 void Start()
 {
     gameState = GameObject.FindObjectOfType<GameState>();
     enemyTracker = GameObject.FindObjectOfType<EnemyTracker>();
     enemyZone = GameObject.Find("EnemyZone").GetComponent<BoundingZone>();
     SpawnNextFormation();
 }
예제 #3
0
	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();
	}
예제 #4
0
 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>();
    }