private void Update() { if (Input.GetKeyDown(KeyCode.A)) { for (int i = 0; i < 50; i++) { SpawnCube(); } } if (Input.GetKeyDown(KeyCode.Q)) { AddressableResMgr.S.ReleaseAllAsset(); } if (Input.GetKeyDown(KeyCode.W)) { AddressableResMgr.S.ReleaseRes(handle_Icon); } if (Input.GetKeyDown(KeyCode.E)) { if (sc) { Addressables.Release(handle_scene); } else { handle_scene = AddressableResMgr.S.LoadSceneAsync("AddressDemo", null); sc = true; } } }
private void HexTileMapEditor_Completed(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <GameObject> obj) { var txt = obj.Result.GetComponent <TextMeshProUGUI>(); var txtPosition = tilemapBackground.WorldToCell(txt.transform.position); txtDict.Add(new Vector2Int(txtPosition.x, txtPosition.y), txt); txt.SetText($"{txtPosition.x},{txtPosition.y}"); }
/// <summary> /// Tiel全部资源加载完成 /// </summary> /// <param name="obj"></param> private void TileAssetAllLoadCompleted(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <IList <TileBase> > obj) { this.IsAssetLoadCompleted = true; //Debug.Log($"tileAsset load completed"); this.OnAseetLoadStatusChang( new AseetLoadStatusArgs(typeof(TileBase), "TileAsset", AseetLoadStatusArgs.LoadStatus.Completed)); //TileThroughCostDictInit(TileAssetDict); }
public void ReplaceAsyncOperationHandle(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle newValue) { var index = GameComponentsLookup.AsyncOperationHandle; var component = (SemoGames.Common.AsyncOperationHandleComponent)CreateComponent(index, typeof(SemoGames.Common.AsyncOperationHandleComponent)); component.Value = newValue; ReplaceComponent(index, component); }
private new void OnComplete(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <GameObject> obj) { base.OnComplete(obj); if (totalPrefabsLoaded == currentPrefabOnLoad) { StartCoroutine(Generator()); } }
private void Avatar_Completed(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <IList <Object> > obj) { // Ready to go, enable the character and build it. //Debug.Log("Avatar preload completed."); Avatar.gameObject.SetActive(true); // Avatar.BuildCharacter(); Avatar.BuildCharacterEnabled = true; // Avatar.ChangeRace(Avatar.RacePreset); }
private static void Asset_Completed(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <TextAsset> obj, bool loadSamples) { if (!obj.IsValid()) { Debug.LogError("[FMOD] Unable to load AssetReference: " + obj.OperationException); return; } TextAsset bank = obj.Result; LoadBank(bank, loadSamples); }
/// <summary> /// Called when the addressables assets of the Navigations datas are loaded /// </summary> /// <param name="_loadedAssets"></param> private void OnNavigationsDatasLoaded(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <IList <TextAsset> > _loadedAssets) { for (int i = 0; i < _loadedAssets.Result.Count; i++) { if (_loadedAssets.Result[i].name == dataName) { NavigationDatas = JsonUtility.FromJson <NavData>(_loadedAssets.Result[i].text); GenerateTriangles(); return; } } }
void OnLoadDone(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <GameObject> obj) { for (int i = 0; i < poolSize; i++) { foreach (Transform item in shootPoint) { var gObj = Instantiate(obj.Result, item.position, Quaternion.identity, item); gObj.GetComponent <IPooleable>().parent = item; pool.Add(gObj); gObj.SetActive(false); } } }
private void OnLocaleInitialized(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <LocalizationSettings> oper) { _locale.AddOptions(LocalizationSettings.AvailableLocales.Locales.Select(x => { var result = x.Identifier.CultureInfo.NativeName; var firstLetter = Char.ToUpper(result[0]); result = result.Remove(0, 1); result = firstLetter + result; return(result); }).ToList()); string currentLocaleCode = GlobalPreferences.Get <string>("current_locale", null); if (currentLocaleCode != null) { LocalizationSettings.SelectedLocale = LocalizationSettings.AvailableLocales.Locales.Find(x => x.Identifier.Code == currentLocaleCode); } LocalizationChanged(LocalizationSettings.SelectedLocale); }
private void Update() { if (Input.GetKeyDown(KeyCode.A)) { for (int i = 0; i < 50; i++) { SpawnCube(); } } if (Input.GetKeyDown(KeyCode.Q)) { GameObject obj = m_objs[m_objs.Count - 1]; AddressableResMgr.S.ReleaseInstance(obj); m_objs.RemoveAt(m_objs.Count - 1); //AddressableResMgr.S.ReleaseAllAsset(); } if (Input.GetKeyDown(KeyCode.W)) { handle.ReleaseAll(); //AddressableResMgr.S.ReleaseRes(handle_Icon); } if (Input.GetKeyDown(KeyCode.E)) { if (sc) { Addressables.Release(handle_scene); } else { handle_scene = AddressableResMgr.S.LoadSceneAsync("AddressDemo", null); sc = true; } } }
private void Recipes_Loaded(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <IList <Object> > obj) { Debug.Log("Recipes loaded: " + obj.Status.ToString()); Avatar.gameObject.SetActive(true); }
private void Asyncop_Completed(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <IList <Object> > obj) { //Debug.Log("Race Preload Completed."); // Preload any default wardrobe items on our avatar, now that the races are preloaded. UMAAssetIndexer.Instance.Preload(Avatar, false).Completed += Avatar_Completed; }
private static void Asset_Completed(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <TextAsset> obj) { Asset_Completed(obj, false); }
private void Op_Completed(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <IList <Object> > obj) { SetColors(); SetRecipe(); }
static int _m_LuaLoadPrefab_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); { string _path = LuaAPI.lua_tostring(L, 1); UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle <UnityEngine.GameObject> gen_ret = Game.ResourceManager.LuaLoadPrefab(_path); translator.Push(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }