// Start is called before the first frame update void Start() { if (GameObject.Find("EnemySpawner")) { myEnemySpawner = GameObject.Find("EnemySpawner").GetComponent <EnemySpawnerScript>(); } }
void Start() { hasDied = false; attackTimer = 0f; health = healthBarOne; if (transform.position.y == 2) { row = 1; } else if (transform.position.y == 0) { row = 2; } else if (transform.position.y == -2) { row = 3; } spawnerReference = GameObject.FindGameObjectWithTag("Spawner"); enemySpawnerScript = spawnerReference.GetComponent <EnemySpawnerScript>(); canAttack = false; velocity = new Vector3(movementSpeed, 0f, 0f); }
// Start is called before the first frame update void Start() { // Get Kessel if (GameObject.FindGameObjectWithTag("Kessel")) { kesselscript = Kessel.GetComponent <Extraleben_kessel>(); } // Get ability scripts abilty_pushforce = GetComponent <PushForce>(); abilty_slowmotion = GetComponent <TimeManager>(); // Get weapons weapon_deagle_gun = weapon_deagle.GetComponent <Gun>(); weapon_ar_gun = weapon_ar.GetComponent <Gun>(); weapon_shotgun_gun = weapon_shotgun.GetComponent <Gun>(); weapon_flammenwerfer_gun = weapon_flammenwerfer.GetComponent <Gun>(); weapon_raketenwerfer_gun = weapon_raketenwerfer.GetComponent <Gun>(); if (GameObject.FindGameObjectWithTag("Spawner")) { Spawner = GameObject.FindGameObjectWithTag("Spawner").GetComponent <EnemySpawnerScript>(); } LoadPlayer(); maxhealth = health; healthBar.SetMaxHealth((int)maxhealth); }
void Start() { enemySpawner = gameObject.GetComponent <EnemySpawnerScript>(); playerCont = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerContoller>(); // light source location init // level 1 lightSourceLocation[0, 0] = new Vector3(24, 0, 0); // level 2 lightSourceLocation[1, 0] = new Vector3(-18, 0, 27); // level 3 lightSourceLocation[2, 0] = new Vector3(-34, 0, 0); // level 4 lightSourceLocation[3, 0] = new Vector3(22, 0, 27); lightSourceLocation[4, 0] = new Vector3(0, 0, 0); lightSourceLocation[5, 0] = new Vector3(0, 0, -11); lightSourceLocation[6, 0] = new Vector3(0, 0, -27); lightSourceLocation[7, 0] = new Vector3(0, 0, 46); lightSourceLocation[8, 0] = new Vector3(0, 0, -45); }
// Use this for initialization void Start() { script = GameObject.FindGameObjectWithTag("EnemySpawner").GetComponent <EnemySpawnerScript> (); this.health = script.health; this.waveAmount = 5; this.speed = script.speed; this.gameController = GameObject.Find("Main Camera").GetComponent <GameController> (); }
void StartWave() { enemySpawner = GameObject.Find("Enemy Spawner").GetComponent <EnemySpawnerScript>(); SpawnEnemy(); waveFinished = true; spawning = true; }
void Awake() { _player = GameObject.Find(Constants.Game.PLAYER_NAME); _pickupSpawner = GameObject.Find("Planet").GetComponent<PickupSpawner>(); enemySpawner = FindObjectOfType<EnemySpawnerScript>(); scoreManager = FindObjectOfType<HUDScoreScript>(); hudMessage = GameObject.Find("HUDMessageCenter").GetComponent<HUDMessageScript>(); }
// Use this for initialization void Awake() { _player = GameObject.Find("Rotator"); _radarPlane = GameObject.Find("RadarPlane"); //_radarCircle = transform.FindChild("Circle").GetComponentInChildren<Image>(); _shipsToTrack = new List<GameObject>(); _indicatorList = new List<GameObject>(); _spawner = GameObject.Find("Planet").GetComponent<EnemySpawnerScript>(); _enemySpawnDistance = _spawner.spawnHeight; StartCoroutine(TrackPointDistance()); }
void Awake () { _player = GameObject.FindWithTag("Player"); _hitConfirm = _player.GetComponents<AudioSource>()[1]; _planet = GameObject.FindGameObjectWithTag("Planet"); _radar = GameObject.Find("RingRadar").GetComponent<RingRadarScript>(); _spawner = _planet.GetComponent<EnemySpawnerScript>(); scoreManager = FindObjectOfType<HUDScoreScript>(); }
void Awake() { player = GameObject.FindGameObjectWithTag("Player"); enemySpawnerScript = enemySpawner.GetComponent <EnemySpawnerScript> (); playerScript = player.GetComponent <PlayerScript>(); // Reset the score score = 0; // Reset enemies killed enemiesKilledCounter = 0; }
// Use this for initialization void Start() { TimeOfStart = Time.time; scoreKeeper = (ScoreKeeper)GameObject.Find("GameController").GetComponent(typeof(ScoreKeeper)); groundSpawner = (GroundSpawnScript)GameObject.Find("GroundSpawner").GetComponent(typeof(GroundSpawnScript)); enemySpawner = (EnemySpawnerScript)GameObject.Find("EnemySpawner").GetComponent(typeof(EnemySpawnerScript)); enemySpawner.enabled = false; shipController = (SpaceShipController)GameObject.Find("SpaceShip").GetComponent(typeof(SpaceShipController)); maxObstacleSpawnDuration = ObstacleSpawnDuration; }
// Use this for initialization void Start() { bulletScript = bullet.GetComponent <BulletScript> (); HUD = GameObject.FindGameObjectWithTag("Hud"); hudScript = HUD.GetComponent <HUDScript> (); enemySpawner = GameObject.FindGameObjectWithTag("EnemySpawner"); enemySpawnerScript = enemySpawner.GetComponent <EnemySpawnerScript> (); }
void Start() { myPlayerManager = GameObject.Find("Player").GetComponent <PlayerManager>(); if (GameObject.FindGameObjectWithTag("Spawner")) { spawner = GameObject.FindGameObjectWithTag("Spawner").GetComponent <EnemySpawnerScript>(); health = health * spawner.difficulty; max_health = health; } }
public void InitializeMe(string name, GameObject tile, GameBoardScript gameBoard, EnemySpawnerScript spawner) { myPool = spawner; myOffSetY = Random.Range(-0.4f, 0.4f); myOffSetX = Random.Range(-0.4f, 0.4f); board = gameBoard; health = 15; moveSpeed = 1; curTile = tile; curDirection = curTile.GetComponent <TileScript>().GetMyDirection(); }
void Start() { GameObject[] enemySpawners = GameObject.FindGameObjectsWithTag("Enemy Spawner"); foreach (var spawner in enemySpawners) { enemySpawnerScript = spawner.GetComponent<EnemySpawnerScript>(); enemySpawnerScript.StartTimer(); } gameState = GameState.Running; }
public EnemySpawnerScript() { if (instance == null) { instance = this; } else { Debug.LogError("Singleton EnemySpawnerScript Already Exists"); } }
// Use this for initialization void Start() { _hud = GameObject.Find("HUDMessage").GetComponent<HUDMessageScript>(); _player = GameObject.Find("Rotator"); _planet = GameObject.Find("Planet"); _shipSpawner = _planet.GetComponent<EnemySpawnerScript>(); _playerMovementScript = GameObject.FindWithTag("Player").GetComponent<PlayerMovement>(); _playerInv = GameObject.FindWithTag("Player").GetComponent<InventoryScript>(); _item = transform.GetChild(0); _finalDist = _planet.transform.localScale.x/2f; //raio do planeta transform.forward = (_planet.transform.position - transform.position).normalized; //transform.rotation = Quaternion.LookRotation((_player.transform.position - transform.position)); StartCoroutine(RunAnimation()); }
void Awake() { ability_1 = GameObject.Find("ability1"); ability_2 = GameObject.Find("ability2"); ability_3 = GameObject.Find("ability3"); ability_4 = GameObject.Find("ability4"); CurrentEnemiesUI = GameObject.Find("CurrentEnemiesUI").GetComponent <Text>(); CurrentHealthUI = GameObject.Find("health").GetComponent <Text>(); CurrentExtraLifes = GameObject.Find("extralife").GetComponent <Text>(); myPlayerManager = GameObject.Find("Player").GetComponent <PlayerManager>(); if (GameObject.FindGameObjectWithTag("Spawner")) { myEnemySpawnerScript = GameObject.FindGameObjectWithTag("Spawner").GetComponent <EnemySpawnerScript>(); } }
void Start() { // Get access to the scripts of the player and the enemy spawner. playerScript = player.GetComponent <PlayerScript>(); enemySpawnerScript = enemySpawner.GetComponent <EnemySpawnerScript>(); // Get access to the elements of the GUI. txtTimer = GameObject.Find("Timer").GetComponent <Text>(); txtLives = GameObject.Find("NumberOfLives").GetComponent <Text>(); txtScore = GameObject.Find("Score").GetComponent <Text>(); txtHighestScore = GameObject.Find("HighestScore").GetComponent <Text>(); txtGameOver = GameObject.Find("GameOver").GetComponent <Text>(); btnReplay = GameObject.Find("ReplayButton"); // Hide the "Game Over" message and the "Replay" button. txtGameOver.enabled = false; btnReplay.SetActive(false); }
// Use this for initialization void Start() { enemySpawner = GameObject.Find("EnemySpawner").GetComponent <EnemySpawnerScript>(); scoreText = GetComponent <Text>(); scoreText.text = currentScore.ToString(); }
private void AddEnemy( EnemySpawnerScript spawner ) { bool isLeft = spawner == leftSpawner; EnemyScript enemy = spawner.SpawnEnemy(); List<EnemyScript> list = isLeft ? leftEnemies : rightEnemies; list.Add( enemy ); EnemyScript currentClosest = isLeft ? nearestLeftEnemy : nearestRightEnemy; float currentDistance = currentClosest == null ? float.MaxValue : getDistanceToPlayer( currentClosest ); float newDistance = getDistanceToPlayer( enemy ); if( newDistance >= currentDistance ) return; if( isLeft ) nearestLeftEnemy = enemy; else nearestRightEnemy = enemy; }
private void Start() { enemySpawner = FindObjectOfType <EnemySpawnerScript>(); Startevel(); }
private IEnumerator SpawnRoutine( EnemySpawnerScript spawner ) { if( spawner == null ) yield break; float min = spawner.SpawnInterval.Min; float max = spawner.SpawnInterval.Max; float delay = Random.Range( min, max ) / 1000; yield return new WaitForSeconds( delay ); if( EnemyCount < maxEnemies ) AddEnemy( spawner ); StartCoroutine( SpawnRoutine( spawner ) ); }
public void enemyKilled() { enemyKillCountTotal++; enemySpawner = GetComponent <EnemySpawnerScript>(); enemySpawner.enemyDead(); }