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:
@ -6,8 +6,13 @@ namespace Example
|
||||
{
|
||||
public class Script : Entity
|
||||
{
|
||||
public float VerticalSpeed = 5.0f;
|
||||
public float Speed = 5.0f;
|
||||
|
||||
public float Rotation = 0.0f;
|
||||
public Vec3 Velocity;
|
||||
public float SinkRate = 1.0f;
|
||||
|
||||
|
||||
public void OnCreate()
|
||||
{
|
||||
Console.WriteLine("Script.OnCreate");
|
||||
@ -16,11 +21,20 @@ namespace Example
|
||||
|
||||
public void OnUpdate(float ts)
|
||||
{
|
||||
Rotation += ts;
|
||||
|
||||
|
||||
Mat4 transform = GetTransform();
|
||||
Vec3 translation = transform.Translation;
|
||||
|
||||
float speed = Speed * ts;
|
||||
|
||||
translation.X += Velocity.X * ts;
|
||||
translation.Y += Velocity.Y * ts;
|
||||
translation.Z += Velocity.Z * ts;
|
||||
|
||||
translation.Y -= SinkRate * ts;
|
||||
/*
|
||||
if (Input.IsKeyPressed(KeyCode.Up))
|
||||
translation.Y += speed;
|
||||
else if (Input.IsKeyPressed(KeyCode.Down))
|
||||
@ -29,6 +43,7 @@ namespace Example
|
||||
translation.X += speed;
|
||||
else if (Input.IsKeyPressed(KeyCode.Left))
|
||||
translation.X -= speed;
|
||||
*/
|
||||
|
||||
transform.Translation = translation;
|
||||
SetTransform(transform);
|
||||
|
||||
Reference in New Issue
Block a user