GetPrefab() public method

Gets the prefab game object for the current language, returns null if nothing is found
public GetPrefab ( string key ) : GameObject
key string /// Key. ///
return GameObject
Exemplo n.º 1
0
 void OnChangeLanguage(LanguageManager thisLanguageManager)
 {
     GameObject atlasPrefab = thisLanguageManager.GetPrefab(localizedKey);
     if(atlasPrefab != null)
     {
         UIAtlas atlasObject = atlasPrefab.GetComponent<UIAtlas>();
         if(atlasObject == null)
         {
             if(thisLanguageManager.VerboseLogging)
                 Debug.LogError("No UIAtlas was found with key:" + localizedKey);
         }
         else
         {
             uiSprite.atlas = atlasObject;
         }
     }
 }
Exemplo n.º 2
0
    void OnChangeLanguage(LanguageManager thisLanguageManager)
    {
        GameObject atlasPrefab = thisLanguageManager.GetPrefab(localizedKey);

        if (atlasPrefab != null)
        {
            UIAtlas atlasObject = atlasPrefab.GetComponent <UIAtlas>();
            if (atlasObject == null)
            {
                if (thisLanguageManager.VerboseLogging)
                {
                    Debug.LogError("No UIAtlas was found with key:" + localizedKey);
                }
            }
            else
            {
                uiSprite.atlas = atlasObject;
            }
        }
    }