Rotating = 2
}
static GUIContent s_MipMapLow , s_MipMapHigh , s_CurveKeyframeSelected , s_CurveKeyframeSemiSelectedOverlay , s_RGBMIcon ;
static GUIStyle s_PreButton , s_PreSlider , s_PreSliderThumb , s_PreLabel ;
static Mesh sphereMesh
{
get { return s_SphereMesh ? ? ( s_SphereMesh = Resources . GetBuiltinResource ( typeof ( Mesh ) , "New-Sphere.fbx" ) as Mesh ) ; }
}
public float m_PreviewExposure = 0f ;
public float m_MipLevelPreview = 0f ;
static GUIContent s_MipMapLow , s_MipMapHigh , s_CurveKeyframeSelected , s_CurveKeyframeSemiSelectedOverlay , s_RGBMIcon ;
static GUIStyle s_PreButton , s_PreSlider , s_PreSliderThumb , s_PreLabel ;
public float previewExposure = 0f ;
public float mipLevelPreview = 0f ;
void Awake ( )
{
m_ReflectiveMaterial = new Material ( Shader . Find ( "Debug/ReflectionProbePreview" ) )
{
hideFlags = HideFlags . HideAndDontSave
} ;
InitIcons ( ) ;
}
{
InitIcons ( ) ;
}
m_ReflectiveMaterial = new Material ( Shader . Find ( "Debug/ReflectionProbePreview" ) ) ;
m_ReflectiveMaterial . hideFlags = HideFlags . HideAndDontSave ;
}
void OnDisable ( )
}
static Mesh sphereMesh
{
get { return s_SphereMesh ? ? ( s_SphereMesh = Resources . GetBuiltinResource ( typeof ( Mesh ) , "New-Sphere.fbx" ) as Mesh ) ; }
}
public override bool HasPreviewGUI ( )
{
return true ;
{
if ( m_ReflectiveMaterial ! = null )
{
m_ReflectiveMaterial . SetFloat ( "_Exposure" , m_P reviewExposure) ;
m_ReflectiveMaterial . SetFloat ( "_MipLevel" , m_M ipLevelPreview ) ;
m_ReflectiveMaterial . SetFloat ( "_Exposure" , p reviewExposure) ;
m_ReflectiveMaterial . SetFloat ( "_MipLevel" , mipLevelPreview ) ;
}
if ( m_PreviewUtility = = null )
}
}
void InitPreview ( )
{
m_PreviewUtility = new PreviewRenderUtility ( false , true ) ;
m_PreviewUtility . cameraFieldOfView = 5 0.0f ;
m_PreviewUtility . camera . nearClipPlane = 0.01f ;
m_PreviewUtility . camera . farClipPlane = 2 0.0f ;
m_PreviewUtility . camera . transform . position = new Vector3 ( 0 , 0 , 2 ) ;
m_PreviewUtility . camera . transform . LookAt ( Vector3 . zero ) ;
//m_PreviewUtility.camera.clearFlags = CameraClearFlags.Skybox;
}
static void InitIcons ( )
{
s_MipMapLow = EditorGUIUtility . IconContent ( "PreTextureMipMapLow" ) ;
s_MipMapHigh = EditorGUIUtility . IconContent ( "PreTextureMipMapHigh" ) ;
s_CurveKeyframeSelected = EditorGUIUtility . IconContent ( "d_curvekeyframeselected" ) ;
s_CurveKeyframeSemiSelectedOverlay = EditorGUIUtility . IconContent ( "d_curvekeyframesemiselectedoverlay" ) ;
s_RGBMIcon = EditorGUIUtility . IconContent ( "PreMatLight1" ) ; // TODO: proper icon for RGBM preview mode
s_PreButton = "preButton" ;
s_PreSlider = "preSlider" ;
s_PreSliderThumb = "preSliderThumb" ;
s_PreLabel = "preLabel" ;
}
public override void OnPreviewSettings ( )
{
GUI . enabled = true ;
m_MipLevelPreview = GUILayout . HorizontalSlider ( m_MipLevelPreview , 0 , ( ( Cubemap ) target ) . mipmapCount , GUILayout . MaxWidth ( 8 0 ) ) ;
mipLevelPreview = GUILayout . HorizontalSlider ( mipLevelPreview , 0 , ( ( Cubemap ) target ) . mipmapCount , GUILayout . MaxWidth ( 8 0 ) ) ;
GUILayout . Box ( s_CurveKeyframeSemiSelectedOverlay , s_PreLabel , GUILayout . MaxWidth ( 2 0 ) ) ;
GUILayout . Box ( s_CurveKeyframeSemiSelectedOverlay , s_PreLabel , GUILayout . MaxWidth ( 2 0 ) ) ;
m_PreviewExposure = GUILayout . HorizontalSlider ( m_PreviewExposure , - 1 0f , 1 0f , GUILayout . MaxWidth ( 8 0 ) ) ;
previewExposure = GUILayout . HorizontalSlider ( previewExposure , - 1 0f , 1 0f , GUILayout . MaxWidth ( 8 0 ) ) ;
public bool HandleMouse ( Rect Viewport )
void InitPreview ( )
{
m_PreviewUtility = new PreviewRenderUtility ( false , true ) ;
m_PreviewUtility . cameraFieldOfView = 5 0.0f ;
m_PreviewUtility . camera . nearClipPlane = 0.01f ;
m_PreviewUtility . camera . farClipPlane = 2 0.0f ;
m_PreviewUtility . camera . transform . position = new Vector3 ( 0 , 0 , 2 ) ;
m_PreviewUtility . camera . transform . LookAt ( Vector3 . zero ) ;
//m_PreviewUtility.camera.clearFlags = CameraClearFlags.Skybox;
}
bool HandleMouse ( Rect Viewport )
{
var result = false ;
return result ;
}
private void UpdateCamera ( )
void UpdateCamera ( )
}
static void InitIcons ( )
{
s_MipMapLow = EditorGUIUtility . IconContent ( "PreTextureMipMapLow" ) ;
s_MipMapHigh = EditorGUIUtility . IconContent ( "PreTextureMipMapHigh" ) ;
s_CurveKeyframeSelected = EditorGUIUtility . IconContent ( "d_curvekeyframeselected" ) ;
s_CurveKeyframeSemiSelectedOverlay = EditorGUIUtility . IconContent ( "d_curvekeyframesemiselectedoverlay" ) ;
s_RGBMIcon = EditorGUIUtility . IconContent ( "PreMatLight1" ) ; // TODO: proper icon for RGBM preview mode
s_PreButton = "preButton" ;
s_PreSlider = "preSlider" ;
s_PreSliderThumb = "preSliderThumb" ;
s_PreLabel = "preLabel" ;
}
}