整理
This commit is contained in:
32648
Assets/FR2_Cache.asset
32648
Assets/FR2_Cache.asset
File diff suppressed because it is too large
Load Diff
@@ -24,9 +24,41 @@ namespace Ichni.Editor
|
|||||||
public GameObject ConsoleUI;
|
public GameObject ConsoleUI;
|
||||||
public TMP_Text cueText;
|
public TMP_Text cueText;
|
||||||
bool isHide = true;
|
bool isHide = true;
|
||||||
|
private string FillCueCommand(MethodInfo method)
|
||||||
|
{
|
||||||
|
if (method == null)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
string methodName = method.Name;
|
||||||
|
// 3. 获取参数信息
|
||||||
|
var parameters = method.GetParameters();
|
||||||
|
if (parameters.Length == 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
return $"{methodName} " + "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 生成参数提示
|
||||||
|
string paramHint = string.Join(" ", parameters.Select(p =>
|
||||||
|
p.IsOptional ? $"[{p.ParameterType.Name}:{p.Name}]" : $"{p.ParameterType.Name}:{p.Name}"
|
||||||
|
));
|
||||||
|
return $"{methodName} {paramHint}".Trim() + "\n";
|
||||||
|
}
|
||||||
public void GetChange(string change)
|
public void GetChange(string change)
|
||||||
{
|
{
|
||||||
|
if (change == "help")
|
||||||
|
{
|
||||||
|
List<MethodInfo> Allmethods = typeof(EditorConsoleMethods).GetMethods().
|
||||||
|
Where(m => m.IsStatic && m.IsPublic && m.ReturnType == typeof(void)).
|
||||||
|
ToList();
|
||||||
|
cueText.text = "";
|
||||||
|
foreach (MethodInfo method in Allmethods)
|
||||||
|
{
|
||||||
|
cueText.text += FillCueCommand(method);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Task t = new Task(() =>
|
// Task t = new Task(() =>
|
||||||
// {
|
// {
|
||||||
// 1. 提取命令名
|
// 1. 提取命令名
|
||||||
@@ -51,24 +83,7 @@ namespace Ichni.Editor
|
|||||||
cueText.text = "";
|
cueText.text = "";
|
||||||
foreach (MethodInfo method in methods)
|
foreach (MethodInfo method in methods)
|
||||||
{
|
{
|
||||||
if (method == null)
|
cueText.text += FillCueCommand(method);
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
string methodName = method.Name;
|
|
||||||
// 3. 获取参数信息
|
|
||||||
var parameters = method.GetParameters();
|
|
||||||
if (parameters.Length == 0)
|
|
||||||
{
|
|
||||||
cueText.text += $"{methodName} " + "\n";
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 4. 生成参数提示
|
|
||||||
string paramHint = string.Join(" ", parameters.Select(p =>
|
|
||||||
p.IsOptional ? $"[{p.ParameterType.Name}:{p.Name}]" : $"{p.ParameterType.Name}:{p.Name}"
|
|
||||||
));
|
|
||||||
cueText.text += $"{methodName} {paramHint}".Trim() + "\n";
|
|
||||||
}
|
}
|
||||||
if (cueText.text.IsNullOrWhitespace())
|
if (cueText.text.IsNullOrWhitespace())
|
||||||
{
|
{
|
||||||
@@ -263,16 +278,6 @@ namespace Ichni.Editor
|
|||||||
commandList.Add(i.Name);
|
commandList.Add(i.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// functionInterpreter.SetFunction("test", (Action)Test);
|
|
||||||
|
|
||||||
// functionInterpreter.SetFunction("kill", (Action)Kill);
|
|
||||||
// functionInterpreter.SetFunction("lgp", (Action<int, float, float, float, float, float, float>)LGenPathNodes);
|
|
||||||
// functionInterpreter.SetFunction("print", (Action<object>)print);
|
|
||||||
// functionInterpreter.SetFunction("log", (Action<object>)Debug.Log);
|
|
||||||
// functionInterpreter.SetFunction("tp", (Action<float, float, float>)Tp);
|
|
||||||
// functionInterpreter.SetFunction("tp", (Action)Tp);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -282,33 +287,8 @@ namespace Ichni.Editor
|
|||||||
public static Inspector inspector => EditorManager.instance.uiManager.inspector;
|
public static Inspector inspector => EditorManager.instance.uiManager.inspector;
|
||||||
public static Hierarchy hierarchy => EditorManager.instance.uiManager.hierarchy;
|
public static Hierarchy hierarchy => EditorManager.instance.uiManager.hierarchy;
|
||||||
public static LogWindow logWindow => EditorManager.instance.uiManager.mainPage.logWindow;
|
public static LogWindow logWindow => EditorManager.instance.uiManager.mainPage.logWindow;
|
||||||
public static void kill()
|
|
||||||
{
|
|
||||||
if (inspector.connectedGameElement == null)
|
|
||||||
{
|
|
||||||
LogWindow.Log("Please select a GameElement first!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (int i = inspector.connectedGameElement.childElementList.Count - 1; i <= 0; i--)
|
|
||||||
{
|
|
||||||
EditorManager.instance.operationManager.CopyPasteDeleteModule.DeleteElement(
|
|
||||||
inspector.connectedGameElement.childElementList[i]
|
|
||||||
);
|
|
||||||
inspector.connectedGameElement.childElementList.RemoveAt(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static void test()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
public static void test2()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
public static void tttttt()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
public static void tp(Vector3 pos)
|
public static void tp(Vector3 pos)
|
||||||
{
|
{
|
||||||
if (EditorManager.instance.cameraManager.isSceneCameraActive)
|
if (EditorManager.instance.cameraManager.isSceneCameraActive)
|
||||||
@@ -326,7 +306,11 @@ namespace Ichni.Editor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void reName(string message)
|
||||||
|
{
|
||||||
|
inspector.connectedGameElement.elementName = message;
|
||||||
|
inspector.connectedGameElement.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void lgp(int loop, Vector3 start, Vector3 end)
|
public static void lgp(int loop, Vector3 start, Vector3 end)
|
||||||
@@ -420,6 +404,27 @@ namespace Ichni.Editor
|
|||||||
|
|
||||||
PathNode node = PathNode.GenerateElement("SpiralNode" + i.ToString(), Guid.NewGuid(), new List<string>(), true, track, true);
|
PathNode node = PathNode.GenerateElement("SpiralNode" + i.ToString(), Guid.NewGuid(), new List<string>(), true, track, true);
|
||||||
node.transformSubmodule.originalPosition = pos;
|
node.transformSubmodule.originalPosition = pos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static void delSameInParent()
|
||||||
|
{
|
||||||
|
Type type = inspector.connectedGameElement.GetType();
|
||||||
|
foreach (GameElement element in inspector.connectedGameElement.parentElement.GetAllGameElementsFromThis())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (element.GetType() == type && element != inspector.connectedGameElement)
|
||||||
|
{
|
||||||
|
element.Delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace Ichni.RhythmGame
|
|||||||
|
|
||||||
//存档类
|
//存档类
|
||||||
public BaseElement_BM matchedBM { get; set; }
|
public BaseElement_BM matchedBM { get; set; }
|
||||||
|
|
||||||
public virtual int HierarchyPriority => 0;
|
public virtual int HierarchyPriority => 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -53,12 +53,12 @@ namespace Ichni.RhythmGame
|
|||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
EditorManager.instance.beatmapContainer.gameElementList.Add(this);
|
EditorManager.instance.beatmapContainer.gameElementList.Add(this);
|
||||||
submoduleList = new List<SubmoduleBase>();
|
submoduleList = new List<SubmoduleBase>();
|
||||||
|
|
||||||
if (isFirstGenerated)
|
if (isFirstGenerated)
|
||||||
{
|
{
|
||||||
SetDefaultSubmodules();
|
SetDefaultSubmodules();
|
||||||
}
|
}
|
||||||
|
|
||||||
SetParent(parentElement);
|
SetParent(parentElement);
|
||||||
EditorManager.instance.uiManager.hierarchy.GenerateTab(this, parentElement);
|
EditorManager.instance.uiManager.hierarchy.GenerateTab(this, parentElement);
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ namespace Ichni.RhythmGame
|
|||||||
|
|
||||||
public virtual void SetEditorSubmodules()
|
public virtual void SetEditorSubmodules()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -101,7 +101,7 @@ namespace Ichni.RhythmGame
|
|||||||
transform.SetParent(parentElement.transform);
|
transform.SetParent(parentElement.transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int CompareTo(GameElement other)
|
public int CompareTo(GameElement other)
|
||||||
{
|
{
|
||||||
return HierarchyPriority.CompareTo(other.HierarchyPriority);
|
return HierarchyPriority.CompareTo(other.HierarchyPriority);
|
||||||
@@ -167,7 +167,7 @@ namespace Ichni.RhythmGame
|
|||||||
{
|
{
|
||||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||||
var container = inspector.GenerateContainer("Element Info");
|
var container = inspector.GenerateContainer("Element Info");
|
||||||
|
|
||||||
//基础信息
|
//基础信息
|
||||||
var info = container.GenerateSubcontainer(3);
|
var info = container.GenerateSubcontainer(3);
|
||||||
var nameInputField = inspector.GenerateInputField(this, info, GetType().Name + "'s Name", nameof(elementName));
|
var nameInputField = inspector.GenerateInputField(this, info, GetType().Name + "'s Name", nameof(elementName));
|
||||||
@@ -176,15 +176,15 @@ namespace Ichni.RhythmGame
|
|||||||
{
|
{
|
||||||
inspector.GenerateCompositeParameterWindow(this, "Tags List", nameof(tags)).SetAsStringList();
|
inspector.GenerateCompositeParameterWindow(this, "Tags List", nameof(tags)).SetAsStringList();
|
||||||
});
|
});
|
||||||
|
|
||||||
//次级模块
|
//次级模块
|
||||||
foreach (var submodule in submoduleList)
|
foreach (var submodule in submoduleList)
|
||||||
{
|
{
|
||||||
submodule.SetUpInspector();
|
submodule.SetUpInspector();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取所有子GameElement
|
/// 获取所有子GameElement
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -265,8 +265,8 @@ namespace Ichni.RhythmGame
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="attached">父物体</param>
|
/// <param name="attached">父物体</param>
|
||||||
public abstract GameElement DuplicateBM(GameElement attached);
|
public abstract GameElement DuplicateBM(GameElement attached);
|
||||||
|
|
||||||
|
|
||||||
public static List<BaseElement_BM> GetAllAttachedBaseElements(GameElement_BM gameElement, List<BaseElement_BM> clip)
|
public static List<BaseElement_BM> GetAllAttachedBaseElements(GameElement_BM gameElement, List<BaseElement_BM> clip)
|
||||||
{
|
{
|
||||||
Guid elementGuid = gameElement.elementGuid;
|
Guid elementGuid = gameElement.elementGuid;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@ Editor内有console系统,用于执行某些方便的操作。
|
|||||||
|
|
||||||
输入框配有上下文,在输入时按上下箭头可以跳转到上一次的指令。
|
输入框配有上下文,在输入时按上下箭头可以跳转到上一次的指令。
|
||||||
|
|
||||||
输入格式按照 **指令 值 值 值** 的格式输入,其中值大多是数字值,如果是字符的话,需要带上双引号。
|
输入格式按照 **func "abc123" 1 2 [0,1,2]** 的格式输入,也可以用**func(1,2,3,"a",[1,2,3])**输入,其中值大多是数字值,如果是字符的话,需要带上双引号(`"abc123"`),如果是向量(vector2,3),就需要用中括号括起来(` [0,0,1] `)。
|
||||||
|
|
||||||
如果因为某种原因而导致指令执行失败的话,会在下面的log window有提醒。
|
如果因为某种原因而导致指令执行失败的话,会在下面的log window有提醒。
|
||||||
|
|
||||||
@@ -15,16 +15,23 @@ Editor内有console系统,用于执行某些方便的操作。
|
|||||||
## 命令列表
|
## 命令列表
|
||||||
|
|
||||||
(格式:命令名字 值1 值2 …值x)
|
(格式:命令名字 值1 值2 …值x)
|
||||||
|
tp(Vector3 pos)
|
||||||
|
将场景相机移动到指定的三维坐标 pos。
|
||||||
|
|
||||||
- **`lgp生成数 x轴开始 x轴结束 y轴开始 y轴结束 z轴开始 z轴结束 `**
|
tp()
|
||||||
(loop Generate Pathnode)输入全部是数字值,用于批量生成pathnode,记得选中track。
|
将场景相机移动到当前 Inspector 选中元素的位置。
|
||||||
|
|
||||||
如:`lgp 10 0 0 0 5 0 100` 在track下生成10个pathnode,y值从0到5,z值从0到100
|
|
||||||
|
|
||||||
- **`tp x y z`**
|
reName(string message)
|
||||||
将场景相机快速移动到某个地方,如果不输入xyz,那么会移动到所选项的位置。~~(和mc里一个样)~~
|
将当前 Inspector 选中元素的名称改为 message。
|
||||||
|
|
||||||
- 在做了
|
lgp(int loop, Vector3 start, Vector3 end)
|
||||||
|
在选中的 Track 上,按线性插值方式批量生成 loop 个 PathNode,起止点为 start 和 end。
|
||||||
|
|
||||||
|
spiral(int loop, Vector3 center, float r, float h, int pointsPerTurn, string axis = "y")
|
||||||
|
在选中的 Track 上,按指定主轴(x/y/z)和参数,批量生成螺旋线分布的 PathNode。
|
||||||
|
|
||||||
|
spiral(int loop, Vector3 center, float r, float h, int pointsPerTurn, Vector3 dir)
|
||||||
|
在选中的 Track 上,按任意方向(dir 向量)和参数,批量生成螺旋线分布的 PathNode。
|
||||||
|
|
||||||
## 其他
|
## 其他
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user