Esempio n. 1
0
    void Initialize()
    {
        _cachedMainCamera = Camera.main;

        SingleTouchManager.instance.DragSensitivity = LunarVariables.dragSensitivity;

        LeanTween.init(800);

        float defaultRatio = GameConstants.DEFAULT_SCREEN_WIDTH / GameConstants.DEFAULT_SCREEN_HEIGHT;
        float screenRatio  = (float)Screen.width / Screen.height;

        transform.localScale *= Mathf.Min(screenRatio / defaultRatio, 1.0f);

        TILE_LAYER  = LayerMask.NameToLayer("Tile");
        BLOCK_LAYER = LayerMask.NameToLayer("Block");

        _theme = _themeDB.GetTheme(_selectedTheme);
        if (_theme == null)
        {
            _theme = _themeDB.GetTheme(0);
        }

        IncreaseCellBuffer(_board.tiles.Length);

        _board.Initialize();
        _block.Initialize();

        ResetReplayInterstitialTime();
    }
        public void SetThemes(BoardTheme board, PieceTheme piece)
        {
            BoardImages = board;
            PieceImages = piece;

            chessBoardPanel.Refresh();
        }
Esempio n. 3
0
        public ThemeSelectionForm(ThemeDatabase db, BoardTheme currentBoardTheme, PieceTheme currentPieceTheme)
        {
            InitializeComponent();

            Icon = Properties.Resources.application_icon;

            Themes             = db;
            SelectedBoardTheme = currentBoardTheme;
            SelectedPieceTheme = currentPieceTheme;

            chessBoard.SetThemes(SelectedBoardTheme, SelectedPieceTheme);

            confirmButton.DialogResult = DialogResult.OK;
            cancelButton.DialogResult  = DialogResult.Cancel;

            foreach (var kv in Themes.BoardThemes)
            {
                boardThemesListBox.Items.Add(kv.Key);
            }

            foreach (var kv in Themes.PieceThemes)
            {
                pieceThemesListBox.Items.Add(kv.Key);
            }

            boardThemesListBox.SelectedItem = SelectedBoardTheme.Name;
            pieceThemesListBox.SelectedItem = SelectedPieceTheme.Name;
        }
Esempio n. 4
0
 private void ReloadSettings()
 {
     _stoneDisplayTheme   = _settings.Display.StonesTheme;
     _boardTheme          = _settings.Display.BoardTheme;
     this.ShowCoordinates = _settings.Display.ShowCoordinates;
     _boardLineThickness  = this.SharedBoardControlState?.BoardLineThickness ?? 1;
     _highlightLastMove   = _settings.Display.HighlightLastMove;
 }
Esempio n. 5
0
    public static BoardTheme CreateAsset()
    {
        BoardTheme theme = CreateInstance <BoardTheme>();

        AssetDatabase.CreateAsset(theme, PATH);
        AssetDatabase.Refresh();

        return(theme);
    }
    public void Initialize(ICharacterFactory characters, Board board, BoardTheme theme)
    {
        _characters = characters;
        _board = board;
        _theme = theme;

        _board.PawnAdded += OnPawnAdded;
        _board.PawnRemoved += OnPawnRemoved;

        IEnumerator<Pawn> pawnIter = _board.GetPawnIterator();
        while (pawnIter.MoveNext()) {
            OnPawnAdded(pawnIter.Current);
        }
    }
Esempio n. 7
0
    public void ChangeTheme(string themeName)
    {
        BoardTheme theme = _themeDB.GetTheme(themeName);

        if (theme != null &&
            theme != _theme)
        {
            _theme = theme;
            if (onThemeChanged != null)
            {
                onThemeChanged(_theme);
            }
        }
    }
Esempio n. 8
0
    void OnSwapTheme(BoardTheme theme)
    {
        if (theme == null)
        {
            return;
        }

        if (spriteRenderer != null)
        {
            spriteRenderer.sprite = theme.tileSprite;
        }

        _explodeRenderer.sprite = theme.explosionSprite;
    }
Esempio n. 9
0
    void OnSwapTheme(BoardTheme theme)
    {
        if (theme == null)
        {
            return;
        }

        CellSprite sprite = theme.GetCellSprite(_number);

        if (sprite != null)
        {
            spriteRenderer.sprite = sprite.sprite;

            _specularMask.sprite = sprite.sprite;
            _numberText.gameObject.SetActive(sprite.displayNumber);
        }
        else
        {
            spriteRenderer.sprite = defaultSprite;

            _specularMask.sprite = defaultSprite;
            _numberText.gameObject.SetActive(true);
        }
    }
 public void Initialize(BoardTheme theme)
 {
     _theme = theme;
 }
Esempio n. 11
0
 public static void Set(BoardTheme theme)
 {
     _instance = theme;
 }
 public void Initialize(Combatant combatant, BoardTheme theme)
 {
     _combatant = combatant;
     _boardTheme = theme;
 }
Esempio n. 13
0
 public void Initialize(Board board, BoardTheme theme)
 {
     _board = board;
     _theme = theme;
     RebuildBoard();
 }
Esempio n. 14
0
    private Color RandomizeColor(Color defaultColor)
    {
        float divisor = Random.Range(minimumDivisor, maximumDivisor);

        return(BoardTheme.EndarkenColor(defaultColor, divisor));
    }