public PreviewRenderUtility()
        {
            m_PreviewScene = new PreviewScene("Preview Scene");

            var l0 = CreateLight();

            previewScene.AddGameObject(l0);
            Light0 = l0.GetComponent <Light>();

            var l1 = CreateLight();

            previewScene.AddGameObject(l1);
            Light1 = l1.GetComponent <Light>();

            Light0.color = SceneView.kSceneViewFrontLight;
            Light1.transform.rotation = Quaternion.Euler(340, 218, 177);
            Light1.color = new Color(.4f, .4f, .45f, 0f) * .7f;

            m_PixelPerfect = false;

            if (Unsupported.IsDeveloperMode())
            {
                var stackTrace = new StackTrace();
                for (int i = 0; i < stackTrace.FrameCount; i++)
                {
                    var frame = stackTrace.GetFrame(i);
                    var type  = frame.GetMethod().DeclaringType;
                    if (type != null && (type.IsSubclassOf(typeof(Editor)) || type.IsSubclassOf(typeof(EditorWindow))))
                    {
                        m_Type = type.Name;
                        break;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public PreviewRenderUtility()
        {
            this.m_PreviewScene = new PreviewScene("Preview Scene");
            GameObject gameObject = PreviewRenderUtility.CreateLight();

            this.previewScene.AddGameObject(gameObject);
            this.Light0 = gameObject.GetComponent <Light>();
            GameObject gameObject2 = PreviewRenderUtility.CreateLight();

            this.previewScene.AddGameObject(gameObject2);
            this.Light1       = gameObject2.GetComponent <Light>();
            this.Light0.color = SceneView.kSceneViewFrontLight;
            this.Light1.transform.rotation = Quaternion.Euler(340f, 218f, 177f);
            this.Light1.color = new Color(0.4f, 0.4f, 0.45f, 0f) * 0.7f;
        }
Ejemplo n.º 3
0
        public PreviewRenderUtility()
        {
            m_PreviewScene = new PreviewScene("Preview Scene");

            var l0 = CreateLight();

            previewScene.AddGameObject(l0);
            Light0 = l0.GetComponent <Light>();

            var l1 = CreateLight();

            previewScene.AddGameObject(l1);
            Light1 = l1.GetComponent <Light>();

            Light0.color = SceneView.kSceneViewFrontLight;
            Light1.transform.rotation = Quaternion.Euler(340, 218, 177);
            Light1.color = new Color(.4f, .4f, .45f, 0f) * .7f;

            m_PixelPerfect = false;

            // Set a default background color
            defaultBackgroundColor = new Color(49.0f / 255.0f, 49.0f / 255.0f, 49.0f / 255.0f, 1.0f);
            colorSpace             = QualitySettings.activeColorSpace;
            camera.backgroundColor = colorSpace == ColorSpace.Gamma ? defaultBackgroundColor : defaultBackgroundColor.linear;

            if (Unsupported.IsDeveloperMode())
            {
                var stackTrace = new StackTrace();
                for (int i = 0; i < stackTrace.FrameCount; i++)
                {
                    var frame = stackTrace.GetFrame(i);
                    var type  = frame.GetMethod().DeclaringType;
                    if (type != null && (type.IsSubclassOf(typeof(Editor)) || type.IsSubclassOf(typeof(EditorWindow))))
                    {
                        m_Type = type.Name;
                        break;
                    }
                }
            }

            m_previewOpened = false;
        }
Ejemplo n.º 4
0
        public PreviewRenderUtility()
        {
            m_PreviewScene = new PreviewScene("Preview Scene");

            var l0 = CreateLight();

            previewScene.AddGameObject(l0);
            Light0 = l0.GetComponent <Light>();

            var l1 = CreateLight();

            previewScene.AddGameObject(l1);
            Light1 = l1.GetComponent <Light>();

            Light0.color = SceneView.kSceneViewFrontLight;
            Light1.transform.rotation = Quaternion.Euler(340, 218, 177);
            Light1.color = new Color(.4f, .4f, .45f, 0f) * .7f;

            m_PixelPerfect = false;
        }