Vector3 inputfield 改进
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -33,6 +34,18 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
attachedGameElement.submoduleList.Remove(this);
|
||||
}
|
||||
|
||||
public Inspector inspector => EditorManager.instance.uiManager.inspector;
|
||||
|
||||
public virtual void SetUpInspector()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void Refresh()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
|
||||
@@ -82,6 +82,30 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
matchedBM = new TransformSubmodule_BM(attachedGameElement);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
var container = inspector.GenerateContainer("Transform");
|
||||
var originalPosInputField =
|
||||
inspector.GenerateVec3InputField(this, container, "Start Position", nameof(originalPosition));
|
||||
var originalRotInputField =
|
||||
inspector.GenerateVec3InputField(this, container, "Start Rotation", nameof(originalEulerAngles));
|
||||
var originalScaleInputField =
|
||||
inspector.GenerateVec3InputField(this, container, "Start Scale", nameof(originalScale));
|
||||
var currentPosText =
|
||||
inspector.GenerateText(this, container, "Current Position", nameof(currentPosition), true);
|
||||
var currentRotText =
|
||||
inspector.GenerateText(this, container, "Current Rotation", nameof(currentEulerAngles), true);
|
||||
var currentScaleText =
|
||||
inspector.GenerateText(this, container, "Current Scale", nameof(currentScale), true);
|
||||
}
|
||||
|
||||
public override void Refresh()
|
||||
{
|
||||
positionDirtyMark = true;
|
||||
eulerAnglesDirtyMark = true;
|
||||
scaleDirtyMark = true;
|
||||
}
|
||||
}
|
||||
|
||||
public interface IHaveTransformSubmodule
|
||||
|
||||
Reference in New Issue
Block a user