Fix reparenting actors in editor to preserve world position

#500
This commit is contained in:
Wojtek Figat
2021-05-14 13:01:25 +02:00
parent fbb9fa065a
commit 5f851d2433
3 changed files with 6 additions and 6 deletions

View File

@@ -124,7 +124,7 @@ namespace FlaxEngine
public Actor AddChild(Type type)
{
var result = (Actor)New(type);
result.SetParent(this, false);
result.SetParent(this, false, false);
return result;
}
@@ -136,7 +136,7 @@ namespace FlaxEngine
public T AddChild<T>() where T : Actor
{
var result = New<T>();
result.SetParent(this, false);
result.SetParent(this, false, false);
return result;
}
@@ -173,7 +173,7 @@ namespace FlaxEngine
if (result == null)
{
result = New<T>();
result.SetParent(this, false);
result.SetParent(this, false, false);
}
return result;
}

View File

@@ -176,7 +176,7 @@ public:
/// <param name="value">New parent</param>
/// <param name="worldPositionsStays">Should actor world positions remain the same after parent change?</param>
/// <param name="canBreakPrefabLink">True if can break prefab link on changing the parent.</param>
void SetParent(Actor* value, bool worldPositionsStays, bool canBreakPrefabLink);
API_FUNCTION() void SetParent(Actor* value, bool worldPositionsStays, bool canBreakPrefabLink);
/// <summary>
/// Gets amount of child actors.