本文整理汇总了C#中ParticleEmitter.StartEmitting方法的典型用法代码示例。如果您正苦于以下问题:C# ParticleEmitter.StartEmitting方法的具体用法?C# ParticleEmitter.StartEmitting怎么用?C# ParticleEmitter.StartEmitting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleEmitter
的用法示例。
在下文中一共展示了ParticleEmitter.StartEmitting方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
void ILoad.Load()
{
// body
Body = Add(new Body(Physic.World, Vector2.Zero)
{
BodyType = BodyType.Dynamic,
GravityScale = 1,
LinearDamping = 0
});
Body.CreateFixture(new CircleShape(1, 1));
// update
Add(new UpdateComponent(Update, UpdateTime.Sim));
// particle emitter
Func<Particle> flameParticle = () => new FlameParticle
{
Radius = 1f,
Force = GetForce(),
BaseColor = Color.LightBlue
};
Func<Particle> cloudParticle = () => new CloudParticle()
{
Radius = GetForce() / 5
};
_emitter = Add(new ParticleEmitter(DataPack.Textures.Snow, cloudParticle)
{
EmittingCount = new IntRange(5, 10),
Frequency = .01f,
//BlendState = BlendState.NonPremultiplied
});
_emitter.StartEmitting();
_emitter.IsVisible = false;
// rendering
Add(new DrawComponent(Draw));
// stabilization
_stabilizationUpdate = new UpdateComponent(UpdateStabilisation, UpdateTime.Sim);
// ui
Add(new GameUI
{
// mouse + keyboard
new MouseButtonBinding(OpenTK.Input.MouseButton.Left, StartThruster, StopThruster),
new KeyBinding(Keys.LeftShift, () => Boost = true, () => Boost = false),
// gamepad
new GamePadStickBinding(Side.Left, RotateWithGamePad),
new GamePadButtonBinding(Buttons.LeftTrigger, StartThruster, StopThruster),
new GamePadButtonBinding(Buttons.A, () => Boost = true, () => Boost = false),
});
_thrusterUpdate = new UpdateComponent(RotateTowardMouse, UpdateTime.Sim);
StartStabilization();
// default settings
EnableStabilizer = true;
}