public void RenderHandles(Rect rect, Camera cameraToCopy) { if (!HasActiveHandle(handles)) { return; } Profiler.BeginSample("Draw Handles"); var camera = HandlePreviewScene.camera; HandlePreviewScene.CopyCamera(cameraToCopy); camera.transform.localPosition = cameraToCopy.transform.position; camera.transform.localRotation = cameraToCopy.transform.rotation; camera.targetTexture = RenderTexture.GetTemporary( cameraToCopy.scaledPixelWidth, cameraToCopy.scaledPixelHeight, cameraToCopy.targetTexture.depth, cameraToCopy.targetTexture.graphicsFormat); DisableUnusedHandles(handles); SendPreRender(camera); camera.Render(); SendPostRender(camera); Graphics.DrawTexture(rect, camera.targetTexture, m_RenderMaterial); RenderTexture.ReleaseTemporary(camera.targetTexture); camera.targetTexture = null; Profiler.EndSample(); }
public sealed override GameObject CreateHandle(GameObject prefab) { var instance = base.CreateHandle(prefab); SetHideFlagsRecursive(instance.transform); HandlePreviewScene.AddHandle(instance); return(instance); }