0
\$\begingroup\$

I have some glowing objects in my scene, that with HDR off are inactive, so i want to add the option to turn HDR off in my settings to increase performance.

If the code bellow is correct, what should i write inside get component:

public GameObject currentActiveCamera;
currentActiveCamera.GetComponent<???>.hdr = false;
\$\endgroup\$
3
  • \$\begingroup\$ Shows lack of research. Just searching for camera and going down to HDR part in Unity Docs fixes this problem. \$\endgroup\$ Dec 4, 2016 at 4:49
  • \$\begingroup\$ @JohnHamilton i did, found nothing! \$\endgroup\$
    – MrChips
    Dec 4, 2016 at 5:49
  • \$\begingroup\$ docs.unity3d.com/ScriptReference/Camera.html do Ctrl+F type in hdr. That's a boolean that shows whether the HDR is enabled on that camera or not. \$\endgroup\$ Dec 4, 2016 at 5:59

1 Answer 1

2
\$\begingroup\$

Instead of using the GameObject type, use Camera.

    using UnityEngine;
    using System.Collections;


    public class CameraManager: MonoBehaviour 
    {
        public Camera currentActiveCamera;

        void Start()
        {
            currentActiveCamera.GetComponent<Camera>().hdr = false;
        }
    }
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .