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

chore: automatically merge unnecessary activeness animated GameObject #476

Merged
merged 2 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG-PRERELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog].

## [Unreleased]
### Added
- Automatically merge unnecessary activeness animated GameObject `#476`

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,12 @@ bool ConfigureRecursive(Transform transform, ImmutableModificationsContainer mod
// The bone cannot be used generally
if ((_marked[transform] & ~AllowedUsages) != 0) return false;
// must not be animated
if (Animated(transform, modifications)) return false;
if (TransformAnimated(transform, modifications)) return false;

if (!mergedChildren)
{
if (GameObjectAnimated(transform, modifications)) return false;

var localScale = transform.localScale;
var identityTransform = localScale == Vector3.one && transform.localPosition == Vector3.zero &&
transform.localRotation == Quaternion.identity;
Expand Down Expand Up @@ -365,9 +367,6 @@ bool GameObjectAnimated(Transform transform, ImmutableModificationsContainer mod

return false;
}

bool Animated(Transform transform, ImmutableModificationsContainer modifications) =>
TransformAnimated(transform, modifications) || GameObjectAnimated(transform, modifications);
}

private static readonly string[] TransformProperties =
Expand Down