本文整理汇总了C#中Viewport.GetCompositorInstance方法的典型用法代码示例。如果您正苦于以下问题:C# Viewport.GetCompositorInstance方法的具体用法?C# Viewport.GetCompositorInstance怎么用?C# Viewport.GetCompositorInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewport
的用法示例。
在下文中一共展示了Viewport.GetCompositorInstance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnAttach
//
protected override void OnAttach()
{
base.OnAttach();
viewport = RendererWorld.Instance.DefaultViewport;
window = ControlDeclarationManager.Instance.CreateControl(
"Gui\\PostEffectsWindow.gui" );
Controls.Add( window );
for( int n = 0; n < scrollBarFloatParameters.Length; n++ )
{
scrollBarFloatParameters[ n ] = (EScrollBar)window.Controls[
"FloatParameter" + n.ToString() ];
scrollBarFloatParameters[ n ].ValueChange += floatParameter_ValueChange;
}
for( int n = 0; n < checkBoxBoolParameters.Length; n++ )
{
checkBoxBoolParameters[ n ] = (ECheckBox)window.Controls[ "BoolParameter" + n.ToString() ];
checkBoxBoolParameters[ n ].CheckedChange += boolParameter_CheckedChange;
}
listBox = (EListBox)window.Controls[ "List" ];
listBox.Items.Add( "HDR" );
listBox.Items.Add( "Glass" );
listBox.Items.Add( "OldTV" );
listBox.Items.Add( "HeatVision" );
listBox.Items.Add( "MotionBlur" );
listBox.Items.Add( "RadialBlur" );
listBox.Items.Add( "Blur" );
listBox.Items.Add( "Grayscale" );
listBox.Items.Add( "Invert" );
listBox.Items.Add( "Tiling" );
listBox.SelectedIndexChange += listBox_SelectedIndexChange;
checkBoxEnabled = (ECheckBox)window.Controls[ "Enabled" ];
checkBoxEnabled.Click += checkBoxEnabled_Click;
for( int n = 0; n < listBox.Items.Count; n++ )
{
EButton itemButton = listBox.ItemButtons[ n ];
ECheckBox checkBox = (ECheckBox)itemButton.Controls[ "CheckBox" ];
string name = GetListCompositorItemName( (string)listBox.Items[ n ] );
CompositorInstance instance = viewport.GetCompositorInstance( name );
if( instance != null && instance.Enabled )
checkBox.Checked = true;
if( itemButton.Text == "HDR" )
checkBox.Enable = false;
checkBox.Click += listBoxCheckBox_Click;
}
listBox.SelectedIndex = 0;
( (EButton)window.Controls[ "Close" ] ).Click += delegate( EButton sender )
{
SetShouldDetach();
};
//ApplyToTheScreenGUI
{
ECheckBox checkBox = (ECheckBox)window.Controls[ "ApplyToTheScreenGUI" ];
checkBox.Checked = EngineApp.Instance.ScreenGuiRenderer.ApplyPostEffectsToScreenRenderer;
checkBox.Click += delegate( ECheckBox sender )
{
EngineApp.Instance.ScreenGuiRenderer.ApplyPostEffectsToScreenRenderer = sender.Checked;
};
}
}