mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-08 21:33:28 +08:00
code cleanup
This commit is contained in:
@@ -121,8 +121,8 @@ public class MyKeyBinder : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool TrySetValue()
|
||||
|
||||
private bool TrySetValue()
|
||||
{
|
||||
if (Input.GetKey(KeyCode.Escape))
|
||||
{
|
||||
@@ -155,7 +155,7 @@ public class MyKeyBinder : MonoBehaviour
|
||||
KeyCode.LeftCommand, KeyCode.LeftApple, KeyCode.LeftWindows,
|
||||
KeyCode.RightCommand, KeyCode.RightApple, KeyCode.RightWindows };
|
||||
|
||||
public string GetPressedKey()
|
||||
private string GetPressedKey()
|
||||
{
|
||||
var key = _lastKey.ToString();
|
||||
if (string.IsNullOrEmpty(key))
|
||||
@@ -179,7 +179,7 @@ public class MyKeyBinder : MonoBehaviour
|
||||
}
|
||||
|
||||
//通常キーが押されているかチェック _lastKey に保存
|
||||
public bool GetIunptKeys()
|
||||
private bool GetIunptKeys()
|
||||
{
|
||||
var anyKey = false;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.UI;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace UXAssist.UI;
|
||||
|
||||
@@ -133,14 +134,13 @@ public class MyWindow: ManualBehaviour
|
||||
if (t != null)
|
||||
{
|
||||
t.text = text.Translate();
|
||||
t.fontSize = fontSize;
|
||||
}
|
||||
t.fontSize = fontSize;
|
||||
btn.button.onClick.RemoveAllListeners();
|
||||
_buttons[btn] = onClick;
|
||||
if (EventRegistered)
|
||||
if (EventRegistered && onClick != null)
|
||||
{
|
||||
if (onClick != null)
|
||||
btn.button.onClick.AddListener(onClick);
|
||||
btn.button.onClick.AddListener(onClick);
|
||||
}
|
||||
return btn;
|
||||
}
|
||||
@@ -215,7 +215,7 @@ public class MyWindow: ManualBehaviour
|
||||
|
||||
public class MyWindowWithTabs : MyWindow
|
||||
{
|
||||
private readonly List<Tuple<RectTransform, UIButton>> _tabs = new();
|
||||
private readonly List<Tuple<RectTransform, UIButton>> _tabs = [];
|
||||
private float _tabY = 54f;
|
||||
public override void TryClose()
|
||||
{
|
||||
@@ -347,10 +347,10 @@ public static class MyWindowManager
|
||||
{
|
||||
var srcWin = UIRoot.instance.uiGame.tankWindow;
|
||||
var src = srcWin.gameObject;
|
||||
var go = GameObject.Instantiate(src, UIRoot.instance.uiGame.transform.parent);
|
||||
var go = Object.Instantiate(src, UIRoot.instance.uiGame.transform.parent);
|
||||
go.name = name;
|
||||
go.SetActive(false);
|
||||
GameObject.Destroy(go.GetComponent<UITankWindow>());
|
||||
Object.Destroy(go.GetComponent<UITankWindow>());
|
||||
var win = go.AddComponent<T>() as MyWindow;
|
||||
if (win == null)
|
||||
return null;
|
||||
@@ -369,7 +369,7 @@ public static class MyWindowManager
|
||||
}
|
||||
else if (child.name != "shadow" && child.name != "panel-bg")
|
||||
{
|
||||
GameObject.Destroy(child);
|
||||
Object.Destroy(child);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user