예제 #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();
            });
        }
        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();
                }
            });
        }
예제 #3
0
 private void Start()
 {
     this.gameController = new GameControllerWrapper();
 }
예제 #4
0
 public GameControllerWrapper()
 {
     this.gameController = GameControllerWrapper.GetGameController();
 }