Пример #1
0
    IEnumerator ValidationButtonPressed()
    {
        if (m_CurrentImageSelected.isUnlockable && !m_CurrentImageSelected.isUnlock)
        {
            if (Shop.TryToBuySkills(m_CurrentImageSelected, PlayerNumber))
            {
                m_CurrentImageSelected.isUnlock = true;
                RefreshTree();

                StartCoroutine(ZoomIn(m_CurrentImageSelected));

                if (RefreshDescription != null)
                {
                    RefreshDescription(m_CurrentImageSelected);
                }
            }
            else
            {
                ServiceLocator.Instance.GetService <SoundManager>(ManagerType.SOUND_MANAGER).PlaySong("event:/SFX/UI/UI_Click", 3);
            }
        }
        else
        {
            ServiceLocator.Instance.GetService <SoundManager>(ManagerType.SOUND_MANAGER).PlaySong("event:/SFX/UI/UI_Click", 3);
        }

        yield return(new WaitForSeconds(0.2f));

        StopCoroutine(m_ValidationCoroutine);
    }