upgrade
This commit is contained in:
51
Packages/Runtime~/Unity/Editor/BITEditorForUnity.cs
Normal file
51
Packages/Runtime~/Unity/Editor/BITEditorForUnity.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace BITKit
|
||||
{
|
||||
public class BITEditorForUnity : EditorWindow
|
||||
{
|
||||
private Slider _timeScaleSlider;
|
||||
private Button _resetTimeScaleButton;
|
||||
|
||||
[MenuItem("Tools/Common Editor")]
|
||||
private static void OpenEditor()
|
||||
{
|
||||
var window = GetWindow<BITEditorForUnity>();
|
||||
window.titleContent = new GUIContent("BIT Editor");
|
||||
window.Show();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
rootVisualElement.styleSheets.Add(BITEditorUtils.InspectorStyleSheet);
|
||||
|
||||
_timeScaleSlider = new Slider()
|
||||
{
|
||||
label = "TimeScale",
|
||||
showInputField = true,
|
||||
value = Time.timeScale
|
||||
};
|
||||
_timeScaleSlider.RegisterValueChangedCallback(x => { Time.timeScale = x.newValue; });
|
||||
|
||||
_resetTimeScaleButton = new Button()
|
||||
{
|
||||
text = "Reset TimeScale",
|
||||
};
|
||||
_resetTimeScaleButton.clicked += () =>
|
||||
{
|
||||
Time.timeScale = 1;
|
||||
_timeScaleSlider.value = 1;
|
||||
};
|
||||
|
||||
rootVisualElement.Add(_timeScaleSlider);
|
||||
rootVisualElement.Add(_resetTimeScaleButton);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
11
Packages/Runtime~/Unity/Editor/BITEditorForUnity.cs.meta
Normal file
11
Packages/Runtime~/Unity/Editor/BITEditorForUnity.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4af8b62f1e9db2045a42831c3cb3ab77
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user