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