public static EnemyCountManager Instance() { if (!enemyCountManager) { enemyCountManager = FindObjectOfType(typeof(EnemyCountManager)) as EnemyCountManager; if (!enemyCountManager) { Debug.LogError("There needs to be one active EnemyCountManager script on a GameObject in your scene."); } } return(enemyCountManager); }
// Start is called before the first frame update void Start() { original = GetComponentInChildren <MeshRenderer>().material.color; if (GetComponentInParent <Room>()) { parentRoom = GetComponentInParent <Room>(); } else { Debug.LogError("No parent room found attached to enemy " + this.gameObject.name + ". Enemies need to be children of the room object."); } enemyCountManager = GameObject.FindGameObjectWithTag("EnemyCountMan").GetComponent <EnemyCountManager>(); }
// Start is called before the first frame update. void Start() { audio = GetComponent <AudioSource>(); if (!this.GetComponentInChildren <Door>()) { Debug.LogError("No doors are attached to this room. Each room requires at least one door child"); } // Add a NetworkRoomRelay to this Room _networkRoomRelay = gameObject.AddComponent <NetworkRoomRelay>(); doors = this.GetComponentsInChildren <Door>(); setUpDoorDirections(); // Get the roomTrigger. inRoomTrigger = GetComponentInChildren <EnterRoomTrigger>().gameObject.GetComponent <BoxCollider>(); // Get enemyCountManager. enemyCountManager = GameObject.FindGameObjectWithTag("EnemyCountMan").GetComponent <EnemyCountManager>(); // Get LevelGen from parent. levelGenMan = GameObject.FindGameObjectWithTag("LevelGenManager").GetComponent <LevelGeneration>(); playerPickUp = GameObject.FindGameObjectWithTag("Player").GetComponent <PickUpWeapon>(); populateEnemiesInRoom(); foreach (Door d in doors) { d.doorManager = levelGenMan.GetComponent <AudioSource>(); } allSpawnManagers = GetComponentInChildren <EnemySpawnManager>(); }
private void Awake() { enemyCountManager = EnemyCountManager.Instance(); SumEnemies(waves); //Debug.Log("No. Enemies In Spawner**************************************** " + sumEnemies.ToString()); }
protected override void Awake() { base.Awake(); enemyCountManager = EnemyCountManager.Instance(); //Debug.Log(isBabyEnemy); }
protected override void Awake() { base.Awake(); anim = GetComponentInChildren <Animator>(); enemyCountManager = EnemyCountManager.Instance(); }