Files
ichni_Creator_Studio/Assets/Scripts/Console/EditorConsole.cs
TRAfoer b5bfa877da Add Console
不知道写了什么
2025-02-04 15:05:05 +08:00

69 lines
1.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DynamicExpresso;
using UnityEngine.UI;
using Dreamteck;
using System.Text.RegularExpressions;
//目前为止我还不知道我在做什么但是等我搞懂DynamicExpresso可能就会好一点 ——神币
namespace Ichni.Editor
{
public partial class EditorConsole : MonoBehaviour
{
public Interpreter functionInterpreter;
public InputField InputCommand;
public GameObject ConsoleUI;
public void GetCommand()//当提交命令时
{
string[] Command =InputCommand.text.Split(" ");
switch(Command[0]){
case "help":
print("帮助菜单");
break;
case "batgenerate":
//
GameObject Prefab=new();
//
BatchGenerate(Prefab,Command[2],int.Parse(Command[3]),Command[4]);
break;
default:
print("No command match!");
break;
}
InputCommand.text="";
}
private void Start()
{
SetUpFunctions();
//Test
functionInterpreter.Eval("Log(\"Hello World!\")");
}
}
public partial class EditorConsole
{
private void SetUpFunctions()
{
functionInterpreter = new Interpreter();
functionInterpreter.SetFunction("Log", (System.Action<object>)Debug.Log);
}
private void BatchGenerate(GameObject objet,string prop,int loop,string expression){//
//TODO: 预制件,属性,循环数,表达式
print("在做了");
}
}
}