1
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -4,7 +4,6 @@ using UnityEditor.Build.Reporting;
|
||||
using UnityEngine;
|
||||
using UnityEditor.Callbacks;
|
||||
using System.IO;
|
||||
using BITModel;
|
||||
using Newtonsoft.Json;
|
||||
namespace BITKit
|
||||
{
|
||||
|
Reference in New Issue
Block a user