Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        private void UpdateUiManpower()
        {
            var mpg = GameObject.FindObjectOfType <ui_ManPowerManage>();

            if (mpg == null)
            {
                return;
            }
            ReflectionMethod.Invoke(mpg, "UpdateTotalManPower");
            ReflectionMethod.Invoke(mpg, "UpdateMarkedPlace");
        }