Vector3 inputfield 改进
This commit is contained in:
@@ -9,6 +9,7 @@ using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.UIElements;
|
||||
using Inspector = Ichni.Editor.Inspector;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
@@ -38,8 +39,6 @@ namespace Ichni.RhythmGame
|
||||
//存档类
|
||||
public BaseElement_BM matchedBM { get; set; }
|
||||
|
||||
public Editor.Inspector inspector;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 首次初始化
|
||||
@@ -48,7 +47,6 @@ namespace Ichni.RhythmGame
|
||||
public virtual void Initialize(string name, Guid elementGuid, List<string> tags,
|
||||
bool isFirstGenerated, GameElement parentElement)
|
||||
{
|
||||
inspector=EditorManager.instance.uiManager.inspector;
|
||||
this.elementName = name;
|
||||
this.elementGuid = elementGuid;
|
||||
this.tags = tags;
|
||||
@@ -75,14 +73,6 @@ namespace Ichni.RhythmGame
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 刷新物体的状态
|
||||
/// </summary>
|
||||
public virtual void Refresh()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置父物体
|
||||
/// </summary>
|
||||
@@ -100,6 +90,12 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public abstract partial class GameElement //存档,删除,复制,粘贴
|
||||
{
|
||||
|
||||
public virtual void Refresh()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用于生成存档
|
||||
/// </summary>
|
||||
@@ -143,30 +139,18 @@ namespace Ichni.RhythmGame
|
||||
|
||||
public abstract partial class GameElement
|
||||
{
|
||||
public virtual void SetUpInspector()//被点击时设置第一层Inspector
|
||||
public Inspector inspector => EditorManager.instance.uiManager.inspector;
|
||||
|
||||
public void SetUpInspector() //被点击时设置第一层Inspector
|
||||
{
|
||||
var container = inspector.GenerateContainer("Element Info");
|
||||
var nameInputField = inspector.GenerateInputField(container, GetType().Name+"'s Name", nameof(elementName));
|
||||
var guidText = inspector.GenerateText(container, "Element GUID", nameof(elementGuid), true);
|
||||
foreach(var i in submoduleList){
|
||||
if(i.GetType()==typeof(TransformSubmodule)){
|
||||
SetUpSecondInspector((TransformSubmodule)i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var nameInputField = inspector.GenerateInputField(this, container, GetType().Name + "'s Name", nameof(elementName));
|
||||
var guidText = inspector.GenerateText(this, container, "Element GUID", nameof(elementGuid), true);
|
||||
foreach (var submodule in submoduleList)
|
||||
{
|
||||
submodule.SetUpInspector();
|
||||
}
|
||||
}
|
||||
public virtual void SetUpSecondInspector(TransformSubmodule i){
|
||||
var container2 = inspector.GenerateContainer("Element Property");
|
||||
container2.setVoH(true);
|
||||
var posInputField=inspector.GenerateVec3InputField(container2,"Start Position",nameof(i.originalPosition));
|
||||
var rotInputField=inspector.GenerateVec3InputField(container2,"Start Rotation",nameof(i.originalEulerAngles));
|
||||
var scaleInputField=inspector.GenerateVec3InputField(container2,"Start Scale",nameof(i.originalScale));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
|
||||
Reference in New Issue
Block a user