void Start() { _lm = GameObject.FindWithTag("LoadManagerTag").GetComponent <LoadManager>(); _scene = SceneManager.GetActiveScene().buildIndex; _sceneno = _lm._levelSelected; if (_scene != 1) { camera1 = GameObject.FindWithTag("MainCamera"); if (_scene == 5 || _scene == 8) { camera2 = GameObject.Find("HoverCarCamera"); _hpm = GameObject.Find("HoverCarManager").GetComponent <HoverPlayerManager>(); } } if (_scene == 1) { camera1 = GameObject.Find("CutsceneCam1"); camera2 = GameObject.Find("CutsceneCam2"); } if (Flare == null) { Flare = GetComponent <LensFlare>(); } if (Flare == null) { Debug.LogWarning("No LensFlare on " + name + ", destroying.", this); Destroy(this); return; } Size = Flare.brightness; }
void Start() { _scene = SceneManager.GetActiveScene().buildIndex; //Target the player _target = GameObject.FindWithTag("Player").transform; _targetStats = GameObject.FindWithTag("Player").GetComponent <PlayerStats>(); if (_scene == 5 || _scene == 8) { _target2 = GameObject.FindWithTag("Buggy").transform; _targetStats2 = GameObject.Find("HoverCarManager").GetComponent <HoverPlayerManager>(); } //Set the fire and electrical sounds _playerElec = GameObject.Find("ElectricalSound").GetComponent <AudioSource>(); _playerFire = GameObject.Find("FireDamageSound").GetComponent <AudioSource>(); _LevelManager = GameObject.Find("LEVELMANAGER").GetComponent <LevelManager>(); //Get the start position and set the roam radius to be within 10m _startPos = gameObject.transform.position; _roamRadius = 10f; //Set the damage timer above the time threshold for the entity to being targetting the player //to prevent the entity from targetting before the player damages the entity at the start of the level _dmgTimer = 15f; //Determine multiplier if (_LevelManager._difficultyScore <= 3) { _multiplier = 0.6f; } if (_LevelManager._difficultyScore > 3 && _LevelManager._difficultyScore <= 6) { _multiplier = 0.8f; } if (_LevelManager._difficultyScore > 6 && _LevelManager._difficultyScore <= 10) { _multiplier = 1.0f; } if (_LevelManager._difficultyScore > 10 && _LevelManager._difficultyScore <= 14) { _multiplier = 1.2f; } if (_LevelManager._difficultyScore == 15) { _multiplier = 1.5f; } //Use multipliers _entdmg = _entbasedmg * _multiplier; _enthealth = _entbasehealth * _multiplier; _targetdistmin = _targetdistminbase * _multiplier; _targetdistminHover = _targetdistminbase * _multiplier * 5; //Set the NavMeshAgent stats equivalent to the entity's abilities gameObject.GetComponent <NavMeshAgent>().angularSpeed = _entrotspd * _multiplier; gameObject.GetComponent <NavMeshAgent>().speed = _entspd * _multiplier; gameObject.GetComponent <NavMeshAgent>().acceleration = 5; _dialogueTimerReq = 5.0f; }
void Start() { _scene = SceneManager.GetActiveScene().buildIndex; if (_scene != 1) { _player = GameObject.FindWithTag("Player"); if (_scene == 5 || _scene == 8) { _buggy = GameObject.FindWithTag("Buggy"); _hpm = GameObject.Find("HoverCarManager").GetComponent <HoverPlayerManager>(); } } _cm = GameObject.Find("CUTSCENEMANAGER").GetComponent <CutsceneManager>(); }