Skip to content

Commit f2261b4

Browse files
author
Unity Technologies
committed
Unity 2017.4.31f1 C# reference source code
1 parent a75a861 commit f2261b4

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

Editor/Mono/GameView/GameView.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ internal class GameView : EditorWindow, IHasCustomMenu, IGameViewSizeMenuUser
4141
const float kMinScale = 1f;
4242
const float kMaxScale = 5f;
4343
const float kScrollZoomSnapDelay = 0.2f;
44+
// This will save the previous state which will be useful in case of platform switch
45+
int prevSizeGroupType;
4446

4547
float minScale
4648
{
@@ -277,6 +279,7 @@ void InitializeZoomArea()
277279

278280
public void OnEnable()
279281
{
282+
prevSizeGroupType = (int)currentSizeGroupType;
280283
titleContent = GetLocalizedTitleContent();
281284
UpdateZoomAreaAndParent();
282285
dontClearBackground = true;
@@ -535,6 +538,13 @@ private void DoToolbarGUI()
535538
EditorGUILayout.GameViewSizePopup(currentSizeGroupType, selectedSizeIndex, this, EditorStyles.toolbarPopup, GUILayout.Width(160f));
536539

537540
DoZoomSlider();
541+
// If the previous platform and current does not match, update the scale
542+
if ((int)currentSizeGroupType != prevSizeGroupType)
543+
{
544+
UpdateZoomAreaAndParent();
545+
// Update the platform to the recent one
546+
prevSizeGroupType = (int)currentSizeGroupType;
547+
}
538548

539549
if (FrameDebuggerUtility.IsLocalEnabled())
540550
{

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Unity 2017.4.30f1 C# reference source code
1+
## Unity 2017.4.31f1 C# reference source code
22

33
The C# part of the Unity engine and editor source code.
44
May be used for reference purposes only.

Runtime/Export/Graphics.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ internal static void SetRenderTargetImpl(RenderBuffer[] colorBuffers, RenderBuff
230230
RenderBuffer depth = depthBuffer;
231231
Internal_SetMRTSimple(colorBuffers, out depth, mipLevel, face, depthSlice);
232232
}
233+
234+
internal static void ForceRenderBufferLoadActionLoadImpl(bool val)
235+
{
236+
Internal_ForceRenderBufferLoadActionLoad(val);
237+
}
233238
}
234239

235240
public partial class Graphics
@@ -317,6 +322,12 @@ public static bool ConvertTexture(Texture src, int srcElement, Texture dst, int
317322
{
318323
return ConvertTexture_Slice(src, srcElement, dst, dstElement);
319324
}
325+
326+
//undocumented
327+
public static void ForceRenderBufferLoadActionLoad(bool val)
328+
{
329+
ForceRenderBufferLoadActionLoadImpl(val);
330+
}
320331
}
321332
}
322333

artifacts/generated/common/runtime/GraphicsBindings.gen.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,10 @@ public static void BlitMultiTap(Texture source, RenderTexture dest, Material mat
10701070
[System.Runtime.CompilerServices.MethodImplAttribute((System.Runtime.CompilerServices.MethodImplOptions)0x1000)]
10711071
extern private static void Internal_SetNullRT () ;
10721072

1073+
[UnityEngine.Scripting.GeneratedByOldBindingsGeneratorAttribute] // Temporarily necessary for bindings migration
1074+
[System.Runtime.CompilerServices.MethodImplAttribute((System.Runtime.CompilerServices.MethodImplOptions)0x1000)]
1075+
extern private static void Internal_ForceRenderBufferLoadActionLoad (bool val) ;
1076+
10731077
[UnityEngine.Scripting.GeneratedByOldBindingsGeneratorAttribute] // Temporarily necessary for bindings migration
10741078
[System.Runtime.CompilerServices.MethodImplAttribute((System.Runtime.CompilerServices.MethodImplOptions)0x1000)]
10751079
extern private static void Internal_SetRTSimple (out RenderBuffer color, out RenderBuffer depth, int mip, CubemapFace face, int depthSlice) ;

0 commit comments

Comments
 (0)