Beispiel #1
0
    void Start()
    {
        anim          = GetComponent <Animator>();
        spawnerMaster = GameObject.FindGameObjectWithTag("SpawnerMaster").GetComponent <SpawnerMaster>();
        rb            = GetComponent <Rigidbody>();
        timeBtwSpawns = Random.Range(minTime, maxTime);


        spawnerMaster.headsInGame++;
        timeBtwNextAttacks = Random.Range(25, 35);
        firstShotYes       = Random.Range(1, 4);
        if (firstShotYes == 1)
        {
            firstShot = true;
        }
        else if (firstShotYes != 1)
        {
            firstShot = false;
        }

        if (firstShot == true)
        {
            Spawn();
            firstShotYes = Random.Range(1, 4);
        }
        else if (firstShot == false)
        {
            firstShotYes = Random.Range(1, 4);
        }
    }
Beispiel #2
0
    private void Start()
    {
        spawnMaster              = GetComponent <SpawnerMaster>();
        spawnMaster.OnWaveEnd   += OnWaveEnd;
        spawnMaster.OnWaveStart += OnWaveStart;

        unit = GameObject.FindGameObjectWithTag("Player").GetComponent <Upgradeable>();
    }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     _animator        = GetComponent <Animator>();
     _rigidbody       = GetComponent <Rigidbody>();
     _spawnerMaster   = GameObject.FindGameObjectWithTag("SpawnerMaster").GetComponent <SpawnerMaster>();
     _playerTransform = GameObject.FindGameObjectWithTag("Player").transform;
     _playerMelee     = GameObject.FindGameObjectWithTag("Player").GetComponent <Melee>();
     _health          = MaxHealth;
 }
Beispiel #4
0
    private void Start()
    {
        fleetManager             = GetComponent <FleetManager>();
        fleetManager.OnGameOver += OnGameOver;

        spawner              = GetComponent <SpawnerMaster>();
        spawner.OnPlayerWin += OnPlayerWin;
        spawner.OnLevelShow += OnLevelShow;
        spawner.OnLevelHide += OnLevelHide;
        spawner.OnBossSpawn += OnBossSpawn;
        spawner.OnBossDeath += OnBossDeath;
    }
Beispiel #5
0
 // Use this for initialization
 void Start()
 {
     _spawnerMaster = GameObject.FindGameObjectWithTag("SpawnerMaster").GetComponent <SpawnerMaster>();
     if (_instance == null)
     {
         _instance = this;
         DontDestroyOnLoad(gameObject);
         _counting    = true;
         _scorePoints = 0;
     }
     else if (_instance != this)
     {
         Destroy(gameObject);
     }
 }
Beispiel #6
0
 // Use this for initialization
 void Start()
 {
     if (_instance == null)
     {
         _instance = this;
         DontDestroyOnLoad(gameObject);
         AddObectPool(EnemyPrefab, EnemyInitialAmount);
         AddObectPool(EnergyOrbPrefab, EnergyOrbInitialAmount);
         ObjectPool[] objectPools = GetComponents <ObjectPool>();
         _enemyPool = (from objectPool in objectPools
                       where objectPool.ObjectPrefab.Equals(EnemyPrefab)
                       select objectPool).First();
         _energyOrbPool = (from objectPool in objectPools
                           where objectPool.ObjectPrefab.Equals(EnergyOrbPrefab)
                           select objectPool).First();
     }
     else
     {
         if (_instance != this)
         {
             Destroy(gameObject);
         }
     }
 }
 // Use this for initialization
 void Start()
 {
     _player        = GameObject.FindGameObjectWithTag("Player").transform;
     _spawnerMaster = GameObject.FindGameObjectWithTag("SpawnerMaster").GetComponent <SpawnerMaster>();
 }
Beispiel #8
0
 void Start()
 {
     spawnMaster            = GetComponent <SpawnerMaster>();
     spawnMaster.OnWaveEnd += OnwaveEnd;
 }
Beispiel #9
0
 void Start()
 {
     _spawnerMaster = GameObject.FindGameObjectWithTag("SpawnerMaster").GetComponent <SpawnerMaster>();
 }