Exemplo n.º 1
0
    public static Language InGameVoiceLanguage(TankFire.NationType nationType)
    {
        Language mylanguage;

        if (nationType == TankFire.NationType.CN)
        {
            mylanguage = Language.CN;
        }
        else if (nationType == TankFire.NationType.JP)
        {
            mylanguage = Language.JP;
        }
        else if (nationType == TankFire.NationType.GER)
        {
            mylanguage = Language.GER;
        }
        else if (nationType == TankFire.NationType.RU)
        {
            mylanguage = Language.RU;
        }
        else if (nationType == TankFire.NationType.UK)
        {
            mylanguage = Language.EN;
        }
        else
        {
            mylanguage = Language.EN;
        }
        return(mylanguage);
    }
Exemplo n.º 2
0
    public IEnumerator Init(TankFire.NationType vehicleNation, System.Action <bool> onFinish)
    {
        language = InGameVoiceLanguage(vehicleNation); //TODO :
        if (InitedLanguage.Contains(language.ToString()))
        {
            onFinish(true);
            yield break;
        }

        InitedLanguage.Add(language.ToString());
        foreach (InGameVoiceProperty temp in InGameVoiceProperties)
        {
            if (temp.language == language)
            {
                int Tasks = 6;
                StartCoroutine(InitAudioSource(temp.Armor_Pierced, language.ToString(), (ReturnValue) => {
                    Tasks -= 1;
                }));
                StartCoroutine(InitAudioSource(temp.Enemy_Killed, language.ToString(), (ReturnValue) => {
                    Tasks -= 1;
                }));
                StartCoroutine(InitAudioSource(temp.Start_Battle, language.ToString(), (ReturnValue) => {
                    Tasks -= 1;
                }));
                StartCoroutine(InitAudioSource(temp.Vehicle_Destroyed, language.ToString(), (ReturnValue) => {
                    Tasks -= 1;
                }));
                StartCoroutine(InitAudioSource(temp.Armor_Ricochet, language.ToString(), (ReturnValue) => {
                    Tasks -= 1;
                }));
                StartCoroutine(InitAudioSource(temp.Armor_Not_Pierced, language.ToString(), (ReturnValue) => {
                    Tasks -= 1;
                }));

                while (Tasks != 0)
                {
                    yield return(new WaitForEndOfFrame());
                }
                Armor_Ricochet    = temp.Armor_Ricochet;
                Enemy_Killed      = temp.Enemy_Killed;
                Start_Battle      = temp.Start_Battle;
                Vehicle_Destroyed = temp.Vehicle_Destroyed;
                Armor_Pierced     = temp.Armor_Pierced;
                Armor_Not_Pierced = temp.Armor_Not_Pierced;
            }
        }
        yield return(new WaitForSeconds(1));

        onFinish(true);
    }