Exemplo n.º 1
0
        /// <summary>
        /// Updates Text GUI text based on input and plays AudioClip.
        /// Used for countdown for the await
        /// </summary>
        /// <param name="text"></param>
        /// <param name="audio"></param>
        /// <returns></returns>
        async Task UpdateTextUI(MatchStateDisplayData data)
        {
            // Update Text and play Audio
            data.Apply(AudioPlayer, TextUI);

            float delay = MinimumDelay;

            if (data.Clip != null)
            {
                delay = Mathf.Min(delay, data.Clip.length);
            }

            // Wait and maybe disable UI afterwards
            await Task.Delay((int)(delay * 1000));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Updates Text GUI text based on input and plays AudioClip.
        /// Used for go to remove the warning.
        /// </summary>
        /// <param name="text"></param>
        /// <param name="audio"></param>
        async void UpdateTextUIGO(MatchStateDisplayData data)
        {
            await UpdateTextUI(data);

            ObjectUtil.SetActive(TextUI.gameObject, false);
        }