Added apply across actors.
This commit is contained in:
@@ -82,6 +82,12 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Initialize(LayoutElementsContainer layout)
|
public override void Initialize(LayoutElementsContainer layout)
|
||||||
{
|
{
|
||||||
|
var scaleLocked = Editor.Instance.Windows.PropertiesWin.ScaleLocked;
|
||||||
|
if (scaleLocked)
|
||||||
|
{
|
||||||
|
ChangeValuesTogether = scaleLocked;
|
||||||
|
}
|
||||||
|
|
||||||
base.Initialize(layout);
|
base.Initialize(layout);
|
||||||
|
|
||||||
// Override colors
|
// Override colors
|
||||||
@@ -106,7 +112,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
Parent = nameLabel,
|
Parent = nameLabel,
|
||||||
Width = 18,
|
Width = 18,
|
||||||
Height = 18,
|
Height = 18,
|
||||||
BackgroundBrush = new SpriteBrush(Editor.Instance.Icons.Link32),
|
BackgroundBrush = new SpriteBrush(Editor.Instance.Icons.Link32), // TODO change on scale lock
|
||||||
BackgroundColor = Color.White,
|
BackgroundColor = Color.White,
|
||||||
BorderColor = Color.Transparent,
|
BorderColor = Color.Transparent,
|
||||||
BorderColorSelected = Color.Transparent,
|
BorderColorSelected = Color.Transparent,
|
||||||
@@ -119,6 +125,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
lockButton.Clicked += () =>
|
lockButton.Clicked += () =>
|
||||||
{
|
{
|
||||||
ChangeValuesTogether = !ChangeValuesTogether;
|
ChangeValuesTogether = !ChangeValuesTogether;
|
||||||
|
Editor.Instance.Windows.PropertiesWin.ScaleLocked = ChangeValuesTogether;
|
||||||
// TODO: change image
|
// TODO: change image
|
||||||
Debug.Log(ChangeValuesTogether);
|
Debug.Log(ChangeValuesTogether);
|
||||||
};
|
};
|
||||||
@@ -131,12 +138,6 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
YElement.ValueBox.BorderSelectedColor = AxisColorY;
|
YElement.ValueBox.BorderSelectedColor = AxisColorY;
|
||||||
ZElement.ValueBox.BorderColor = Color.Lerp(AxisColorZ, back, grayOutFactor);
|
ZElement.ValueBox.BorderColor = Color.Lerp(AxisColorZ, back, grayOutFactor);
|
||||||
ZElement.ValueBox.BorderSelectedColor = AxisColorZ;
|
ZElement.ValueBox.BorderSelectedColor = AxisColorZ;
|
||||||
|
|
||||||
Debug.Log(YElement.ValueBox.Parent);
|
|
||||||
Debug.Log(YElement.ValueBox.Parent.Parent);
|
|
||||||
Debug.Log(YElement.ValueBox.Parent.Parent.Parent);
|
|
||||||
Debug.Log(YElement.ValueBox.Parent.Parent.Parent.Parent);
|
|
||||||
Debug.Log(YElement.ValueBox.Parent.Parent.Parent.Parent.Parent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Xml;
|
||||||
using FlaxEditor.CustomEditors;
|
using FlaxEditor.CustomEditors;
|
||||||
using FlaxEngine.GUI;
|
using FlaxEngine.GUI;
|
||||||
|
|
||||||
@@ -21,6 +22,11 @@ namespace FlaxEditor.Windows
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly CustomEditorPresenter Presenter;
|
public readonly CustomEditorPresenter Presenter;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indication of if the scale is locked.
|
||||||
|
/// </summary>
|
||||||
|
public bool ScaleLocked = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="PropertiesWindow"/> class.
|
/// Initializes a new instance of the <see cref="PropertiesWindow"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -52,5 +58,18 @@ namespace FlaxEditor.Windows
|
|||||||
var objects = Editor.SceneEditing.Selection.ConvertAll(x => x.EditableObject).Distinct();
|
var objects = Editor.SceneEditing.Selection.ConvertAll(x => x.EditableObject).Distinct();
|
||||||
Presenter.Select(objects);
|
Presenter.Select(objects);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void OnLayoutSerialize(XmlWriter writer)
|
||||||
|
{
|
||||||
|
writer.WriteAttributeString("ScaleLocked", ScaleLocked.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void OnLayoutDeserialize(XmlElement node)
|
||||||
|
{
|
||||||
|
if (bool.TryParse(node.GetAttribute("ScaleLocked"), out bool value1))
|
||||||
|
ScaleLocked = value1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user