示例#1
0
        void Awake()
        {
            if (Instance != null)
            {
                return;
            }
            Instance = this;

            m_registeredPlayerUIs = new List <VPlayerUI>();
            m_currentState        = new VPlayerState();
            m_songCounter         = 0;
            m_playerSessionActive = false;

            m_musicPlayback = gameObject.AddComponent <VMusicPlayback>();
            m_adPlayback    = gameObject.AddComponent <VAdPlayback>();
        }
示例#2
0
        /// <summary>
        /// Update UI state.
        /// </summary>
        /// <param name="state"></param>
        public void UpdateState(VPlayerState state)
        {
            m_statusText.text = state.StatusText;
            ActivateButtons(state.ButtonsShown);
            SetButtonsInteractable(state.ButtonsEnabled);
            m_isCatalogueReady = state.CatalogueReady;

            m_isPlayerPaused = state.IsPaused;
            if (state.IsStopped)
            {
                m_isPlayerPaused = state.IsStopped;
            }

            ChangePlayButtonSprite();

            RefreshPlaylists();
        }