Esempio n. 1
0
        private void fadeScoreboard(float fadeToVal, float fadeDur)
        {
            isScoreboardVisible = (fadeToVal > 0f);

            if (fadeToVal == 1f)
            {
                Debug.Log(Time.time + " Fading scoreboard in");
            }
            else
            {
                Debug.Log(Time.time + " Fading scoreboard out");
            }

            // fade scoreboard alpha in/out
            scoreboardCanvasGroup.DOFade(fadeToVal, fadeDur);

            // move scoreboard up/down
            Vector3 moveToPos = scoreboardPosOrig;

            if (fadeToVal == 0f)
            {
                moveToPos.y -= fadeMovementYDistance;
            }
            scoreboardUI.transform.DOMove(moveToPos, fadeDur);
        }
Esempio n. 2
0
        private void updateScoreboardData(IBasketballMetadataModel basketballMetadataModel)
        {
            Debug.Log(Time.time + " UpdateScoreboardData");

            if (!isTeamDataSet)
            {
                setTeamData(basketballMetadataModel.HomeTeamID, basketballMetadataModel.AwayTeamID);
            }

            string awayTeamName = basketballMetadataModel.AwayTeamName;

            awayTeamScore    = basketballMetadataModel.AwayTeamScore;
            awayTeamNumFouls = basketballMetadataModel.AwayTeamFouls;

            string homeTeamName = basketballMetadataModel.HomeTeamName;

            homeTeamScore    = basketballMetadataModel.HomeTeamScore;
            homeTeamNumFouls = basketballMetadataModel.HomeTeamFouls;

            gamePeriod = basketballMetadataModel.Period;

            Debug.Log(
                awayTeamName + " " + awayTeamScore + " (fouls: " + awayTeamNumFouls + ") " +
                "vs. " +
                homeTeamName + " " + homeTeamScore + " (fouls: " + homeTeamNumFouls + ") " +
                "period " + gamePeriod
                );

            updateScoreboardUI();
        }
Esempio n. 3
0
        // Called from DataService via IScoreboardView
        public void UpdateScoreboard(IMetadataModel model)
        {
            Debug.Log(Time.time + " GeminiScoreboard UpdateScoreboard");
            IBasketballMetadataModel basketballMetadataModel = (IBasketballMetadataModel)model;

            isMetadataSynced       = true;
            timeLastMetadataSynced = Time.time;
            updateScoreboardData(basketballMetadataModel);
        }
Esempio n. 4
0
        private void loadTeamData()
        {
            Debug.Log(Application.dataPath);
            string filePath = Path.Combine(Application.dataPath, teamDataFile);

            if (File.Exists(filePath))
            {
                string dataAsJson = File.ReadAllText(filePath);
                teamData = JsonUtility.FromJson <TeamData>(dataAsJson);
            }
            else
            {
                Debug.LogError("GeminiScoreboard cannot load game data!");
            }
        }
Esempio n. 5
0
        public override void OnEventReceived(string id, EventArgs args, ISceneComponent sender)
        {
            Debug.Log(Time.time + " GeminiScoreboard OnEventReceived " + id);

            /* obsolete
             * if (id.Equals(eventManager.videoProcMetadataEventId) && sender!=null) {
             *  IMetadataController metadataController = (IMetadataController)sender;
             *  IMetadataModel metadataModel = metadataController.GetDataModel();
             *  IBasketballMetadataModel basketballMetadataModel = (IBasketballMetadataModel)metadataModel;
             *  isMetadataSynced = true;
             *  timeLastMetadataSynced = Time.time;
             *  updateScoreboardData(basketballMetadataModel);
             *
             * } else
             */
            // if we're here, it's a playhead event that means our metadata is temporarily out of sync
            {
                isMetadataSynced = false;
            }
        }
Esempio n. 6
0
 public void ResetScoreboard()
 {
     Debug.Log(Time.time + " GeminiScoreboard ResetScoreboard");
 }