尝试优化Inspector的排版

在输数字的地方输入框的输入限制可以改成十进制数,这样就不会因为输了字母然后报错了
This commit is contained in:
2025-02-20 03:15:42 +08:00
parent 5349cde381
commit 28e8d54a7b
27 changed files with 761 additions and 479 deletions

View File

@@ -306,6 +306,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
title: {fileID: 4146383444293307128}
Parent: {fileID: 0}
parameterName:
isAlwaysUpdated: 0
button: {fileID: 9019888090477460756}
@@ -402,10 +403,10 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 24
m_fontSize: 35.8
m_fontSizeBase: 24
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0

View File

@@ -528,14 +528,14 @@ MonoBehaviour:
m_VerticalScrollbarEventHandler: {fileID: 0}
m_LayoutGroup: {fileID: 0}
m_ScrollSensitivity: 1
m_ContentType: 0
m_ContentType: 3
m_InputType: 0
m_AsteriskChar: 42
m_KeyboardType: 0
m_KeyboardType: 2
m_LineType: 0
m_HideMobileInput: 0
m_HideSoftKeyboard: 0
m_CharacterValidation: 0
m_CharacterValidation: 3
m_RegexValue:
m_GlobalPointSize: 14
m_CharacterLimit: 0
@@ -671,10 +671,10 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 18
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 2
@@ -1066,10 +1066,10 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 72
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0

View File

