예제 #1
0
        public override bool HasPreviewGUI()
        {
            if (targets.Length > 1)
            {
                return(false);  // We only handle one preview for reflection probes
            }
            // Ensure valid cube map editor (if possible)
            Texture texture = GetTexture(this, target);

            if (m_CubemapEditor != null && m_CubemapEditor.target as Texture != texture)
            {
                DestroyImmediate(m_CubemapEditor);
                m_CubemapEditor = null;
            }
            if (ValidPreviewSetup() && m_CubemapEditor == null)
            {
                Editor editor = m_CubemapEditor;
                CreateCachedEditor(GetTexture(this, target), typeof(HDCubemapInspector), ref editor);
                m_CubemapEditor = editor as HDCubemapInspector;
            }

            // If having one probe selected we always want preview (to prevent preview window from popping)
            return(true);
        }