GetPrefab() публичный Метод

Gets the prefab game object for the current language, returns null if nothing is found
public GetPrefab ( string key ) : GameObject
key string /// Key. ///
Результат GameObject
Пример #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;
         }
     }
 }
Пример #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;
            }
        }
    }