本文整理汇总了C#中Scene.AddChild方法的典型用法代码示例。如果您正苦于以下问题:C# Scene.AddChild方法的具体用法?C# Scene.AddChild怎么用?C# Scene.AddChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scene
的用法示例。
在下文中一共展示了Scene.AddChild方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadContent
protected override async Task LoadContent()
{
await base.LoadContent();
graphicsCompositor = new SceneGraphicsCompositorLayers
{
Cameras = { Camera.Get<CameraComponent>() },
Master =
{
Renderers =
{
new ClearRenderFrameRenderer { Color = Color.Green, Name = "Clear frame" },
new SceneDelegateRenderer(PreCameraRendererDraw),
new SceneCameraRenderer { Mode = SceneCameraRenderer },
new SceneDelegateRenderer(PostCameraRendererDraw),
}
}
};
Scene = new Scene { Settings = { GraphicsCompositor = graphicsCompositor } };
Scene.AddChild(Camera);
var ambientLight = new Entity { new LightComponent { Type = new LightAmbient { Color = new LightColorRgb(Color.White) }, Intensity = 1 } };
Scene.AddChild(ambientLight);
SceneSystem.SceneInstance = new SceneInstance(Services, Scene);
}
示例2: AddToScene
public void AddToScene(Scene scene)
{
scene.AddChild(sprite); // add this player sprite
scene.AddChild(gravitywell_1.sprite);
foreach(BulletObjectAbstract bullet in gravityWeapon.bulletsArray)
{
scene.AddChild(bullet.sprite);
}
}
示例3: Added
public override void Added(Scene scene)
{
Debug.Log("block added");
base.Added(scene);
scene.AddChild (sprite);
}
示例4: Setup
public void Setup()
{
Scene = Director.Instance.CurrentScene;
textBox = new TextBox();
TextLayer = new Layer();
AVGlayer = new Layer();
Scene.AddChild(AVGlayer);
Scene.AddChild(TextLayer);
textBox.NewTextBox();
textBox.textBG.ChangeFather(TextLayer);
textBox.textBG.ObjectTouched += new TouchInputDelegate(Input);
}