Removing huge package for characters, removing unused Mixamo folder, and submitting changes to 9Player level and new wave definition
This commit is contained in:
parent
1bc518824c
commit
fec4433691
3522 changed files with 6693 additions and 618660 deletions
|
|
@ -1262,17 +1262,31 @@ namespace TD.Levels.Editor
|
|||
authGO.SetActive(false);
|
||||
|
||||
GameObject camGO = null;
|
||||
Camera cam = null;
|
||||
RenderTexture rt = null;
|
||||
RenderTexture prevActive = RenderTexture.active;
|
||||
Texture2D snapshot = null;
|
||||
try
|
||||
{
|
||||
rt = new RenderTexture(rtWidth, rtHeight, 24, RenderTextureFormat.ARGB32);
|
||||
rt.antiAliasing = 4;
|
||||
// Allocate via a descriptor and force GPU creation up front with Create().
|
||||
// A manually-newed MSAA RenderTexture that is only lazily created (during
|
||||
// the camera's first Render) registers inconsistently with Unity's internal
|
||||
// RenderTexture age-check pool. On teardown that leaves a dangling tracker
|
||||
// entry, producing the editor-update spam:
|
||||
// "Checking lifetime of RenderTextures but m_AgeCheckAdded = false".
|
||||
// Explicit Create() makes registration deterministic so Release() cleanly
|
||||
// unregisters it.
|
||||
var desc = new RenderTextureDescriptor(rtWidth, rtHeight, RenderTextureFormat.ARGB32, 24)
|
||||
{
|
||||
msaaSamples = 4,
|
||||
autoGenerateMips = false,
|
||||
};
|
||||
rt = new RenderTexture(desc);
|
||||
rt.Create();
|
||||
|
||||
camGO = new GameObject("__BakeThumbnailCamera");
|
||||
camGO.hideFlags = HideFlags.HideAndDontSave;
|
||||
var cam = camGO.AddComponent<Camera>();
|
||||
cam = camGO.AddComponent<Camera>();
|
||||
cam.clearFlags = CameraClearFlags.SolidColor;
|
||||
cam.backgroundColor = new Color(0.15f, 0.15f, 0.18f, 1f);
|
||||
cam.orthographic = true;
|
||||
|
|
@ -1303,6 +1317,11 @@ namespace TD.Levels.Editor
|
|||
finally
|
||||
{
|
||||
authGO.SetActive(wasActive);
|
||||
|
||||
// Teardown order matters: clear every reference to the RT before destroying
|
||||
// it, otherwise the camera (or the global active slot) is left pointing at
|
||||
// freed memory, which is the other way the age-check tracker gets corrupted.
|
||||
if (cam != null) cam.targetTexture = null;
|
||||
RenderTexture.active = prevActive;
|
||||
if (camGO != null) UnityEngine.Object.DestroyImmediate(camGO);
|
||||
if (rt != null) { rt.Release(); UnityEngine.Object.DestroyImmediate(rt); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue