Esempio n. 1
0
    static void LoadConfig(string fileName, Action <string> callback)
    {
        Count += 1;
        var addressableName = StringUtil.Contact("Txt/", fileName);

        AssetLoad.LoadAsync <TextAsset>(addressableName, asset => {
            var textAsset = asset.asset as TextAsset;
            callback?.Invoke(textAsset.text);
        });
    }
Esempio n. 2
0
 private void TryOpen(string windowName)
 {
     if (windows.ContainsKey(windowName))
     {
         var window = windows[windowName];
         if (window.state == WindowState.Closed)
         {
             window.Open();
         }
     }
     else
     {
         openingList.Add(windowName);
         var addressableName = StringUtil.Contact("Windows/", windowName);
         AssetLoad.LoadAsync <GameObject>(addressableName, asset => { OnLoadedWindow(windowName, asset.asset as GameObject); });
     }
 }