add serialization (use yaml-cpp), add stencil to render outline for selected entity, add play mode, UUIDS, add orthographic and perspective camera, add editor camera
This commit is contained in:
@ -10,7 +10,7 @@ namespace Example
|
||||
{
|
||||
public class MapGenerator : Entity
|
||||
{
|
||||
// TODO: [EditorSlider("MapWidth Custom Name", 2, 0, 1024)]
|
||||
// [EditorSlider("MapWidth Custom Name", 2, 0, 1024)]
|
||||
public int MapWidth = 128;
|
||||
public int MapHeight = 128;
|
||||
public int Octaves = 4;
|
||||
@ -20,6 +20,8 @@ namespace Example
|
||||
public Vec2 Offset = new Vec2(13.4f, 6.26f);
|
||||
public float NoiseScale = 0.5f;
|
||||
|
||||
public float speed = 0.0f;
|
||||
|
||||
public void GenerateMap()
|
||||
{
|
||||
// float[,] noiseMap = Noise.GenerateNoiseMap(MapWidth, MapHeight, NoiseScale);
|
||||
@ -76,7 +78,19 @@ namespace Example
|
||||
|
||||
void OnUpdate(float ts)
|
||||
{
|
||||
|
||||
Mat4 transform = GetTransform();
|
||||
Vec3 translation = transform.Translation;
|
||||
translation.Y += ts * speed;
|
||||
|
||||
if (Input.IsKeyPressed(KeyCode.Space))
|
||||
{
|
||||
Console.WriteLine("Space Pressed");
|
||||
translation.Y -= 10.0f;
|
||||
}
|
||||
|
||||
transform.Translation = translation;
|
||||
|
||||
SetTransform(transform);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user