示例#1
0
 public void SetEnemyWeapon(WaveConfigurator waveConfigurator)
 {
     this.waveConfigurator = waveConfigurator;
     enemyIsAimer          = waveConfigurator.GetEnemyAimer();
     playerObject          = GameObject.Find("Player").gameObject;
     firingSpeed           = waveConfigurator.GetEnemyFiringSpeed();
     aimingSpeed           = waveConfigurator.GetEnemyAimingSpeed();
     projectileSpeed       = waveConfigurator.GetEnemyProjectileSpeed();
     projectileDamage      = waveConfigurator.GetEnemyProjectileDamage();
     projectilePrefab      = waveConfigurator.GetEnemyProjectilePrefab();
     canfire = firingSpeed;
 }
示例#2
0
 // When the enemy is spawned, pull all the settings from the WaveConfigurator for the current wave
 public void SetWaveConfig(WaveConfigurator waveConfig)
 {
     this.waveConfigurator = waveConfig;
     waypoints             = waveConfigurator.GetWaypoints();
     transform.position    = waypoints[0].transform.position;
     enemyHealth           = waveConfigurator.GetEnemyHealth();
     collisionDamage       = waveConfigurator.GetEnemyCollisionDamage();
     turningSpeed          = waveConfigurator.GetEnemyTurningSpeed();
     firingSpeed           = waveConfigurator.GetEnemyFiringSpeed();
     enemyIsAimer          = waveConfigurator.GetEnemyAimer();
     aimingSpeed           = waveConfigurator.GetEnemyAimingSpeed();
     projectileSpeed       = waveConfigurator.GetEnemyProjectileSpeed();
     projectileDamage      = waveConfigurator.GetEnemyProjectileDamage();
     projectilePrefab      = waveConfigurator.GetEnemyProjectilePrefab();
     scoreValue            = waveConfigurator.GetEnemyScoreValue();
     playerObject          = GameObject.Find("Player").gameObject;
     gameSession           = GameObject.Find("GameSession").gameObject.GetComponent <GameSession>();
     GetComponentInChildren <EnemyWeapon>().SetEnemyWeapon(waveConfig);
     GetComponent <DamageDealer>().SetDamage(collisionDamage);
 }