Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sdk7 SBC basic check order #6014

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,25 @@ public void OnComponentRemoved(IParcelScene scene, IDCLEntity entity)

public void OnComponentModelUpdated(IParcelScene scene, IDCLEntity entity, ECSTransform model)
{
bool positionChange = false;
Transform transform = entity.gameObject.transform;

bool positionChange = transform.localPosition != model.position;
bool scaleChange = transform.localScale != model.scale;
bool rotationChange = transform.localRotation != model.rotation;

transform.localPosition = model.position;
transform.localRotation = model.rotation;
transform.localScale = model.scale;

if (entity.parentId != model.parentId)
{
// reparenting may end up changing the entity's position...
Vector3 previousGlobalPosition = transform.position;
ProcessNewParent(scene, entity, model.parentId);
positionChange = transform.position != previousGlobalPosition;
}

if (!positionChange)
positionChange = transform.localPosition != model.position;
bool scaleChange = transform.localScale != model.scale;
bool rotationChange = transform.localRotation != model.rotation;
// reparenting may end up changing the entity's position...
if (!positionChange)
positionChange = transform.position != previousGlobalPosition;
}

if (positionChange)
sbcInternalComponent.SetPosition(scene, entity, transform.position);
Expand Down
Loading