mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-02-04 17:02:17 +08:00
UXAssist v1.2.20
This commit is contained in:
@@ -66,6 +66,7 @@ public class MyCheckBox : MonoBehaviour
|
||||
cb.uiButton = go.GetComponent<UIButton>();
|
||||
cb.boxImage = go.transform.GetComponent<Image>();
|
||||
cb.checkImage = go.transform.Find("checked")?.GetComponent<Image>();
|
||||
Util.NormalizeRectWithTopLeft(cb.checkImage, 0f, 0f);
|
||||
|
||||
var child = go.transform.Find("text");
|
||||
if (child != null)
|
||||
@@ -151,6 +152,16 @@ public class MyCheckBox : MonoBehaviour
|
||||
return this;
|
||||
}
|
||||
|
||||
public MyCheckBox WithSmallerBox(float boxSize = 20f)
|
||||
{
|
||||
var oldWidth = rectTrans.sizeDelta.x;
|
||||
rectTrans.sizeDelta = new Vector2(boxSize, boxSize);
|
||||
checkImage.rectTransform.sizeDelta = new Vector2(boxSize, boxSize);
|
||||
labelText.rectTransform.sizeDelta = new Vector2(labelText.rectTransform.sizeDelta.x, boxSize);
|
||||
labelText.rectTransform.localPosition = new Vector3(labelText.rectTransform.localPosition.x + boxSize - oldWidth, labelText.rectTransform.localPosition.y, labelText.rectTransform.localPosition.z);
|
||||
return this;
|
||||
}
|
||||
|
||||
public MyCheckBox WithEnable(bool on)
|
||||
{
|
||||
SetEnable(on);
|
||||
|
||||
@@ -127,6 +127,12 @@ public class MySideSlider : MonoBehaviour
|
||||
return this;
|
||||
}
|
||||
|
||||
public MySideSlider WithFontSize(int fontSize)
|
||||
{
|
||||
labelText.fontSize = fontSize;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MySideSlider WithEnable(bool on)
|
||||
{
|
||||
SetEnable(on);
|
||||
|
||||
Reference in New Issue
Block a user