mirror of
https://github.com/originalnicodr/CinematicUnityExplorer.git
synced 2026-10-11 18:08:05 +08:00
Added checks to avoid interacting with some panel cells related to already deleted objects.
This commit is contained in:
1 parent
4b971d8191
commit
7046d8b5cd
2 files changed
+14
-1
No files matched your search
@@ -146,6 +146,7 @@ namespace UnityExplorer.UI.Panels
|
||||
string check = animatorPlayer.animator.name;
|
||||
}
|
||||
catch {
|
||||
FindAllAnimators();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,18 @@ namespace UnityExplorer.UI.Panels
|
||||
}
|
||||
|
||||
GameObject light = CreatedLights[index];
|
||||
|
||||
// Check if the light was deleted because we switched scenes, and delete it from the list if that's the case
|
||||
try {
|
||||
string check = light.name;
|
||||
}
|
||||
catch {
|
||||
ExplorerCore.LogWarning("Light was deleted by the game!");
|
||||
CreatedLights.RemoveAt(index);
|
||||
lightsScrollPool.Refresh(true, false);
|
||||
return;
|
||||
}
|
||||
|
||||
cell.light = light;
|
||||
cell.label.text = light.name;
|
||||
}
|
||||
@@ -132,7 +144,7 @@ namespace UnityExplorer.UI.Panels
|
||||
|
||||
private void CreateLight(LightType requestedType){
|
||||
GameObject obj = new($"CUE - Light {lightCounter}");
|
||||
//DontDestroyOnLoad(obj);
|
||||
GameObject.DontDestroyOnLoad(obj);
|
||||
obj.hideFlags = HideFlags.HideAndDontSave;
|
||||
Light lightComponent = obj.AddComponent<UnityEngine.Light>();
|
||||
lightComponent.type = requestedType;
|
||||
|
||||
Reference in new issue
Block a user