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 { public abstract class DynamicUIElement : MonoBehaviour { public TMP_Text title; public IBaseElement connectedBaseElement; /// /// 参数名,通过反射获取饿修改对应变量的值 /// public string parameterName; /// /// 是否始终更新,如果子类可能用到此变量,则在子类中写Update即可(注意,如果最后仅有Text用到此变量,直接移动它到Text即可) /// public bool isAlwaysUpdated; public virtual void Initialize(IBaseElement baseElement, string title, string parameterName) { this.connectedBaseElement = baseElement; this.parameterName = parameterName; if (title != string.Empty) { this.title.text = title; } else { this.title.gameObject.SetActive(false); } } public virtual void DeviverSet(int DeviveNum){ float o=2f/DeviveNum;//因为所有的单UI都是根据2栏来的 Button[] childb=GetComponentsInChildren