@@ -218,10 +218,10 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 18
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
@@ -571,14 +571,14 @@ MonoBehaviour:
m_VerticalScrollbarEventHandler: {fileID: 0}
m_LayoutGroup: {fileID: 0}
m_ScrollSensitivity: 1
m_ContentType: 0
m_ContentType: 3
m_InputType: 0
m_AsteriskChar: 42
m_KeyboardType: 0
m_KeyboardType: 2
m_LineType: 0
m_HideMobileInput: 0
m_HideSoftKeyboard: 0
m_CharacterValidation: 0
m_CharacterValidation: 3
m_RegexValue:
m_GlobalPointSize: 14
m_CharacterLimit: 0
@@ -1089,14 +1089,14 @@ MonoBehaviour:
m_VerticalScrollbarEventHandler: {fileID: 0}
m_LayoutGroup: {fileID: 0}
m_ScrollSensitivity: 1
m_ContentType: 0
m_ContentType: 3
m_InputType: 0
m_AsteriskChar: 42
m_KeyboardType: 0
m_KeyboardType: 2
m_LineType: 0
m_HideMobileInput: 0
m_HideSoftKeyboard: 0
m_CharacterValidation: 0
m_CharacterValidation: 3
m_RegexValue:
m_GlobalPointSize: 14
m_CharacterLimit: 0
@@ -1205,7 +1205,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Enter text...
m_text: 0
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@@ -1232,13 +1232,13 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 18
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 2
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
@@ -1596,10 +1596,10 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 72
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
@@ -1704,7 +1704,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Enter text...
m_text: 0
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@@ -1731,13 +1731,13 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 18
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 2
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
@@ -1885,10 +1885,10 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 72
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
@@ -2052,14 +2052,14 @@ MonoBehaviour:
m_VerticalScrollbarEventHandler: {fileID: 0}
m_LayoutGroup: {fileID: 0}
m_ScrollSensitivity: 1
m_ContentType: 0
m_ContentType: 3
m_InputType: 0
m_AsteriskChar: 42
m_KeyboardType: 0
m_KeyboardType: 2
m_LineType: 0
m_HideMobileInput: 0
m_HideSoftKeyboard: 0
m_CharacterValidation: 0
m_CharacterValidation: 3
m_RegexValue:
m_GlobalPointSize: 14
m_CharacterLimit: 0
@@ -2279,14 +2279,14 @@ MonoBehaviour:
m_VerticalScrollbarEventHandler: {fileID: 0}
m_LayoutGroup: {fileID: 0}
m_ScrollSensitivity: 1
m_ContentType: 0
m_ContentType: 3
m_InputType: 0
m_AsteriskChar: 42
m_KeyboardType: 0
m_KeyboardType: 2
m_LineType: 0
m_HideMobileInput: 0
m_HideSoftKeyboard: 0
m_CharacterValidation: 0
m_CharacterValidation: 3
m_RegexValue:
m_GlobalPointSize: 14
m_CharacterLimit: 0
@@ -2656,7 +2656,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Enter text...
m_text: 0
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@@ -2683,13 +2683,13 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 18
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 2
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
@@ -2837,10 +2837,10 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 72
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
@@ -3120,7 +3120,7 @@ MonoBehaviour:
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_HighlightedColor: {r: 1, g: 0.4481132, b: 0.4481132, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
@@ -3309,10 +3309,10 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 72
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
@@ -3685,7 +3685,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Enter text...
m_text: 0
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@@ -3712,13 +3712,13 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 18
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 2
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535

View File

@@ -177,14 +177,14 @@ MonoBehaviour:
m_VerticalScrollbarEventHandler: {fileID: 0}
m_LayoutGroup: {fileID: 0}
m_ScrollSensitivity: 1
m_ContentType: 0
m_ContentType: 3
m_InputType: 0
m_AsteriskChar: 42
m_KeyboardType: 0
m_KeyboardType: 2
m_LineType: 0
m_HideMobileInput: 0
m_HideSoftKeyboard: 0
m_CharacterValidation: 0
m_CharacterValidation: 3
m_RegexValue:
m_GlobalPointSize: 14
m_CharacterLimit: 0
@@ -620,14 +620,14 @@ MonoBehaviour:
m_VerticalScrollbarEventHandler: {fileID: 0}
m_LayoutGroup: {fileID: 0}
m_ScrollSensitivity: 1
m_ContentType: 0
m_ContentType: 3
m_InputType: 0
m_AsteriskChar: 42
m_KeyboardType: 0
m_KeyboardType: 2
m_LineType: 0
m_HideMobileInput: 0
m_HideSoftKeyboard: 0
m_CharacterValidation: 0
m_CharacterValidation: 3
m_RegexValue:
m_GlobalPointSize: 14
m_CharacterLimit: 0
@@ -736,7 +736,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Enter text...
m_text: 0
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@@ -763,13 +763,13 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 18
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 2
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
@@ -974,10 +974,10 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 72
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
@@ -1134,7 +1134,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Enter text...
m_text: 0
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@@ -1161,13 +1161,13 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 18
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 2
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
@@ -1315,10 +1315,10 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 72
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0

View File

@@ -724,7 +724,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.11854753, g: 0.17248131, b: 0.2264151, a: 1}
m_Color: {r: 0.11854753, g: 0.17248131, b: 0.2264151, a: 0.39215687}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@@ -757,9 +757,9 @@ MonoBehaviour:
m_Horizontal: 0
m_Vertical: 1
m_MovementType: 1
m_Elasticity: 0.1
m_Elasticity: 0.01
m_Inertia: 1
m_DecelerationRate: 0.135
m_DecelerationRate: 0.05
m_ScrollSensitivity: 100
m_Viewport: {fileID: 0}
m_HorizontalScrollbar: {fileID: 0}
@@ -886,7 +886,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 215, y: 0}
m_SizeDelta: {x: 50, y: 50}
m_SizeDelta: {x: 60, y: 45}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6548761174430130557
CanvasRenderer:

View File

@@ -402,10 +402,10 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 24.15
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 2
@@ -609,10 +609,10 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 72
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0

View File

@@ -597,10 +597,10 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 14
m_fontSize: 24.15
m_fontSizeBase: 14
m_fontWeight: 400
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0

View File

@@ -287,7 +287,7 @@ MonoBehaviour:
m_fontSizeMin: 15
m_fontSizeMax: 36
m_fontStyle: 0
m_HorizontalAlignment: 1
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0

View File

