// Start is called before the first frame update void Start() { hex = GameObject.Find("Hex").GetComponent <SetAllHexagonsToDefault>(); gamEnd = GameObject.Find("Enemies").GetComponent <GameEnd>(); respawn = GameObject.Find("Player Respawn"); blackOut.SetActive(false); rend = GetComponent <Renderer>(); player = GetComponent <Player>().data; respawnScript = GetComponent <Respwan>(); playerLight = GetComponent <PlayerLightManager>(); rb = GetComponent <Rigidbody>(); cam = Camera.main; UnityEngine.Rendering.VolumeProfile volumeProfile = cam.GetComponent <UnityEngine.Rendering.Volume>()?.profile; if (!volumeProfile) { throw new System.NullReferenceException(nameof(UnityEngine.Rendering.VolumeProfile)); } if (!volumeProfile.TryGet(out vignette)) { throw new System.NullReferenceException(nameof(vignette)); } vignette.intensity.Override(0f); if (!volumeProfile.TryGet(out colorAdj)) { throw new System.NullReferenceException(nameof(colorAdj)); } colorAdj.saturation.Override(0f); fadeOut.SetActive(false); }
void Start() { playerLight = GetComponent <PlayerLightManager>(); playerHealth = GetComponent <PlayerLifeManager>(); InvokeRepeating("ConsumeEnergy", 2f, 1f); InvokeRepeating("ConsumeHealth", 2f, 1f); }
private void Start() { lightManager = GetComponent <PlayerLightManager>(); energyManager = GetComponent <PlayerEnergyManager>(); shop = Shop.instance; spike = GetComponentInChildren <PlayerDamageDealer>(); movementManager = GetComponent <PlayerMovement>(); initialPlayerSpeed = movementManager.speed; }
private void Awake() { // Ensure that there is only one instance of the PlayerManager. if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } movement = GetComponent <SubmarineMovement>(); camFX = GetComponentInChildren <CameraFX>(); playerLightManager = GetComponentInChildren <PlayerLightManager>(); playerSoundManager = GetComponentInChildren <PlayerSoundManager>(); dashboardDamageSprite = GetComponentInChildren <SpriteRenderer>(); }