Fix verbose log about invalid resource.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
using Cryville.Common.Unity;
|
||||
using Cryville.Common.Unity.UI;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using static UnityEditor.Progress;
|
||||
|
||||
namespace Cryville.Crtr.Browsing {
|
||||
public class ResourceBrowser : ResourceBrowserUnit {
|
||||
@@ -29,8 +31,13 @@ namespace Cryville.Crtr.Browsing {
|
||||
|
||||
private bool LoadItem(int id, GameObject obj) {
|
||||
var bi = obj.GetComponent<BrowserItem>();
|
||||
var item = ResourceManager.GetItemMeta(id);
|
||||
bi.Load(id, item);
|
||||
try {
|
||||
var item = ResourceManager.GetItemMeta(id);
|
||||
bi.Load(id, item);
|
||||
}
|
||||
catch (Exception) {
|
||||
bi.Load(id, new ResourceItemMeta { Name = "<color=#ff0000>Invalid resource</color>" });
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user