尝试优化Inspector的排版
在输数字的地方输入框的输入限制可以改成十进制数,这样就不会因为输了字母然后报错了
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user