Update README.md to include project description, developer documentation links, and license information.
CI / build-test (push) Successful in 1m6s
CI / build-test (push) Successful in 1m6s
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using Friflo.Engine.ECS;
|
||||
using Microsoft.Xna.Framework;
|
||||
using MrGameEng.Graphics;
|
||||
|
||||
namespace MrGameEng.Sample;
|
||||
|
||||
/// <summary>Действия игрока, привязанные к клавишам через ActionMap.</summary>
|
||||
public enum SampleAction
|
||||
{
|
||||
MoveLeft,
|
||||
MoveRight,
|
||||
MoveUp,
|
||||
MoveDown,
|
||||
Jump,
|
||||
Pause,
|
||||
ToggleMusic,
|
||||
SwitchScene,
|
||||
}
|
||||
|
||||
/// <summary>Скорость для движущихся сущностей сэмпла.</summary>
|
||||
public struct Velocity : IComponent
|
||||
{
|
||||
public Vector2 Value;
|
||||
}
|
||||
|
||||
/// <summary>Слои рендера сэмпла; регистрируются один раз на общий Renderer2D.</summary>
|
||||
public static class SampleLayers
|
||||
{
|
||||
public static LayerId Actors { get; private set; }
|
||||
|
||||
public static LayerId Ui { get; private set; }
|
||||
|
||||
private static bool _registered;
|
||||
|
||||
public static void EnsureRegistered(Renderer2D renderer)
|
||||
{
|
||||
if (_registered)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Actors = renderer.Layers.Register("Actors", LayerSpace.World, LayerSortMode.YSort);
|
||||
Ui = renderer.Layers.Register("UI", LayerSpace.Screen);
|
||||
_registered = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user