// Start is called before the first frame update void Start() { timeManager = timeDisplay.GetComponent <TimeManager>(); finalTimeText = GetComponent <Text>(); totalsTrackerObject = GameObject.FindGameObjectWithTag("TotalsTracker"); totalsTracker = totalsTrackerObject.GetComponent <TotalsTracker>(); }
// Start is called before the first frame update void Start() { firingNoise = GetComponent <AudioSource>(); coolDown = false; cooldownDisplay.SetActive(false); totalsTrackerObject = GameObject.FindGameObjectWithTag("TotalsTracker"); totalsTracker = totalsTrackerObject.GetComponent <TotalsTracker>(); }
// Start is called before the first frame update void Start() { totalsTrackerObject = GameObject.FindGameObjectWithTag("TotalsTracker"); totalsTracker = totalsTrackerObject.GetComponent <TotalsTracker>(); totalTimeText = totalTime.GetComponent <Text>(); totalDamageText = totalDamage.GetComponent <Text>(); avgDamageText = avgDamage.GetComponent <Text>(); avgTimeText = avgTime.GetComponent <Text>(); totalTimeString = totalsTracker.TotalTime.ToString($"F{decimalPlaces}", CultureInfo.InvariantCulture); accuracyText = accuracy.GetComponent <Text>(); ShowTotals(); }
private void Start() { moveForward = GetComponent <MoveForward>(); enemyLaunchProjectile = GetComponentInChildren <EnemyLaunchProjectile>(); hitSound = chassis.GetComponent <AudioSource>(); enemyTurretAim = GetComponentInChildren <EnemyTurretAim>(); boxCollider = GetComponent <BoxCollider>(); isAlreadyHit = false; scoreDisplay = GameObject.Find("Score Display"); scoreManager = scoreDisplay.GetComponent <ScoreManager>(); totalsTrackerObject = GameObject.FindGameObjectWithTag("TotalsTracker"); totalsTracker = totalsTrackerObject.GetComponent <TotalsTracker>(); }
// Start is called before the first frame update void Start() { playerController = GetComponentInParent <PlayerController>(); enemySpawnerScript = enemySpawner.GetComponent <EnemySpawnManager>(); Launcher = GetComponentInChildren <LaunchProjectile>(); rotateTurret = GetComponentInChildren <RotateTurret>(); medkitSpawnerScript = medkitSpawner.GetComponent <MedkitSpawnManager>(); healthText = healthDisplay.GetComponent <Text>(); Health = maxHealth; healthText.text = $"Structural Integrity: {Health}%"; finalScoreDisplayer = finalScoreDisplay.GetComponent <FinalScoreDisplay>(); finalTimeDisplayer = finalTimeDisplay.GetComponent <FinalTimeDisplay>(); hitSound = GetComponent <AudioSource>(); gameOver = false; lowHealthNoise = healthDisplay.GetComponent <AudioSource>(); repairNoise = medkitSpawner.GetComponent <AudioSource>(); engineNoise = tankParent.GetComponent <AudioSource>(); totalsTrackerObject = GameObject.FindGameObjectWithTag("TotalsTracker"); totalsTracker = totalsTrackerObject.GetComponent <TotalsTracker>(); meshRenderer = GetComponent <MeshRenderer>(); turretMeshRenderer = turret.GetComponent <MeshRenderer>(); MakeTankGreen(); musicManager = musicManagerObject.GetComponent <MusicManager>(); }