This commit is contained in:
CortexCore
2023-10-02 23:24:56 +08:00
parent 8ef5c7ec0a
commit 947e52e748
183 changed files with 107857 additions and 9378 deletions

View File

@@ -4,6 +4,7 @@ using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Experimental.Audio;
using UnityEngine.UIElements;
namespace BITKit
@@ -12,6 +13,7 @@ namespace BITKit
{
private Slider _timeScaleSlider;
private Button _resetTimeScaleButton;
private TextField _commandTextField;
[MenuItem("Tools/Common Editor")]
private static void OpenEditor()
@@ -42,9 +44,20 @@ namespace BITKit
Time.timeScale = 1;
_timeScaleSlider.value = 1;
};
rootVisualElement.Add(_timeScaleSlider);
rootVisualElement.Add(_resetTimeScaleButton);
_commandTextField = rootVisualElement.Create<TextField>();
_commandTextField.isDelayed = true;
_commandTextField.RegisterCallback<ChangeEvent<string>>(ExecuteCommand);
}
private void ExecuteCommand(ChangeEvent<string> evt)
{
Debug.Log($"Execute command: {evt.newValue}");
_commandTextField.SetValueWithoutNotify(string.Empty);
BITCommands.Excute(evt.newValue);
}
}
}

View File

@@ -4,7 +4,6 @@ using UnityEditor.Build.Reporting;
using UnityEngine;
using UnityEditor.Callbacks;
using System.IO;
using BITModel;
using Newtonsoft.Json;
namespace BITKit
{