コード例 #1
0
        public ExpectedValuesMenuController(Module obj, GameObject popupPrefab)
        {
            this.module = obj;

            if (ExpectedValuesMenuController._popupPrefab == null && popupPrefab != null)
            {
                ExpectedValuesMenuController._popupPrefab = popupPrefab;
            }

            this.gameController = GameControllerWrapper.GetGameController();
            this.rootCanvas     = (Canvas)GameObject.FindObjectOfType(typeof(Canvas));

            this.texts       = ExpectedValuesMenuController.popupInstance.GetComponentsInChildren <Text>();
            this.textContent = this.texts[1];

            this.texts[0].text    = "Expected Values";
            this.textContent.text = "";
            this.CloseMenu();


            // Hide the menu when turn changes
            GameEvents.OnTurnChange((turnChangeArgs) => {
                this.CloseMenu();
            });
        }
コード例 #2
0
        public AttackMenuController(ICanBeAttacked obj, GameObject popupPrefab)
        {
            this.module = obj;

            if (AttackMenuController._popupPrefab == null && popupPrefab != null)
            {
                AttackMenuController._popupPrefab = popupPrefab;
            }

            this.gameController = GameControllerWrapper.GetGameController();
            this.rootCanvas     = (Canvas)GameObject.FindObjectOfType(typeof(Canvas));

            this.texts       = AttackMenuController.popupInstance.GetComponentsInChildren <Text>();
            this.textContent = this.texts[0];

            textContent.text = "Attack Menu";
            this.CloseMenu();


            // Hide the menu if it changes to the defender's turn
            GameEvents.OnTurnChange((turnChangeArgs) => {
                if (turnChangeArgs.State == GameState.DefenderTurn)
                {
                    this.CloseMenu();
                }
            });
        }