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:
36
ExampleApp/Src/BasicContorller.cs
Normal file
36
ExampleApp/Src/BasicContorller.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using Prism;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class BasicController : Entity
|
||||
{
|
||||
public float Speed;
|
||||
|
||||
public void OnCreate()
|
||||
{
|
||||
}
|
||||
|
||||
public void OnUpdate(float ts)
|
||||
{
|
||||
Mat4 transform = GetTransform();
|
||||
Vec3 translation = transform.Translation;
|
||||
|
||||
float speed = Speed * ts;
|
||||
|
||||
if (Input.IsKeyPressed(KeyCode.Up))
|
||||
translation.Y += speed;
|
||||
else if (Input.IsKeyPressed(KeyCode.Down))
|
||||
translation.Y -= speed;
|
||||
if (Input.IsKeyPressed(KeyCode.Right))
|
||||
translation.X += speed;
|
||||
else if (Input.IsKeyPressed(KeyCode.Left))
|
||||
translation.X -= speed;
|
||||
|
||||
|
||||
transform.Translation = translation;
|
||||
SetTransform(transform);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user