mirror of
https://github.com/originalnicodr/CinematicUnityExplorer.git
synced 2025-07-18 17:38:01 +08:00
Moved the bone object inspect button to the right and put the bone name on a label so it could resize correctly.
This commit is contained in:
@ -16,7 +16,7 @@ namespace UnityExplorer.UI.Panels
|
|||||||
ComponentControl scaleControl;
|
ComponentControl scaleControl;
|
||||||
public AxisComponentControl CurrentSlidingAxisControl { get; set; }
|
public AxisComponentControl CurrentSlidingAxisControl { get; set; }
|
||||||
public BonesManager Owner;
|
public BonesManager Owner;
|
||||||
private ButtonRef inspectButton;
|
private Text boneName;
|
||||||
|
|
||||||
private GameObject expandBonesRow;
|
private GameObject expandBonesRow;
|
||||||
private ButtonRef expandBonesButton;
|
private ButtonRef expandBonesButton;
|
||||||
@ -35,7 +35,7 @@ namespace UnityExplorer.UI.Panels
|
|||||||
|
|
||||||
public void SetBoneTree(BoneTree boneTree, BonesManager bonesManager){
|
public void SetBoneTree(BoneTree boneTree, BonesManager bonesManager){
|
||||||
this.boneTree = boneTree;
|
this.boneTree = boneTree;
|
||||||
inspectButton.ButtonText.text = boneTree.obj.name;
|
boneName.text = boneTree.obj.name;
|
||||||
Owner = bonesManager;
|
Owner = bonesManager;
|
||||||
|
|
||||||
if (boneTree.childTrees.Count == 0){
|
if (boneTree.childTrees.Count == 0){
|
||||||
@ -103,14 +103,17 @@ namespace UnityExplorer.UI.Panels
|
|||||||
UIFactory.SetLayoutElement(MeshToggleObj, minHeight: 30);
|
UIFactory.SetLayoutElement(MeshToggleObj, minHeight: 30);
|
||||||
MeshToggle.onValueChanged.AddListener(SetBoneEnabled);
|
MeshToggle.onValueChanged.AddListener(SetBoneEnabled);
|
||||||
|
|
||||||
inspectButton = UIFactory.CreateButton(header, "InspectButton", "");
|
boneName = UIFactory.CreateLabel(header, $"BoneName", "", fontSize: 18);
|
||||||
UIFactory.SetLayoutElement(inspectButton.GameObject, minWidth: 150, minHeight: 25);
|
UIFactory.SetLayoutElement(boneName.gameObject, minWidth: 100, minHeight: 25, flexibleWidth: 9999);
|
||||||
inspectButton.OnClick += () => InspectorManager.Inspect(boneTree.obj);
|
|
||||||
|
|
||||||
GameObject headerButtons = UIFactory.CreateUIObject("BoneHeader", header);
|
GameObject headerButtons = UIFactory.CreateUIObject("BoneHeader", header);
|
||||||
UIFactory.SetLayoutGroup<HorizontalLayoutGroup>(headerButtons, false, false, true, true, 4, childAlignment: TextAnchor.MiddleRight);
|
UIFactory.SetLayoutGroup<HorizontalLayoutGroup>(headerButtons, false, false, true, true, 4, childAlignment: TextAnchor.MiddleRight);
|
||||||
UIFactory.SetLayoutElement(headerButtons, minHeight: 25, flexibleWidth: 9999, flexibleHeight: 800);
|
UIFactory.SetLayoutElement(headerButtons, minHeight: 25, flexibleWidth: 9999, flexibleHeight: 800);
|
||||||
|
|
||||||
|
ButtonRef inspectButton = UIFactory.CreateButton(headerButtons, "InspectButton", "Inspect");
|
||||||
|
UIFactory.SetLayoutElement(inspectButton.GameObject, minWidth: 75, minHeight: 25);
|
||||||
|
inspectButton.OnClick += () => InspectorManager.Inspect(boneTree.obj);
|
||||||
|
|
||||||
ButtonRef restoreBoneStateButton = UIFactory.CreateButton(headerButtons, "RestoreBoneState", "Restore State");
|
ButtonRef restoreBoneStateButton = UIFactory.CreateButton(headerButtons, "RestoreBoneState", "Restore State");
|
||||||
UIFactory.SetLayoutElement(restoreBoneStateButton.GameObject, minWidth: 125, minHeight: 25);
|
UIFactory.SetLayoutElement(restoreBoneStateButton.GameObject, minWidth: 125, minHeight: 25);
|
||||||
restoreBoneStateButton.OnClick += RestoreBoneState;
|
restoreBoneStateButton.OnClick += RestoreBoneState;
|
||||||
|
Reference in New Issue
Block a user