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); }); }
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); }); } }