mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
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:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user