public void Init(LocalizedDatabase <TTable, TEntry> database, AsyncOperationHandle <TTable> loadTableOperation, TableReference tableReference, TableEntryReference tableEntryReference, Locale selectedLoale, bool UseFallBack) { m_Database = database; m_LoadTableOperation = loadTableOperation; AddressablesInterface.Acquire(m_LoadTableOperation); m_TableReference = tableReference; m_TableEntryReference = tableEntryReference; m_SelectedLocale = selectedLoale; m_UseFallback = UseFallBack; }
public void Init(AsyncOperationHandle <LocalizedDatabase <StringTable, StringTableEntry> .TableEntryResult> tableEntryOperation, Locale locale, LocalizedStringDatabase database, TableReference tableReference, TableEntryReference tableEntryReference, object[] arguments) { m_TableEntryOperation = tableEntryOperation; m_SelectedLocale = locale; AddressablesInterface.Acquire(m_TableEntryOperation); m_Database = database; m_TableReference = tableReference; m_TableEntryReference = tableEntryReference; m_Arguments = arguments; }
static IEnumerator ReleaseHandlesNextFrame(List <AsyncOperationHandle> handles) { // Defer to the next frame yield return(null); foreach (var h in handles) { AddressablesInterface.Release(h); } ListPool <AsyncOperationHandle> .Release(handles); }
protected override void Execute() { if (m_TableEntryOperation.Status != AsyncOperationStatus.Succeeded) { Complete(null, false, "Load Table Entry Operation Failed"); AddressablesInterface.Release(m_TableEntryOperation); return; } if (m_TableEntryOperation.Result.Table == null || m_TableEntryOperation.Result.Entry == null) { // Missing entries are treated as null objects CompleteAndRelease(default, true, null);
void FindTableByName(string collectionName) { m_CollectionName = collectionName; // Check the table exists var tableResourceOp = AddressablesInterface.LoadTableLocationsAsync(m_CollectionName, m_SelectedLocale.Identifier, typeof(TTable)); if (tableResourceOp.IsDone) { LoadTableResource(tableResourceOp); } else { CurrentOperation = tableResourceOp; tableResourceOp.Completed += LoadTableResource; } }
void FindTableByName(string collectionName) { m_CollectionName = collectionName; var tableAddress = AddressHelper.GetTableAddress(m_CollectionName, m_SelectedLocale.Identifier); // Check the table exists var tableResourceOp = AddressablesInterface.LoadResourceLocationsAsync(tableAddress, typeof(TTable)); if (!tableResourceOp.IsDone) { tableResourceOp.Completed += LoadTableResource; } else { LoadTableResource(tableResourceOp); } }
void LoadTableResource(AsyncOperationHandle <IList <IResourceLocation> > operationHandle) { if (operationHandle.Status != AsyncOperationStatus.Succeeded || operationHandle.Result.Count == 0) { Complete(null, true, $"Could not find a {m_SelectedLocale} table with the name '{m_CollectionName}`"); return; } var loadTableOperation = AddressablesInterface.LoadTableFromLocation <TTable>(operationHandle.Result[0]); if (loadTableOperation.IsDone) { TableLoaded(loadTableOperation); } else { CurrentOperation = loadTableOperation; loadTableOperation.Completed += TableLoaded; } }
protected override void Destroy() { AddressablesInterface.Release(m_LoadTableOperation); GenericPool <LoadAssetOperation <TObject> > .Release(this); }
public void CompleteAndRelease(string result, bool success, string errorMsg) { Complete(result, success, errorMsg); AddressablesInterface.Release(m_TableEntryOperation); }
public void Init(AsyncOperationHandle <LocalizedAssetDatabase.TableEntryResult> loadTableEntryOperation) { m_TableEntryOperation = loadTableEntryOperation; AddressablesInterface.Acquire(m_TableEntryOperation); CurrentOperation = null; }