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(); }
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; }
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; }
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); } }
public void ChangeTheme(string themeName) { BoardTheme theme = _themeDB.GetTheme(themeName); if (theme != null && theme != _theme) { _theme = theme; if (onThemeChanged != null) { onThemeChanged(_theme); } } }
void OnSwapTheme(BoardTheme theme) { if (theme == null) { return; } if (spriteRenderer != null) { spriteRenderer.sprite = theme.tileSprite; } _explodeRenderer.sprite = theme.explosionSprite; }
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; }
public static void Set(BoardTheme theme) { _instance = theme; }
public void Initialize(Combatant combatant, BoardTheme theme) { _combatant = combatant; _boardTheme = theme; }
public void Initialize(Board board, BoardTheme theme) { _board = board; _theme = theme; RebuildBoard(); }
private Color RandomizeColor(Color defaultColor) { float divisor = Random.Range(minimumDivisor, maximumDivisor); return(BoardTheme.EndarkenColor(defaultColor, divisor)); }