@@ -36,8 +36,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -82.5, y: -10}
m_SizeDelta: {x: 75, y: 50}
m_AnchoredPosition: {x: -150, y: -10}
m_SizeDelta: {x: 125, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8816247129259985422
CanvasRenderer:
@@ -221,7 +221,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 34.3}
m_AnchoredPosition: {x: -113, y: 34.3}
m_SizeDelta: {x: 200, y: 35}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2730124660575366187
@@ -853,8 +853,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 82.5, y: -10}
m_SizeDelta: {x: 75, y: 50}
m_AnchoredPosition: {x: 150, y: -10}
m_SizeDelta: {x: 125, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7596590615969385144
CanvasRenderer:
@@ -1248,7 +1248,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -10}
m_SizeDelta: {x: 75, y: 50}
m_SizeDelta: {x: 125, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3841134997005631993
CanvasRenderer:
@@ -1756,7 +1756,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 240, y: 100}
m_SizeDelta: {x: 450, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &9001319910968385871
MonoBehaviour:

View File

@@ -298,7 +298,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -15, y: -87.5}
m_SizeDelta: {x: 1, y: 120}
m_SizeDelta: {x: 2, y: 120}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7763882505229129983
CanvasRenderer:

File diff suppressed because one or more lines are too long

View File

@@ -14,6 +14,7 @@ using Unity.VisualScripting;
using Ichni.RhythmGame;
using Sirenix.Utilities;
using UnityEngine.InputSystem;
using TMPro;
//又在写大粪 ——神币
namespace Ichni.Editor
@@ -22,14 +23,14 @@ namespace Ichni.Editor
{
public Interpreter functionInterpreter;
public InputField InputCommand;
public TMP_InputField InputCommand;
private Dictionary<int,string> historyCommand=new Dictionary<int,string>();
private int historycount=0;
public GameObject ConsoleUI;
public Hierarchy hierarchy;
public Inspector inspector;
bool isHide=false;
bool isHide=true;
public void GetChange(string change){
@@ -47,8 +48,8 @@ namespace Ichni.Editor
}
private void Update(){
if(Keyboard.current.backquoteKey.wasPressedThisFrame){
hierarchy.gameObject.SetActive(isHide);
inspector.gameObject.SetActive(isHide);
ConsoleUI.SetActive(isHide);
isHide=!isHide;
}
if(InputCommand.isFocused){
@@ -79,26 +80,25 @@ namespace Ichni.Editor
SetUpFunctions();
//Test
functionInterpreter.Eval("print(\"Hello World!\")");
functionInterpreter.Eval("log(\"Hello World but debug!\")");
// functionInterpreter.Eval("print(\"Hello World!\")");
// functionInterpreter.Eval("log(\"Hello World but debug!\")");
}
}
public partial class EditorConsole
{
private delegate void Batch(string name,string prop,int loop,string expression);
private Batch _batch;
private void SetUpFunctions()
{
functionInterpreter = new Interpreter();
functionInterpreter.SetFunction("test",(Action)Test);
functionInterpreter.SetFunction("loopg", (Action<string,int>)LoopGenerate);
functionInterpreter.SetFunction("lgp", (Action<string,int>)LGenPathNodes);
functionInterpreter.SetFunction("print", (Action<object>)print);
functionInterpreter.SetFunction("log", (Action<object>)Debug.Log);
_batch=BatchGenerate;
functionInterpreter.SetFunction("BatchGenerate",_batch);
}
@@ -121,33 +121,26 @@ namespace Ichni.Editor
}
}
//TODO duotrack选择菜单
if(obji.IsNullOrEmpty()){
Debug.LogWarning("no find");
return null;}
return obji[0];
}
private void BatchGenerate(string name,string prop,int loop,string expression){//
GameElement[] allObjects = Resources.FindObjectsOfTypeAll(typeof(GameElement)) as GameElement[];
List<int> objs=new();
foreach (GameElement obj in allObjects){
if(obj.elementName==name)objs.Add(obj.GetInstanceID());
}
print(objs);
//TODO: 预制件,属性,循环数,表达式
print("在做了");
}
private void LoopGenerate(string name,int time){
private void LGenPathNodes(string name,int loop){
Track track= (Track)Find(name);
for(int i=0;i<time;i++){
PathNode.GenerateElement("PathNodes", Guid.NewGuid(), new List<string>(), true,track);
for(int i=0;i<loop;i++){
var p=PathNode.GenerateElement("PathNodes", Guid.NewGuid(), new List<string>(), true,track);
}

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
@@ -9,9 +10,23 @@ namespace Ichni.Editor
{
public class DynamicUIContainer : MonoBehaviour
{
Inspector Inspector => EditorManager.instance.uiManager.inspector;
public TMP_Text title;
public GridLayoutGroup gridLayoutGroup;
public List<DynamicUIElement> dynamicUIElements = new List<DynamicUIElement>();
[FormerlySerializedAs("container")] public RectTransform rect;
public void SetDeviver(int num){//rect 500
gridLayoutGroup.cellSize=new Vector2(Inspector.inspectorRect.rect.width/num,gridLayoutGroup.cellSize.y);
bool CanCompress=true;//这是是想着如果没有按钮以外的东西就把y值调小一点的
foreach(var i in GetComponentsInChildren<DynamicUIElement>()){
i.DeviverSet(num);
if(i.GetType()!=typeof(DynamicUIButton))CanCompress=false;
}
if(CanCompress)gridLayoutGroup.cellSize=new Vector2(gridLayoutGroup.cellSize.x,gridLayoutGroup.cellSize.y/2);
}
}
}

View File

@@ -1,9 +1,11 @@
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using Ichni.RhythmGame;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
namespace Ichni.Editor
{
@@ -24,6 +26,7 @@ namespace Ichni.Editor
public virtual void Initialize(IBaseElement baseElement, string title, string parameterName)
{
this.connectedBaseElement = baseElement;
this.parameterName = parameterName;
if (title != string.Empty)
@@ -34,8 +37,23 @@ namespace Ichni.Editor
{
this.title.gameObject.SetActive(false);
}
}
public virtual void DeviverSet(int DeviveNum){
float o=2f/DeviveNum;//因为所有的单UI都是根据2栏来的
Button[] childb=GetComponentsInChildren<Button>();
TMP_Text[] childt=GetComponentsInChildren<TMP_Text>();
foreach (var i in childb){
RectTransform rectTransform = i.GetComponent<RectTransform>();
rectTransform.sizeDelta=new Vector2(rectTransform.sizeDelta.x*o,rectTransform.sizeDelta.y);
}
foreach (var i in childt){
RectTransform rectTransform = i.GetComponent<RectTransform>();
rectTransform.sizeDelta=new Vector2(rectTransform.sizeDelta.x*o,rectTransform.sizeDelta.y);
}
}
//public abstract void ApplyParameters();
}
}

View File

@@ -18,7 +18,7 @@ namespace Ichni.Editor
public TMP_InputField inputFieldEmissionI;
public Image colorPreview;
public new void Initialize(IBaseElement baseElement, string title,
public void Initialize(IBaseElement baseElement, string title,
string emissionEnabledName, string colorParameterName, string emissionIntensityName)
{
base.Initialize(baseElement, title, colorParameterName);

View File

@@ -28,7 +28,9 @@ namespace Ichni.Editor
inputFieldY.onEndEdit.AddListener(_ => ApplyParameters());
inputFieldZ.onEndEdit.AddListener(_ => ApplyParameters());
}
public override void DeviverSet(int i){
//我什么也不做
}
private void ApplyParameters()
{
Vector3 newValue = new Vector3(float.Parse(inputFieldX.text), float.Parse(inputFieldY.text), float.Parse(inputFieldZ.text));

View File

@@ -26,10 +26,11 @@ namespace Ichni.Editor
public void PlayMusic()
{
isPlaying = true;
isPlaying = !isPlaying;
Trail.SetAllTrails(true, false);
EditorManager.instance.songInformation.songTime = audioSource.time;
audioSource.Play();
if( isPlaying)audioSource.Play();
else audioSource.Pause();
}
public void PauseMusic()

View File

@@ -14,4 +14,5 @@ namespace Ichni.Editor
public TimePointerModule timePointerModule;
public MusicPlayer musicPlayer;
}
}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b6eb61dffe3843041b021e96e9c7cb0b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -87,6 +87,7 @@ namespace Ichni.RhythmGame
{
inspector.GenerateCompositeParameterWindow(this, "Position Z", nameof(positionZ)).SetAsFlexibleFloat();
});
container.SetDeviver(1);
}
}

