protected MaterialProperty windShiverDrag = null ;
protected const string kWindShiverDrag = "_ShiverDrag" ;
protected MaterialProperty windShiverDirectionality = null ;
protected const string kWindShiverDirectionality = "_ShiverDirectionality" ;
// Fps mode
protected MaterialProperty fpsModeEnable = null ;
protected const string kFpsModeEnabled = "_EnableFpsMode" ;
protected MaterialProperty fpsModeFov = null ;
protected const string kWindShiverDirectionality = "_ShiverDirectionality" ;
// Fps mode
protected MaterialProperty fpsModeEnable = null ;
protected const string kFpsModeEnabled = "_EnableFpsMode" ;
protected MaterialProperty fpsModeFov = null ;
protected const string kFpsModeFov = "_FpsModeFov" ;
// tessellation params
windStiffness = FindProperty ( kWindStiffness , props ) ;
windDrag = FindProperty ( kWindDrag , props ) ;
windShiverDrag = FindProperty ( kWindShiverDrag , props ) ;
windShiverDirectionality = FindProperty ( kWindShiverDirectionality , props ) ;
fpsModeEnable = FindProperty ( kFpsModeEnabled , props ) ;
windShiverDirectionality = FindProperty ( kWindShiverDirectionality , props ) ;
fpsModeEnable = FindProperty ( kFpsModeEnabled , props ) ;
fpsModeFov = FindProperty ( kFpsModeFov , props ) ;
}
}
EditorGUI . indentLevel - - ;
}
protected override void FpsModePropertiesGUI ( )
{
GUILayout . Label ( StylesBaseLit . fpsMode , EditorStyles . boldLabel ) ;
EditorGUI . indentLevel + + ;
m_MaterialEditor . ShaderProperty ( fpsModeEnable , StylesBaseLit . fpsModeText ) ;
if ( fpsModeEnable . floatValue > 0.0f )
{
EditorGUI . indentLevel + + ;
m_MaterialEditor . ShaderProperty ( fpsModeFov , StylesBaseLit . fpsModeFovText ) ;
EditorGUI . indentLevel - - ;
}
EditorGUI . indentLevel - - ;
}
protected override void FpsModePropertiesGUI ( )
{
GUILayout . Label ( StylesBaseLit . fpsMode , EditorStyles . boldLabel ) ;
EditorGUI . indentLevel + + ;
m_MaterialEditor . ShaderProperty ( fpsModeEnable , StylesBaseLit . fpsModeText ) ;
if ( fpsModeEnable . floatValue > 0.0f )
{
EditorGUI . indentLevel + + ;
m_MaterialEditor . ShaderProperty ( fpsModeFov , StylesBaseLit . fpsModeFovText ) ;
EditorGUI . indentLevel - - ;
}
EditorGUI . indentLevel - - ;
}
// All Setup Keyword functions must be static. It allow to create script to automatically update the shaders with a script if code change
}
bool fpsModeEnabled = material . GetFloat ( kFpsModeEnabled ) > 0.0f ;
SetKeyword ( material , "_FPS_MODE" , fpsModeEnabled ) ;
CoreUtils . SetKeyword ( material , "_FPS_MODE" , fpsModeEnabled ) ;
SetupMainTexForAlphaTestGI ( "_BaseColorMap" , "_BaseColor" , material ) ;
}