if ( m_PreviewCanvas = = null )
{
m_PreviewCanvas = new ImageSequencerCanvas ( new Rect ( 0 , 1 6 , position . width - m_Splitter . value , position . height - 1 6 ) , this ) ;
m_PreviewCanvas = new ImageSequencerCanvas ( new Rect ( 0 , Styles . ToolbarHeight , position . width - m_Splitter . value , position . height - Styles . ToolbarHeight ) , this ) ;
}
CheckGraphicsSettings ( ) ;
InitializeGUI ( ) ;
if ( m_CurrentAsset = = null )
if ( m_CurrentAsset = = null )
{
OnNoAssetGUI ( ) ;
private void DrawToolbar ( )
{
using ( new EditorGUILayout . HorizontalScope ( EditorStyles . toolbar ) )
using ( new EditorGUILayout . HorizontalScope ( EditorStyles . toolbar , GUILayout . Height ( Styles . ToolbarHeight ) ) )
{
EditorGUI . BeginChangeCheck ( ) ;
bool prev ;
bool bMaskRGB = bMaskR & & bMaskG & & bMaskB ;
//GUILayout.Space(m_Splitter.value);
using ( new EditorGUILayout . HorizontalScope ( EditorStyles . toolbar , GUILayout . Width ( m_Splitter . value ) ) )
using ( new EditorGUILayout . HorizontalScope ( EditorStyles . toolbar , GUILayout . Width ( m_Splitter . value - 1 ) ) )
{
if ( GUILayout . Button ( VFXToolboxGUIUtility . Get ( "Current Sequence: " + m_CurrentAsset . name ) , EditorStyles . toolbarButton ) )
{
}
prev = bMaskR ;
bMaskR = GUILayout . Toggle ( bMaskR , VFXToolboxGUIUtility . Get ( "R" ) , styles . MaskRToggle ) ;
bMaskR = GUILayout . Toggle ( bMaskR , VFXToolboxGUIUtility . Get ( "R" ) , styles . MaskRToggle , GUILayout . Width ( 2 0 ) ) ;
bMaskG = GUILayout . Toggle ( bMaskG , VFXToolboxGUIUtility . Get ( "G" ) , styles . MaskGToggle ) ;
bMaskG = GUILayout . Toggle ( bMaskG , VFXToolboxGUIUtility . Get ( "G" ) , styles . MaskGToggle , GUILayout . Width ( 2 0 ) ) ;
bMaskB = GUILayout . Toggle ( bMaskB , VFXToolboxGUIUtility . Get ( "B" ) , styles . MaskBToggle ) ;
bMaskB = GUILayout . Toggle ( bMaskB , VFXToolboxGUIUtility . Get ( "B" ) , styles . MaskBToggle , GUILayout . Width ( 2 0 ) ) ;
bMaskA = GUILayout . Toggle ( bMaskA , VFXToolboxGUIUtility . Get ( "A" ) , styles . MaskAToggle ) ;
bMaskA = GUILayout . Toggle ( bMaskA , VFXToolboxGUIUtility . Get ( "A" ) , styles . MaskAToggle , GUILayout . Width ( 2 0 ) ) ;
if ( bMaskA ! = prev )
m_PreviewCanvas . maskA = bMaskA ;
Rect mipRect = GUILayoutUtility . GetRect ( 1 6 4 , 2 4 ) ;
GUI . Box ( mipRect , GUIContent . none , VFXToolboxStyles . toolbarButton ) ;
GUI . Label ( new RectOffset ( 0 , 0 , 0 , 0 ) . Remove ( mipRect ) , styles . iconMipMapDown ) ;
newMip = ( int ) Mathf . Round ( GUI . HorizontalSlider ( new RectOffset ( 2 4 , 6 4 , 0 , 0 ) . Remove ( mipRect ) , ( float ) newMip , 0.0f , ( float ) m_PreviewCanvas . mipMapCount - 1 ) ) ;
GUI . Label ( new RectOffset ( 1 0 0 , 0 , 0 , 0 ) . Remove ( mipRect ) , styles . iconMipMapUp ) ;
GUI . Label ( new RectOffset ( 0 , 0 , - 6 , 0 ) . Remove ( mipRect ) , styles . iconMipMapDown ) ;
newMip = ( int ) Mathf . Round ( GUI . HorizontalSlider ( new RectOffset ( 2 4 , 6 4 , 1 , 0 ) . Remove ( mipRect ) , ( float ) newMip , 0.0f , ( float ) m_PreviewCanvas . mipMapCount - 1 ) ) ;
GUI . Label ( new RectOffset ( 1 0 0 , 0 , - 6 , 0 ) . Remove ( mipRect ) , styles . iconMipMapUp ) ;
GUI . Label ( new RectOffset ( 1 2 4 , 0 , 0 , 0 ) . Remove ( mipRect ) , ( m_PreviewCanvas . mipMap + 1 ) + "/" + m_PreviewCanvas . mipMapCount , VFXToolboxStyles . toolbarLabelLeft ) ;
GUI . Label ( new RectOffset ( 1 2 4 , 0 , 3 , 0 ) . Remove ( mipRect ) , ( m_PreviewCanvas . mipMap + 1 ) + "/" + m_PreviewCanvas . mipMapCount , VFXToolboxStyles . toolbarLabelLeft ) ;
}
}
}
{
Rect brightnessRect = GUILayoutUtility . GetRect ( 1 6 0 , 2 4 ) ;
GUI . Box ( brightnessRect , GUIContent . none , VFXToolboxStyles . toolbarButton ) ;
GUI . Label ( new RectOffset ( 4 , 0 , 0 , 0 ) . Remove ( brightnessRect ) , VFXToolboxGUIUtility . GetTextAndIcon ( "Background|Sets the Background Brightness" , "CheckerFloor" ) , VFXToolboxStyles . toolbarLabelLeft ) ;
GUI . Label ( new RectOffset ( 4 , 0 , 2 , 0 ) . Remove ( brightnessRect ) , VFXToolboxGUIUtility . GetTextAndIcon ( "Background|Sets the Background Brightness" , "CheckerFloor" ) , VFXToolboxStyles . toolbarLabelLeft ) ;
float newBrightness = GUI . HorizontalSlider ( new RectOffset ( 8 2 , 4 , 0 , 0 ) . Remove ( brightnessRect ) , previewCanvas . BackgroundBrightness , 0.0f , 1.0f ) ;
float newBrightness = GUI . HorizontalSlider ( new RectOffset ( 8 2 , 6 , 1 , 0 ) . Remove ( brightnessRect ) , previewCanvas . BackgroundBrightness , 0.0f , 1.0f ) ;
if ( previewCanvas . BackgroundBrightness ! = newBrightness )
previewCanvas . BackgroundBrightness = newBrightness ;
}
{
if ( previewCanvas . sequence . length > 1 )
previewCanvas . displayRect = new Rect ( m_Splitter . value , 1 6 , position . width - m_Splitter . value , position . height - 1 1 6 ) ;
previewCanvas . displayRect = new Rect ( m_Splitter . value , Styles . ToolbarHeight , position . width - m_Splitter . value , position . height - 1 0 0 - Styles . ToolbarHeight ) ;
previewCanvas . displayRect = new Rect ( m_Splitter . value , 1 6 , position . width - m_Splitter . value , position . height - 1 6 ) ;
previewCanvas . displayRect = new Rect ( m_Splitter . value , Styles . ToolbarHeight , position . width - m_Splitter . value , position . height - Styles . ToolbarHeight ) ;
previewCanvas . OnGUI ( this ) ;
Rect exportButtonRect = new Rect ( position . width - 1 0 0 , 2 4 , 7 4 , 2 4 ) ;
Rect exportButtonRect = new Rect ( position . width - 1 0 0 , Styles . ToolbarHeight + 1 2 , 7 4 , 2 4 ) ;
if ( GUI . Button ( exportButtonRect , VFXToolboxGUIUtility . GetTextAndIcon ( "Update" , "SaveActive" ) , VFXToolboxStyles . TabButtonSingle ) )
{
UpdateExportedAssets ( ) ;
private void UpdateCanvasRect ( )
{
previewCanvas . displayRect = new Rect ( m_Splitter . value , 1 6 , position . width - m_Splitter . value , position . height - 1 6 ) ;
previewCanvas . displayRect = new Rect ( m_Splitter . value , Styles . ToolbarHeight , position . width - m_Splitter . value , position . height - Styles . ToolbarHeight ) ;
}
public void Invalidate ( )
public override Vector2 GetWindowSize ( )
{
return new Vector2 ( 2 0 0 , 2 9 2 ) ;
return new Vector2 ( 2 0 0 , 3 0 0 ) ;
}
public override void OnGUI ( Rect rect )
}
}
/ *
if ( GUILayout . Button ( VFXToolboxGUIUtility . Get ( "Documentation" ) , s_Styles . menuItem ) )
if ( GUILayout . Button ( VFXToolboxGUIUtility . Get ( "GitHub Repository" ) , s_Styles . menuItem ) )
Application . OpenURL ( "https://drive.google.com/open?id=1YUwzA1mGvzWRpajDV-XF0iUd4RhW--bhMpqo-gmj9B8" ) ;
}
if ( GUILayout . Button ( VFXToolboxGUIUtility . Get ( "Forums (for Feedback)" ) , s_Styles . menuItem ) )
{
Application . OpenURL ( "https://forum.unity3d.com/forums/vfx-toolbox.119/" ) ;
Application . OpenURL ( "https://github.com/Unity-Technologies/VFXToolbox" ) ;
* /
if ( EditorGUI . EndChangeCheck ( ) )
{
private class Styles
{
public readonly GUIStyle menuItem = ( GUIStyle ) "MenuItem" ;
public readonly GUIStyle separator = ( GUIStyle ) "sv_iconselector_sep" ;
public readonly GUIStyle menuItem ;
public readonly GUIStyle separator ;
public Styles ( )
{
menuItem = new GUIStyle ( ( GUIStyle ) "MenuItem" ) ;
menuItem . fixedHeight + = 2 ;
separator = new GUIStyle ( ( GUIStyle ) "sv_iconselector_sep" ) ;
}
}
}