好多新内容
This commit is contained in:
@@ -197,6 +197,11 @@ public class equipSmelt : MonoBehaviour
|
||||
|
||||
public void RefreshPlayerSkillAdjustedUi()
|
||||
{
|
||||
if (!IsRuntimeSceneInstance())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RefreshAllUi();
|
||||
}
|
||||
|
||||
@@ -1027,10 +1032,16 @@ public class equipSmelt : MonoBehaviour
|
||||
|
||||
private void ClearSmeltPoolItems()
|
||||
{
|
||||
for (int i = smeltPoolContent != null ? smeltPoolContent.childCount - 1 : -1; i >= 0; i--)
|
||||
if (!IsRuntimeSceneInstance())
|
||||
{
|
||||
Transform child = smeltPoolContent.GetChild(i);
|
||||
if (child == null)
|
||||
spawnedPoolItems.Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = spawnedPoolItems.Count - 1; i >= 0; i--)
|
||||
{
|
||||
GameObject item = spawnedPoolItems[i];
|
||||
if (item == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -1038,18 +1049,28 @@ public class equipSmelt : MonoBehaviour
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
DestroyImmediate(child.gameObject);
|
||||
DestroyImmediate(item);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
Destroy(child.gameObject);
|
||||
Destroy(item);
|
||||
}
|
||||
}
|
||||
|
||||
spawnedPoolItems.Clear();
|
||||
}
|
||||
|
||||
private bool IsRuntimeSceneInstance()
|
||||
{
|
||||
if (this == null || gameObject == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return gameObject.scene.IsValid();
|
||||
}
|
||||
|
||||
private void RegisterInstance()
|
||||
{
|
||||
if (!Instances.Contains(this))
|
||||
|
||||
Reference in New Issue
Block a user