public void Init() { // 设置点击事件 var manpowerText = ReflectionMethod.GetValue <ui_TopBar, CText>(ui_TopBar_Awake_Patch.TopBar, "ManpowerText"); var btn = manpowerText.transform.parent.parent.gameObject.AddComponent <Button>(); btn.targetGraphic = manpowerText; btn.interactable = true; btn.onClick.AddListener(ToggleWindow); }
private void UpdateUiManpower() { var mpg = GameObject.FindObjectOfType <ui_ManPowerManage>(); if (mpg == null) { return; } ReflectionMethod.Invoke(mpg, "UpdateTotalManPower"); ReflectionMethod.Invoke(mpg, "UpdateMarkedPlace"); }