I think if you’re creating Entities in a subscene, you can just tick the Static toggle. When enabled, the LocalTransform component will not be added. Just the LocalToWorld and a Static tag component. So the transform system won’t iterate through them.
The baking system currently determines if the object is static like this:
/// <summary>
/// Checks if the GameObject is static for a given GameObject.
/// </summary>
/// <param name="gameObject">The GameObject to check</param>
/// <returns>Returns true if the object or one of its ancestors is static, otherwise returns false.</returns>
/// <remarks>This takes a dependency on the static state</remarks>
public bool IsStatic(GameObject gameObject)
{
// Intentionally using gameObject.GetComponentInParent instead of the baker version.
// We want this baker to trigger when the overall static value changes, not StaticOptimizeEntity is added/removed
var staticOptimizeEntity = gameObject.GetComponentInParent<StaticOptimizeEntity>(gameObject) != null;
bool isStatic = (staticOptimizeEntity || InternalIsStaticRecursive(gameObject));
_State.Dependencies->DependOnStatic(gameObject.GetInstanceID(), _State.AuthoringId, isStatic);
return isStatic;
}
/// <summary>
/// Returns if the GameObject or one of its parents is static
/// </summary>
/// <param name="gameObject">The GameObject to check.</param>
/// <returns>Returns true if the object or one of its ancestors is static, otherwise returns false.</returns>
private static bool InternalIsStaticRecursive(GameObject gameObject)
{
...
}
It looks like you can just set any parent GameObject as static and it should already behave as if the StaticOptimizeEntity component is added.