View File

@@ -87,6 +87,7 @@ namespace Ichni.RhythmGame
public override void SetUpInspector()
{
var container = inspector.GenerateContainer("Transform");
var originalPosInputField =
inspector.GenerateVec3InputField(this, container, "Start Position", nameof(originalPosition));
var originalRotInputField =
@@ -103,6 +104,9 @@ namespace Ichni.RhythmGame
originalPosInputField.AddListenerFunction(Refresh);
originalRotInputField.AddListenerFunction(Refresh);
originalScaleInputField.AddListenerFunction(Refresh);
//这玩意得放在最下面
container.SetDeviver(1);
}
public override void Refresh()

View File

@@ -76,6 +76,7 @@ namespace Ichni.RhythmGame
var timeEffectsCollectionButton = inspector.GenerateButton(this, container, "Time Effects Collection",
() => TimeEffectsCollection.GenerateElement("New Time Effects Collection", Guid.NewGuid(),
new List<string>(), true, this, 0f));
container.SetDeviver(1);
}
}

View File

@@ -141,6 +141,7 @@ namespace Ichni.RhythmGame
Swirl.GenerateElement("New Swirl", Guid.NewGuid(), new List<string>(), true, this,
new FlexibleFloat(), new FlexibleFloat(), new FlexibleFloat());
});
container.SetDeviver(1);
}
}

