using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class QueryingCatalog : MonoBehaviour {
public ulong startingGuid = 0;
private HashSet<ulong> seen = new HashSet<ulong>();
private HashSet<string> discoveredAssetGuids = new HashSet<string>();
void Start () {
Fetch(startingGuid);
}
public Net.GetAssetCategoryJob Fetch(ulong catId)
{
if(seen.Contains(catId))
{
return null;
}
seen.Add(catId);
bool withThumbnails = true;
var job = Catalog.GetAssetCategory((long)catId, withThumbnails);
Texture2D icon = null;
job.OnJobDoneMain += (_) =>
{
var result = job.GetResult();
foreach(var kvp in result)
{
var assetCategory = kvp.Value;
if(withThumbnails){
icon = assetCategory.icon;
}
Astra.
Logger.
Log(
"Category Id: " + kvp.Key +
" name: " + assetCategory.title +
" visible: " + assetCategory.visible);
for(int i=0;i<assetCategory.assetGUIDs.Count;i++)
{
var guid = assetCategory.assetGUIDs[i];
discoveredAssetGuids.Add(guid);
}
for(int i=0;i<assetCategory.childrenIDs.Count;i++)
{
var guid = assetCategory.childrenIDs[i];
Fetch(guid);
}
}
};
return job;
}
}
}
Handles Astra logging messages in C# allowing filtering and redirection
Definition: Logger.cs:15
static void Log(object message)
A one-to-one with UnityEngine.Debug.Log, records as Info level
Definition: Logger.cs:99
Definition: AnimatingAnAvatar.cs:9
Definition: AnimationManager.cs:10