Exemplo n.º 1
0
 private void Awake()
 {
     _instance = this;
     DarkScreen.SetActive(false);
     Tooltips.SetActive(true);
     NumberButtonsManager.GenerateBoard(NumberPrefab);
     ShowDamageOptions(false);
 }
        // Start is called before the first frame update
        void Awake()
        {
            _numbers    = new NumberButtonScript[NumberButtonsManager.BOARD_SIZE];
            _numbers[0] = NumberButtonPrefab;

            _playerSide = GetComponent <Player>().playerSide;
            NumberButtonPrefab.SetValue(1, _playerSide);
            var squareWidth      = NumberButtonsManager.SquareWidth(NumberButtonPrefab);
            var originalPosition = NumberButtonPrefab.transform.localPosition;

            for (int i = 1; i < NumberButtonsManager.BOARD_SIZE; i++)
            {
                var x     = i % 3;
                var y     = i / 3;
                var clone = Instantiate(NumberButtonPrefab, NumberButtonPrefab.transform.parent);
                clone.SetValue(i + 1, _playerSide);
                clone.transform.localPosition = originalPosition + new Vector3(x * squareWidth, -y * squareWidth);
                _numbers[i] = clone;
            }
        }
Exemplo n.º 3
0
 public static void SetNumberOnSquare(Vector2 index, int currentValue, PlayerSide playerColor)
 {
     NumberButtonsManager.SetNumberOnSquare(index, currentValue, playerColor);
 }
Exemplo n.º 4
0
 public static void ShowSelectablePositions(Vector2[] squares)
 {
     NumberButtonsManager.SetSquaresForPuttingNumberOn(squares);
 }
Exemplo n.º 5
0
 public static void SquareChosen(Vector2 index)
 {
     NumberButtonsManager.MakeAllUnselectable();
     _instance.PlayerNumberPool.MakeNoneSelectable();
     ChoiceManager.PickSquare(index);
 }