Exemple #1
0
    // 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);
    }
Exemple #2
0
 // Start is called before the first frame update
 void Start()
 {
     respawnLoc    = GetComponent <Transform>().position;
     respwanPlayer = GameObject.FindGameObjectWithTag("Player").GetComponent <Respwan>();
     player        = GameObject.FindGameObjectWithTag("Player");
     // Debug.Log(player);
     // Debug.Log(respwanPlayer.location);
 }