コード例 #1
0
        public void RefreshContent(HostedGameCellData cellInfo = null)
        {
            if (cellInfo != null)
            {
                _cellInfo = cellInfo;
            }

            FavoritesIcon.gameObject.SetActive(false);
            SongTime.gameObject.SetActive(true);
            SongBpm.gameObject.SetActive(true);
            BpmIcon.gameObject.SetActive(false);

            var game = _cellInfo.Game;

            // Player count
            SongTime.text     = $"{game.PlayerCount}/{game.PlayerLimit}";
            SongTime.fontSize = 4;

            // Lobby type (server + modded/vanilla indicator)
            SongBpm.text = game.DescribeType();

            // Text colors
            if (_cell.selected)
            {
                // Selected /w blue background: More contrasting color needed
                SongTime.color = Color.white;
                SongBpm.color  = Color.white;
            }
            else
            {
                SongTime.color = (game.PlayerCount >= game.PlayerLimit ? Color.gray : Color.white);
                SongBpm.color  = (game.IsModded ? new Color(143.0f / 255.0f, 72.0f / 255.0f, 219.0f / 255.0f, 1.0f)
                    : new Color(60.0f / 255.0f, 179.0f / 255.0f, 113.0f / 255.0f, 1.0f));
            }
        }
コード例 #2
0
        internal void Configure(SelectableCell cell, HostedGameCellData cellInfo)
        {
            this._cell     = cell;
            this._cellInfo = cellInfo;

            this._background = cell.transform.Find("Background").GetComponent <ImageView>();

            if (_enabled)
            {
                OnEnable();
            }
        }
コード例 #3
0
        public void RefreshContent(HostedGameCellData cellInfo = null)
        {
            if (cellInfo != null)
            {
                _cellInfo = cellInfo;
            }

            FavoritesIcon.gameObject.SetActive(false);
            SongTime.gameObject.SetActive(true);
            SongBpm.gameObject.SetActive(true);
            BpmIcon.gameObject.SetActive(false);

            var game = _cellInfo.Game;

            // Player count
            SongTime.text     = $"{game.PlayerCount}/{game.PlayerLimit}";
            SongTime.color    = (game.PlayerCount >= game.PlayerLimit ? Color.gray : Color.white);
            SongTime.fontSize = 4;

            // Lobby type (server + modded/vanilla indicator)
            SongBpm.text  = game.DescribeType();
            SongBpm.color = (game.IsModded ? Color.cyan : Color.green);
        }