mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-19 17:05:20 +08:00
fix(UXAssist): reset cloned UI state
This commit is contained in:
1 parent
f611f2f9b3
commit
574919f1f0
21 files changed
+308
-58
No files matched your search
@@ -38,6 +38,7 @@ public class MyCheckButton : MonoBehaviour
|
||||
var go = Instantiate(UIRoot.instance.uiGame.beltWindow.reverseButton.gameObject);
|
||||
go.name = "my-checkbutton";
|
||||
go.SetActive(false);
|
||||
Util.ResetButton(go.GetComponent<UIButton>());
|
||||
var comp = go.transform.Find("text");
|
||||
if (comp)
|
||||
{
|
||||
@@ -46,6 +47,8 @@ public class MyCheckButton : MonoBehaviour
|
||||
{
|
||||
txt.text = "";
|
||||
txt.alignment = TextAnchor.MiddleCenter;
|
||||
txt.color = Color.white;
|
||||
txt.fontStyle = FontStyle.Normal;
|
||||
txt.rectTransform.anchorMax = new Vector2(0f, 1f);
|
||||
txt.rectTransform.anchorMin = new Vector2(0f, 1f);
|
||||
txt.rectTransform.pivot = new Vector2(0f, 1f);
|
||||
@@ -82,6 +85,7 @@ public class MyCheckButton : MonoBehaviour
|
||||
|
||||
cb.rectTrans = rect;
|
||||
cb.uiButton = go.GetComponent<UIButton>();
|
||||
Util.ResetButton(cb.uiButton);
|
||||
|
||||
var child = go.transform.Find("text");
|
||||
if (child != null)
|
||||
@@ -91,6 +95,8 @@ public class MyCheckButton : MonoBehaviour
|
||||
{
|
||||
cb.labelText.text = "";
|
||||
cb.labelText.fontSize = fontSize;
|
||||
cb.labelText.color = Color.white;
|
||||
cb.labelText.fontStyle = FontStyle.Normal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user