|
@@ -195,18 +195,21 @@ namespace GFGGame
|
|
|
AddAnimationObj(res, aniObjName, parentObj, sortingOrder);
|
|
|
Timers.inst.Add(0.03f, 1, (obj) =>
|
|
|
{
|
|
|
- Transform tf = parentObj.transform.Find(spritObjName);
|
|
|
- if (tf != null && tf.gameObject != null && tf.gameObject.activeInHierarchy)
|
|
|
+ if(parentObj != null && parentObj.transform != null)
|
|
|
{
|
|
|
- var assetDisposer = tf.gameObject.GetComponent<AssetReleaser>();
|
|
|
- if (assetDisposer != null)
|
|
|
+ Transform tf = parentObj.transform.Find(spritObjName);
|
|
|
+ if (tf != null && tf.gameObject != null && tf.gameObject.activeInHierarchy)
|
|
|
{
|
|
|
- if (!string.IsNullOrEmpty(assetDisposer.resPath))
|
|
|
+ var assetDisposer = tf.gameObject.GetComponent<AssetReleaser>();
|
|
|
+ if (assetDisposer != null)
|
|
|
{
|
|
|
- string resPath = ResPathUtil.GetDressUpPath(res, ext);
|
|
|
- if (assetDisposer.resPath == resPath)
|
|
|
+ if (!string.IsNullOrEmpty(assetDisposer.resPath))
|
|
|
{
|
|
|
- TryClearSpriteObj(parentObj, spritObjName);
|
|
|
+ string resPath = ResPathUtil.GetDressUpPath(res, ext);
|
|
|
+ if (assetDisposer.resPath == resPath)
|
|
|
+ {
|
|
|
+ TryClearSpriteObj(parentObj, spritObjName);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|