private void Awake() { npcDeathEventChannel = GameObject.FindWithTag(Tags.GameController).GetComponent <NpcDeathEventChannel>(); var aSources = GetComponents(typeof(AudioSource)); audioSource = (AudioSource)aSources[6]; }
private void Awake() { npcDeathEventChannel = GameObject.FindWithTag(Tags.GameController).GetComponent <NpcDeathEventChannel>(); pauseObjects = GameObject.FindGameObjectWithTag(Tags.ShowOnPause); endGameObjects = GameObject.FindGameObjectWithTag(Tags.ShowOnEnd); endGameDetails = GameObject.FindGameObjectWithTag(Tags.EndGameDetails).GetComponent <Text>(); isGamePaused = false; numberOfNpcs = GameValues.NbOfEnemies; timePassedInSeconds = 0.0f; timePassed = ""; UnpauseGame(); StartGame(); }
private void InitializeComponent() { health = GetComponent <Health>(); mover = GetComponent <Mover>(); destroyer = GetComponent <RootDestroyer>(); var rootTransform = transform.root; npcSensorSight = rootTransform.GetComponentInChildren <NpcSensorSight>(); npcSensorSound = rootTransform.GetComponentInChildren <NpcSensorSound>(); hitSensor = rootTransform.GetComponentInChildren <HitSensor>(); handController = hand.GetComponent <HandController>(); npcDeathEventChannel = GameObject.FindWithTag(Tags.GameController).GetComponent <NpcDeathEventChannel>(); hitEventChannel = GameObject.FindWithTag(Tags.GameController).GetComponent <HitEventChannel>(); }