ScriptCore: Added more properties to components

- Added CircleRenderer
- Transform: Added Rotation, RotationEuler, RotationAxisAngle and Scale
- RigidBody: Added BodyType and GravityScale
- Added ColorRGBA
This commit is contained in:
Simon Lübeß
2024-01-27 19:46:37 +01:00
parent bc535ddc26
commit 8ff35d3967
12 changed files with 566 additions and 22 deletions
+11 -1
View File
@@ -186,6 +186,8 @@ class SceneSerializer
Serialize.Value(writer, "BodyType", component.BodyType);
Serialize.Value(writer, "FixedRotation", component.FixedRotation);
Serialize.Value(writer, "GravityScale", component.GravityScale);
});
SerializeComponent<BoxCollider2DComponent>(writer, entity, "BoxCollider2D", scope (component) =>
@@ -584,13 +586,21 @@ class SceneSerializer
case "Rigidbody2D":
Try!(DeserializeComponent<Rigidbody2DComponent>(reader, entity, scope (component) =>
{
Deserialize.Value(reader, "BodyType", out component.BodyType);
Rigidbody2DComponent.BodyType bodyType = .Static;
Deserialize.Value(reader, "BodyType", out bodyType);
component.BodyType = bodyType;
reader.EntryEnd();
bool fixedRotation = false;
Deserialize.Value(reader, "FixedRotation", out fixedRotation);
component.FixedRotation = fixedRotation;
reader.EntryEnd();
Deserialize.Value<float>(reader, "GravityScale", let gravityScale);
component.GravityScale = gravityScale;
return .Ok;
}));
case "BoxCollider2D":