Ejemplo n.º 1
0
    public MetaLanguageToDisplay GetByLanguage(LanguageType language)
    {
        MetaLanguageToDisplay meta         = m_defaultDisplayer;
        MetaLanguageToDisplay metaLanguage = new MetaLanguageToDisplay();

        if (m_byLanguageDisplayInfo.Count <= 0)
        {
            return(meta);
        }

        if (language == LanguageType.Unkown)
        {
            metaLanguage = m_byLanguageDisplayInfo[UnityEngine.Random.Range(0, m_byLanguageDisplayInfo.Count)];
        }
        else
        {
            List <MetaLanguageToDisplay> possibility = m_byLanguageDisplayInfo.Where(k => k.foreignLanguage.m_language == language).ToList();
            if (possibility.Count > 0)
            {
                metaLanguage = possibility[0];
            }
        }
        meta = Override(meta, metaLanguage);
        return(meta);
    }
Ejemplo n.º 2
0
    internal static MetaLanguageToDisplay Override(MetaLanguageToDisplay toOverride, MetaLanguageToDisplay with)
    {
        MetaLanguageToDisplay newMeta = new MetaLanguageToDisplay();

        newMeta.english          = toOverride.foreignLanguage.Override(toOverride.english, with.english);
        newMeta.originalLanguage = toOverride.foreignLanguage.Override(toOverride.originalLanguage, with.originalLanguage);
        newMeta.foreignLanguage  = toOverride.foreignLanguage.Override(toOverride.foreignLanguage, with.foreignLanguage);
        return(newMeta);
    }
Ejemplo n.º 3
0
    public void SetWith(MetaLanguage meta, LanguageType language)
    {
        if (meta == null)
        {
            return;
        }
        m_identifier.text = meta.m_identifier;
        MetaLanguageToDisplay display = m_currently = meta.GetByLanguage(language);

        m_english.SetWithSentence(display.english);
        m_original.SetWithSentence(display.originalLanguage);
        m_foreign.SetWithSentence(display.foreignLanguage);

        DisplayImage(HasImagePriority(display));

        CallImage(display.GetAnyImageName());
        CallSound(display.GetForeignAudio());
    }
Ejemplo n.º 4
0
 private static MetaLanguageToDisplay Override(MetaLanguageToDisplay toOverride, MetaLanguageToDisplay with)
 {
     return(MetaLanguageToDisplay.Override(toOverride, with));
 }
Ejemplo n.º 5
0
 public void SetWith(MetaLanguageToDisplay display)
 {
 }
Ejemplo n.º 6
0
 private bool HasImagePriority(MetaLanguageToDisplay toDisplay)
 {
     return(HasImagePriority(toDisplay.english, toDisplay.originalLanguage, toDisplay.foreignLanguage));
 }