本文整理汇总了C#中SceneView.Initialize方法的典型用法代码示例。如果您正苦于以下问题:C# SceneView.Initialize方法的具体用法?C# SceneView.Initialize怎么用?C# SceneView.Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SceneView
的用法示例。
在下文中一共展示了SceneView.Initialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGlwidget1Initialized
//public ref int testRef(ref int param) { return ref param; }
protected void OnGlwidget1Initialized(object sender, EventArgs e)
{
Console.WriteLine("init");
//if (GLinit)
//return;
GLinit = true;
MainEditorView.editorBackendRenderer = new SharpSL.BackendRenderers.OpenGL.EditorOpenGLRenderer();
SceneView.backendRenderer = new SharpSL.BackendRenderers.OpenGL.OpenGLRenderer();
mainEditorView.Initialize();
mainEditorView.OnResize(glwidget1.Allocation.Width, glwidget1.Allocation.Height);
Sharp.InputHandler.input.Initialize(MainEditorView.canvas);
var assets = new AssetsView();
Sharp.InputHandler.OnMouseDown += (args) =>
{
Console.WriteLine("click: " + focusedView);
if (focusedView == null)
foreach (var view in View.views)
{
if (view.panel != null && view.panel.IsChild(Gwen.Input.InputHandler.HoveredControl, true))
{
view.OnMouseDown(args);
break;
}
}
else
focusedView.OnMouseDown(args);
};
Sharp.InputHandler.OnMouseUp += (args) =>
{
if (focusedView == null)
foreach (var view in View.views)
{
if (view.panel != null && view.panel.IsChild(Gwen.Input.InputHandler.HoveredControl, true))
{
view.OnMouseUp(args);
break;
}
}
else
focusedView.OnMouseUp(args);
};
Sharp.InputHandler.OnMouseMove += (args) =>
{
if (focusedView == null)
foreach (var view in View.views)
{
if (view.panel != null && view.panel.IsChild(Gwen.Input.InputHandler.HoveredControl, true))
{
view.OnMouseMove(args);
break;
}
}
else
focusedView.OnMouseMove(args);
};
var scene = new SceneView();
var structure = new SceneStructureView();
var inspector = new InspectorView();
var tab = new Gwen.Control.TabControl(mainEditorView.splitter);
mainEditorView.splitter.OnSplitMoved += (o, args) =>
{
scene.OnResize(glwidget1.Allocation.Width, glwidget1.Allocation.Height);
//assets.OnResize(glwidget1.Allocation.Width,glwidget1.Allocation.Height);
};
var btn = tab.AddPage("scene");
var page = btn.Page;
page.Margin = new Gwen.Margin(3, 3, 3, 3);
scene.panel = btn.Page; //make GLControl for gwen
var tab1 = new Gwen.Control.TabControl(mainEditorView.splitter);
btn = tab1.AddPage("Assets");
page = btn.Page;
page.Margin = new Gwen.Margin(3, 3, 3, 3);
page.HoverEnter += (item, args) => { Console.WriteLine("hover"); };
assets.panel = page;
var tab2 = new Gwen.Control.TabControl(mainEditorView.splitter);
btn = tab2.AddPage("Structure");
page = btn.Page;
page.Margin = new Gwen.Margin(3, 3, 3, 3);
structure.panel = btn.Page;
var tab3 = new Gwen.Control.TabControl(mainEditorView.splitter);
btn = tab3.AddPage("Inspector");
page = btn.Page;
page.Margin = new Gwen.Margin(3, 3, 3, 3);
inspector.panel = btn.Page;
scene.Initialize();
structure.Initialize();
//.........这里部分代码省略.........