private void Awake() { if (instance == null) { instance = this; } }
public static void EnemyDie() { lock (Lock) { count--; Debug.Log(EnemyCounter.getCount()); } }
// Use this for initialization void Start() { waves = GetComponent <Waves>(); mana = GetComponent <Mana>(); enemyCounter = GetComponent <EnemyCounter>(); StartCoroutine("tutorial"); }
void Start() { mana = GetComponent <Mana>(); waves = GetComponent <Waves>(); enemies = GetComponent <EnemyCounter>(); waves.StartCoroutine("spawnWaves"); }
// Update is called once per frame void Update() { EnemyCounter script = room.GetComponent <EnemyCounter>(); if (script.enemyCount == 0) { Destroy(gameObject); } }
// Use this for initialization void Start() { textyPoo = FindObjectOfType <ManaText>(); mana = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <Mana>(); enemycounter = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <EnemyCounter>(); sm = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <SM_tower_defense>(); nav = GetComponent <EnemyNavigation>(); enemycounter.register(gameObject); }
// Use this for initialization void Start() { bow = GameObject.FindGameObjectWithTag("Bow").GetComponent <ArrowShoot>(); player = GameObject.FindGameObjectWithTag("Player"); arrowTeleport = transform.GetChild(0); enemyCounter = GameObject.Find("Enemies").GetComponent <EnemyCounter>(); effectLight.enabled = false; }
private void OnTriggerEnter2D(Collider2D collision) { if (EnemyCounter.isTheLevelComplete()) { if (collision.tag == "Player") { loader.GetComponent <levelLoder>().LoadNextLevel(); } } }
void Awake() { anim = GetComponent<Animator>(); enemyAudio = GetComponent<AudioSource>(); hitParticles = GetComponentInChildren<ParticleSystem>(); capsuleCollider = GetComponent<CapsuleCollider>(); counter = GameObject.Find("EnemyManager").GetComponent<EnemyCounter>(); currentHealth = startingHealth; }
void Start() { hearAnnouncements(); announce("Press Enter to begin!"); mana = GetComponent <Mana>(); waves = GetComponent <Waves>(); enemies = GetComponent <EnemyCounter>(); displayMana(); displayScore(); Time.timeScale = 1; }
private void Start() { if (m_Player == null) { m_Player = FindObjectOfType <Player>(); } if (m_EnemyCounter == null) { m_EnemyCounter = FindObjectOfType <EnemyCounter>(); } m_EnemyCounter.OnEnemyWavesChanged += UpdateEnemyWaveTextField; m_EnemyCounter.OnActiveEnemiesChanged += UpdateActiveEnemiesTextField; m_EnemyCounter.OnEnemyReinforcementsChanged += UpdateEnemyReinforcementTextField; }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } foreach (var o in enemyGobjs) { allEnemies.Add(o.GetComponent <IEnemy>()); } Debug.Log($"敵人數: {allEnemies.Count}"); }
public void DeathSequence() { //-----GET VALUE FROM STORAGE COMPONENT EnemyValue enemyValue = GetComponent <EnemyValue>(); //-----INCREMENT SCORE ProgressTracker.IncrementScore(enemyValue.scoreValue); //-----ADD COINS if (enemyValue.coinValue > 0) { ProgressTracker.IncrementCoins(enemyValue.coinValue); } //-----STOP ALLIGNING WITH SLOT GetComponent <EnemyMovement>().StopAllignment(); //-----GET & FREE PREVIOUS SLOT Utils.Directions occupiedSlotDirection = transform.parent.transform.GetComponent <TrackSlotFinal>().GetDirection(); transform.parent.transform.GetComponent <TrackSlot>().FreeSlot(); //-----DECREMENT ENEMY COUNT EnemyCounter.DecrementCounter(); //-----INCREMENT CHARGING SPEED EnemyValue.IncrementCharge(); //-----DECREMENT SPAWN COOLDOWN EnemySpawnCoordinator.DecrementSpawnCooldown(); //-----INCREMENT ATTACK MUSIC PITCH FindObjectOfType <MusicController>().IncrementPitch(); //-----PLAY ANIMATION GetComponent <EnemyDeathAnimator>().PlayDeathAnimation(occupiedSlotDirection); //-----PLAY DEATH SFX GetComponent <EnemyAudioController>().PlayEnemyDeathSFX(); //-----SHAKE CAMERA Camera.main.GetComponent <CameraShaker>().ShakeCam(cameraShakeDuration, cameraShakeMagnitude); }