diff --git a/Assets/Scripts/Core/CaptureCamera.cs b/Assets/Scripts/Core/CaptureCamera.cs index 5dde31d5..6ce717ac 100644 --- a/Assets/Scripts/Core/CaptureCamera.cs +++ b/Assets/Scripts/Core/CaptureCamera.cs @@ -180,7 +180,7 @@ public static void Capture(DisplayObject target, RenderTexture texture, float co if (target.graphics != null) { oldLayer = target.graphics.gameObject.layer; - target.graphics.gameObject.layer = CaptureCamera.layer; + target._SetLayerDirect(CaptureCamera.layer); } if (target is Container) @@ -196,7 +196,7 @@ public static void Capture(DisplayObject target, RenderTexture texture, float co RenderTexture.active = old; if (target.graphics != null) - target.graphics.gameObject.layer = oldLayer; + target._SetLayerDirect(oldLayer); if (target is Container) ((Container)target).SetChildrenLayer(oldLayer); diff --git a/Assets/Scripts/Core/GoWrapper.cs b/Assets/Scripts/Core/GoWrapper.cs index 2427c665..c475aaec 100644 --- a/Assets/Scripts/Core/GoWrapper.cs +++ b/Assets/Scripts/Core/GoWrapper.cs @@ -280,6 +280,7 @@ public override void SetRenderingOrder(UpdateContext context, bool inBatch) } } } + context.renderingOrder++; } public override BatchElement AddToBatch(List batchElements, bool force) diff --git a/Assets/Scripts/Core/NGraphics.cs b/Assets/Scripts/Core/NGraphics.cs index 8ab26f82..3ffd8ffd 100644 --- a/Assets/Scripts/Core/NGraphics.cs +++ b/Assets/Scripts/Core/NGraphics.cs @@ -471,6 +471,12 @@ public VertexMatrix vertexMatrix { _vertexMatrix = value; _meshDirty = true; + + if (subInstances != null) + { + foreach (var sub in subInstances) + sub._vertexMatrix = value; + } } } @@ -835,7 +841,9 @@ public NGraphics CreateSubInstance(string name) newGameObject.transform.SetParent(gameObject.transform, false); newGameObject.layer = gameObject.layer; newGameObject.hideFlags = gameObject.hideFlags; - return new NGraphics(newGameObject); + var newGraphics = new NGraphics(newGameObject); + newGraphics._vertexMatrix = _vertexMatrix; + return newGraphics; } class StencilEraser