Esempio n. 1
0
        public SerializedHDCamera(SerializedObject serializedObject)
        {
            this.serializedObject = serializedObject;
            var additionals = CoreEditorUtils.GetAdditionalData <HDAdditionalCameraData>(serializedObject.targetObjects, HDAdditionalCameraData.InitDefaultHDAdditionalCameraData);

            serializedAdditionalDataObject = new SerializedObject(additionals);

            var hideFlags = serializedAdditionalDataObject.FindProperty("m_ObjectHideFlags");

            // We don't hide additional camera data anymore on UX team request. To be compatible with already author scene we force to be visible
            //hideFlags.intValue = (int)HideFlags.HideInInspector;
            hideFlags.intValue = (int)HideFlags.None;
            serializedAdditionalDataObject.ApplyModifiedProperties();

            //backgroundColor = serializedObject.FindProperty("m_BackGroundColor");
            normalizedViewPortRect = serializedObject.FindProperty("m_NormalizedViewPortRect");
            nearClippingPlane      = serializedObject.FindProperty("near clip plane");
            farClippingPlane       = serializedObject.FindProperty("far clip plane");
            fieldOfView            = serializedObject.FindProperty("field of view");
            orthographic           = serializedObject.FindProperty("orthographic");
            orthographicSize       = serializedObject.FindProperty("orthographic size");
            depth            = serializedObject.FindProperty("m_Depth");
            cullingMask      = serializedObject.FindProperty("m_CullingMask");
            occlusionCulling = serializedObject.FindProperty("m_OcclusionCulling");
            targetTexture    = serializedObject.FindProperty("m_TargetTexture");
            HDR = serializedObject.FindProperty("m_HDR");

            stereoConvergence = serializedObject.FindProperty("m_StereoConvergence");
            stereoSeparation  = serializedObject.FindProperty("m_StereoSeparation");

#if ENABLE_MULTIPLE_DISPLAYS
            targetDisplay = serializedObject.FindProperty("m_TargetDisplay");
#endif

            targetEye = serializedObject.FindProperty("m_TargetEye");

            aperture     = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.aperture);
            shutterSpeed = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.shutterSpeed);
            iso          = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.iso);

            clearColorMode     = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.clearColorMode);
            backgroundColorHDR = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.backgroundColorHDR);
            renderingPath      = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.renderingPath);
            clearDepth         = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.clearDepth);
            volumeLayerMask    = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.volumeLayerMask);
            frameSettings      = new SerializedFrameSettings(serializedAdditionalDataObject.FindProperty("m_FrameSettings"));
        }
Esempio n. 2
0
        void HideAdditionalComponents(bool visible)
        {
            var adds  = CoreEditorUtils.GetAdditionalData <HDAdditionalReflectionData>(targets);
            var flags = visible ? HideFlags.None : HideFlags.HideInInspector;

            for (var i = 0; i < targets.Length; ++i)
            {
                var target       = targets[i];
                var addData      = adds[i];
                var p            = (ReflectionProbe)target;
                var meshRenderer = p.GetComponent <MeshRenderer>();
                var meshFilter   = p.GetComponent <MeshFilter>();

                addData.hideFlags      = flags;
                meshRenderer.hideFlags = flags;
                meshFilter.hideFlags   = flags;
            }
        }
Esempio n. 3
0
        void OnEnable()
        {
            var additionalData = CoreEditorUtils.GetAdditionalData <HDAdditionalReflectionData>(targets);

            m_AdditionalDataSerializedObject = new SerializedObject(additionalData);
            m_SerializedHdReflectionProbe    = new SerializedHDReflectionProbe(serializedObject, m_AdditionalDataSerializedObject);
            m_UIState.owner = this;
            m_UIState.Reset(
                m_SerializedHdReflectionProbe,
                Repaint);

            foreach (var t in targets)
            {
                var p = (ReflectionProbe)t;
                s_ReflectionProbeEditors[p] = this;
            }

            InitializeAllTargetProbes();
            ChangeVisibilityOfAllTargets(true);
        }
Esempio n. 4
0
        public SerializedHDCamera(SerializedObject serializedObject)
        {
            this.serializedObject = serializedObject;
            var additionals = CoreEditorUtils.GetAdditionalData <HDAdditionalCameraData>(serializedObject.targetObjects);

            serializedAdditionalDataObject = new SerializedObject(additionals);

            var hideFlags = serializedAdditionalDataObject.FindProperty("m_ObjectHideFlags");

            hideFlags.intValue = (int)HideFlags.HideInInspector;
            serializedAdditionalDataObject.ApplyModifiedProperties();

            backgroundColor        = serializedObject.FindProperty("m_BackGroundColor");
            normalizedViewPortRect = serializedObject.FindProperty("m_NormalizedViewPortRect");
            nearClippingPlane      = serializedObject.FindProperty("near clip plane");
            farClippingPlane       = serializedObject.FindProperty("far clip plane");
            fieldOfView            = serializedObject.FindProperty("field of view");
            orthographic           = serializedObject.FindProperty("orthographic");
            orthographicSize       = serializedObject.FindProperty("orthographic size");
            depth            = serializedObject.FindProperty("m_Depth");
            cullingMask      = serializedObject.FindProperty("m_CullingMask");
            occlusionCulling = serializedObject.FindProperty("m_OcclusionCulling");
            targetTexture    = serializedObject.FindProperty("m_TargetTexture");
            HDR = serializedObject.FindProperty("m_HDR");

            stereoConvergence = serializedObject.FindProperty("m_StereoConvergence");
            stereoSeparation  = serializedObject.FindProperty("m_StereoSeparation");

#if ENABLE_MULTIPLE_DISPLAYS
            targetDisplay = serializedObject.FindProperty("m_TargetDisplay");
#endif

            targetEye = serializedObject.FindProperty("m_TargetEye");

            renderingPath   = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.renderingPath);
            volumeLayerMask = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.volumeLayerMask);
            frameSettings   = new SerializedFrameSettings(serializedAdditionalDataObject.FindProperty("m_FrameSettings"));
        }