View File

@@ -1 +1,2 @@
Ф&<26>ы<EFBFBD><D18B><EFBFBD>"<22>Ыvі<76>ЕТ<D095>ДщТ<D189><D0A2>Вю9ѕс@<40>w?TЂх<шVњБЅТ<D085>ЗтZЃDеR<D0B5>ф0(<28>Юі<D0AE>ѓ4(Ф$<24><15>L<EFBFBD>оF~И2<D098><32>ЭМ
Ř]ˇ~Š9‡^IôH Íň”ĆÉűŕD/Cj§á-u•<75>™.Ún,]a,Ţ8)%…XQbńČéiŰ<69>ñŃĂ,ŠV1«€Äµ šÉ´\Í[¸EĽśĺNáĘE{¦•ĘÉŽp„îĚ<ޱŘ75¬ËTq<54>9h5 Ě9‡ţů
Ź‚„ü%©Gé5ěß1ĆV-i±{—}»'MÔĺ yI˝°/őp:@

View File

@@ -1,3 +1 @@
§±E8¼¯ ÞNXª&R1Ϊ8ë˜Ù€<,WPlINûW-rݸU÷ìµÙFq®ã :
´]-¨ùWÕ˜*¬±þ}jû„<C3BB>î|·ïo¦äþQqTtoœ\'W™
ĆI'űň<C5B1>®îXĘćš VđPCYYǰ{Ç…ĂŠŘ{ę[LÖcŠąEz®ę>^ŢüË_Ł\mîěë@Ś&4;pÚ)/)0ŚčĚŠť{ß®<^än+ţ >ş„F iE\ZŢ3MÍŠź<C5A0>ĐĹÂŞáńu25^yy1ň"·ëŽ"T2Ĺ`Ŕč„cÍTľ&ý˘<C3BD>»(Ă«Dľö ;*eŹäB Ův•”ř°•TŹô‹ęýÜ&…€yŔ€