using System; using GlitchyEngine.Math; namespace GlitchyEngine; class MyTestEntity : Entity { //Rigidbody2D _rigidBody; /// /// Called after the script component was created. (The entity might not be fully created yet) /// void OnCreate() { Log.Info($"Create! {UUID}"); //_rigidBody = GetComponent(); } ///// ///// Called after the entity was created completely. ///// //void OnInstantiate() //{ // Log.Warning($"Instantiated!"); //} /// /// Called every frame. /// /// void OnUpdate(float deltaTime) { if (Input.IsKeyPressed(Key.A)) { Log.Info($"HALLO!"); Vector3 translation = Translation; translation.Y += 1.0f * deltaTime; Translation = translation; //_rigidBody.ApplyImpulse(new Vector2(0, 10)); } if (Input.IsMouseButtonReleasing(MouseButton.LeftButton)) { Log.Info("Ouha!"); } } /// /// Called before the component is being destroyed. /// void OnDestroy() { Log.Trace("Destroy"); } }