@@ -194,7 +194,7 @@ namespace FlaxEditor.SceneGraph
|
||||
{
|
||||
get
|
||||
{
|
||||
var scene = _actor.Scene;
|
||||
var scene = _actor ? _actor.Scene : null;
|
||||
return scene != null ? SceneGraphFactory.FindNode(scene.ID) as SceneNode : null;
|
||||
}
|
||||
}
|
||||
@@ -235,7 +235,6 @@ namespace FlaxEditor.SceneGraph
|
||||
{
|
||||
if (!(value is ActorNode))
|
||||
throw new InvalidOperationException("ActorNode can have only ActorNode as a parent node.");
|
||||
|
||||
base.ParentNode = value;
|
||||
}
|
||||
}
|
||||
@@ -299,6 +298,7 @@ namespace FlaxEditor.SceneGraph
|
||||
// (eg. we build new node for spawned actor and link it to the game)
|
||||
if (_treeNode.Parent != null && !_treeNode.Parent.IsLayoutLocked)
|
||||
{
|
||||
_treeNode.IndexInParent = _actor.OrderInParent;
|
||||
_treeNode.Parent.SortChildren();
|
||||
|
||||
// Update UI
|
||||
|
||||
@@ -86,6 +86,10 @@ namespace FlaxEditor.SceneGraph.GUI
|
||||
}
|
||||
parent.SortChildren();
|
||||
}
|
||||
else if (Actor)
|
||||
{
|
||||
_orderInParent = Actor.OrderInParent;
|
||||
}
|
||||
}
|
||||
|
||||
internal void OnNameChanged()
|
||||
|
||||
@@ -112,18 +112,9 @@ namespace FlaxEditor.SceneGraph
|
||||
{
|
||||
if (parentNode != value)
|
||||
{
|
||||
if (parentNode != null)
|
||||
{
|
||||
parentNode.ChildNodes.Remove(this);
|
||||
}
|
||||
|
||||
parentNode?.ChildNodes.Remove(this);
|
||||
parentNode = value;
|
||||
|
||||
if (parentNode != null)
|
||||
{
|
||||
parentNode.ChildNodes.Add(this);
|
||||
}
|
||||
|
||||
parentNode?.ChildNodes.Add(this);
|
||||
OnParentChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1597,7 +1597,7 @@ bool Actor::FromBytes(const Span<byte>& data, Array<Actor*>& output, ISerializeM
|
||||
// Order in parent
|
||||
int32 orderInParent;
|
||||
stream.ReadInt32(&orderInParent);
|
||||
order.At(i) = orderInParent;
|
||||
order[i] = orderInParent;
|
||||
|
||||
// Load JSON
|
||||
rapidjson_flax::Document document;
|
||||
@@ -1637,7 +1637,6 @@ bool Actor::FromBytes(const Span<byte>& data, Array<Actor*>& output, ISerializeM
|
||||
// Order in parent
|
||||
int32 orderInParent;
|
||||
stream.ReadInt32(&orderInParent);
|
||||
order.Add(orderInParent);
|
||||
|
||||
// Load JSON
|
||||
rapidjson_flax::Document document;
|
||||
|
||||
@@ -249,6 +249,8 @@ namespace FlaxEngine.GUI
|
||||
internal void ChangeChildIndex(Control child, int newIndex)
|
||||
{
|
||||
int oldIndex = _children.IndexOf(child);
|
||||
if (oldIndex == newIndex)
|
||||
return;
|
||||
_children.RemoveAt(oldIndex);
|
||||
|
||||
// Check if index is invalid
|
||||
|
||||
Reference in New Issue
Block a user