private void Start() { //expensive method, use with caution PlayerCharacter player = FindObjectOfType <PlayerCharacter>(); if (player) { m_PlayerTarget = player.gameObject; m_PlayerStressLevel = player.GetComponent <StressLevel>(); } m_Health = GetComponent <Health>(); m_Timer = m_FireTimer; }
void Start() { //find an object of type player PlayerCharacter player = FindObjectOfType <PlayerCharacter>(); //find an object of type level m_LevelLogic = FindObjectOfType <LevelLogic>(); //find the director m_Director = FindObjectOfType <Director>(); //if player exist acces its health and shootingbehaviour script and store it if (player) { m_PlayerHealth = player.GetComponent <Health>(); m_StressLevel = player.GetComponent <StressLevel>(); m_PlayerShootingBehaviour = player.GetComponent <ShootingBehaviour>(); } }
private void Awake() { //searches for the LevelLogic in our level and stores it m_Level = FindObjectOfType <LevelLogic>(); m_StressLevel = FindObjectOfType <StressLevel>(); m_MaxStressBuildUp = m_StressLevel.CurrentStress; m_SpawnPoints.Add(m_PickUpSpawn1); m_SpawnPoints.Add(m_PickUpSpawn2); m_SpawnPoints.Add(m_PickUpSpawn3); m_SpawnPoints.Add(m_PickUpSpawn4); m_SpawnPoints.Add(m_PickUpSpawn5); m_SpawnPoints.Add(m_PickUpSpawn6); foreach (PickUpSpawner spawnPoint in m_SpawnPoints) { spawnPoint.SpawnPickUp(); } }
protected override void Awake() { base.Awake(); m_CursorMovementPlane = new Plane(Vector3.up, transform.position); m_StressLevel = FindObjectOfType <StressLevel>(); }