Skip to content

Commit d4fa90a

Browse files
author
Unity Technologies
committed
Unity 2019.3.0b9 C# reference source code
1 parent 5efc9d9 commit d4fa90a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+420
-268
lines changed

Editor/Mono/BuildTargetDiscovery.bindings.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ public enum VRAttributes
6666
SupportStereoInstancingRendering = (1 << 1),
6767
SupportStereoMultiviewRendering = (1 << 2),
6868
SupportStereo360Capture = (1 << 3),
69-
SupportVuforia = (1 << 4),
70-
SupportTango = (1 << 5)
69+
SupportTango = (1 << 4)
7170
}
7271

7372
[StructLayout(LayoutKind.Sequential)]

Editor/Mono/EditorUserBuildSettings.bindings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,8 @@ public static extern AndroidETC2Fallback androidETC2Fallback
413413
[Obsolete("androidUseLegacySdkTools has been deprecated. It does not have any effect.")]
414414
public static extern bool androidUseLegacySdkTools { get; set; }
415415

416+
public static extern bool androidCreateSymbolsZip { get; set; }
417+
416418
// *undocumented*
417419
// NOTE: This setting should probably not be a part of the public API as is. Atm it is used by playmode tests
418420
// and applied during build post-processing. We will however move towards separating building and launching

Editor/Mono/EditorWindow.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ internal void ClearPersistentViewData()
136136
Vector2 m_GameViewTargetSize;
137137

138138
bool m_IsPlayModeView;
139-
bool m_DontClearBackground;
140139
EventInterests m_EventInterests = new EventInterests();
141140
bool m_DisableInputEvents;
142141

@@ -311,21 +310,6 @@ internal void DrawNotification()
311310
EditorGUI.DoDropShadowLabel(r, m_Notification, scaledNotificationText, .3f);
312311
}
313312

314-
internal bool dontClearBackground
315-
{
316-
get
317-
{
318-
return m_DontClearBackground;
319-
}
320-
set
321-
{
322-
m_DontClearBackground = value;
323-
if (m_Parent && m_Parent.actualView == this)
324-
m_Parent.backgroundValid = false;
325-
}
326-
}
327-
328-
329313
// Does the window automatically repaint whenever the scene has changed?
330314
public bool autoRepaintOnSceneChange
331315
{

Editor/Mono/GUI/DockArea.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ protected bool floatingWindow
310310

311311
protected override void OldOnGUI()
312312
{
313-
ClearBackground();
314313
EditorGUIUtility.ResetGUIState();
315314

316315
// Exit if the window was destroyed after entering play mode or on domain-reload.
@@ -1062,7 +1061,6 @@ static class Styles
10621061

10631062
protected override void OldOnGUI()
10641063
{
1065-
ClearBackground();
10661064
// Call reset GUI state as first thing so GUI.color is correct when drawing window decoration.
10671065
EditorGUIUtility.ResetGUIState();
10681066

Editor/Mono/GUIView.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ protected Panel panel
7878
int m_AntiAliasing = 1;
7979
EventInterests m_EventInterests;
8080
bool m_AutoRepaintOnSceneChange = false;
81-
private bool m_BackgroundValid = false;
8281

8382
internal bool SendEvent(Event e)
8483
{
@@ -107,14 +106,11 @@ internal override void SetWindow(ContainerWindow win)
107106
Internal_SetWantsMouseEnterLeaveWindow(m_EventInterests.wantsMouseMove);
108107

109108
panel.visualTree.SetSize(windowPosition.size);
110-
111-
m_BackgroundValid = false;
112109
}
113110

114111
internal void RecreateContext()
115112
{
116113
Internal_Recreate(m_DepthBufferBits, m_AntiAliasing);
117-
m_BackgroundValid = false;
118114
}
119115

120116
public EventInterests eventInterests
@@ -154,12 +150,6 @@ public bool wantsMouseEnterLeaveWindow
154150
}
155151
}
156152

157-
internal bool backgroundValid
158-
{
159-
get { return m_BackgroundValid; }
160-
set { m_BackgroundValid = value; }
161-
}
162-
163153
public bool autoRepaintOnSceneChange
164154
{
165155
get { return m_AutoRepaintOnSceneChange; }
@@ -270,8 +260,6 @@ protected override void SetPosition(Rect newPos)
270260

271261
Internal_SetPosition(windowPosition);
272262

273-
m_BackgroundValid = false;
274-
275263
panel.visualTree.SetSize(windowPosition.size);
276264

277265
positionChanged?.Invoke(this);

Editor/Mono/GameView/GameView.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ public void OnEnable()
272272
prevSizeGroupType = (int)currentSizeGroupType;
273273
titleContent = GetLocalizedTitleContent();
274274
UpdateZoomAreaAndParent();
275-
dontClearBackground = true;
276275
showToolbar = ModeService.HasCapability(ModeCapability.GameViewToolbar, true);
277276

278277
ModeService.modeChanged += OnEditorModeChanged;
@@ -410,7 +409,6 @@ public void SizeSelectionCallback(int indexClicked, object objectSelected)
410409
if (indexClicked != selectedSizeIndex)
411410
{
412411
selectedSizeIndex = indexClicked;
413-
dontClearBackground = true; // will cause re-clear
414412
UpdateZoomAreaAndParent();
415413
targetSize = targetRenderSize;
416414
SceneView.RepaintAll();

Editor/Mono/HostView.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ protected override void OnDisable()
122122

123123
protected override void OldOnGUI()
124124
{
125-
ClearBackground();
126-
127125
// Call reset GUI state as first thing so GUI.color is correct when drawing window decoration.
128126
EditorGUIUtility.ResetGUIState();
129127
DoWindowDecorationStart();
@@ -653,17 +651,6 @@ static void PropagateDirtyRepaint(VisualElement ve)
653651
}
654652
}
655653

656-
protected void ClearBackground()
657-
{
658-
if (Event.current.type != EventType.Repaint)
659-
return;
660-
EditorWindow view = actualView;
661-
GL.Clear(true, true, EditorApplication.isPlayingOrWillChangePlaymode && !view.dontClearBackground ?
662-
EditorGUIUtility.kViewBackgroundColor * kPlayModeDarken.Color :
663-
EditorGUIUtility.kViewBackgroundColor);
664-
backgroundValid = true;
665-
}
666-
667654
protected void AddUIElementsDebuggerToMenu(GenericMenu menu)
668655
{
669656
var itemContent = UIElementsDebugger.WindowName;

Editor/Mono/Inspector/EditorSettingsInspector.cs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public void OnEnable()
265265
public void OnDisable()
266266
{
267267
DevDeviceList.Changed -= OnDeviceListChanged;
268-
if (EditorSettings.assetPipelineMode == AssetPipelineMode.Version2)
268+
if (AssetDatabase.IsV2Enabled())
269269
{
270270
AssetDatabaseExperimental.RefreshCacheServerNamespacePrefix();
271271
AssetDatabaseExperimental.RefreshConnectionToCacheServer();
@@ -761,16 +761,14 @@ private void DoCacheServerSettings()
761761
{
762762
if (AssetDatabase.IsV2Enabled())
763763
{
764-
if (EditorSettings.cacheServerEndpoint.Length > 0)
765-
{
766-
var address = EditorSettings.cacheServerEndpoint.Split(':');
767-
var ip = address[0];
768-
var port = Convert.ToUInt16(address[1]);
769-
if (AssetDatabaseExperimental.CanConnectToCacheServer(ip, port))
770-
m_CacheServerConnectionState = CacheServerConnectionState.Success;
771-
else
772-
m_CacheServerConnectionState = CacheServerConnectionState.Failure;
773-
}
764+
var address = EditorSettings.cacheServerEndpoint.Split(':');
765+
var ip = address[0];
766+
UInt16 port = 0; // If 0, will use the default set port
767+
if (address.Length == 2)
768+
port = Convert.ToUInt16(address[1]);
769+
770+
if (AssetDatabaseExperimental.CanConnectToCacheServer(ip, port))
771+
m_CacheServerConnectionState = CacheServerConnectionState.Success;
774772
else
775773
m_CacheServerConnectionState = CacheServerConnectionState.Failure;
776774
}

Editor/Mono/PlayerSettings.bindings.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -990,23 +990,6 @@ public static GraphicsJobMode graphicsJobMode
990990
[StaticAccessor("PlayerSettingsBindings", StaticAccessorType.DoubleColon)]
991991
internal static extern void SetGraphicsJobModeForPlatform(BuildTarget platform, GraphicsJobMode gfxJobMode);
992992

993-
[Obsolete("GetPlatformVuforiaEnabled(BuildTargetGroup targetGroup) has been deprecated. Use vuforiaEnabled instead.")]
994-
[StaticAccessor("PlayerSettingsBindings", StaticAccessorType.DoubleColon)]
995-
public static extern bool GetPlatformVuforiaEnabled(BuildTargetGroup targetGroup);
996-
997-
[Obsolete("SetPlatformVuforiaEnabled(BuildTargetGroup targetGroup, bool enabled) has been deprecated. Use vuforiaEnabled instead.")]
998-
[StaticAccessor("PlayerSettingsBindings", StaticAccessorType.DoubleColon)]
999-
public static extern void SetPlatformVuforiaEnabled(BuildTargetGroup targetGroup, bool enabled);
1000-
1001-
public static extern bool vuforiaEnabled
1002-
{
1003-
[StaticAccessor("GetPlayerSettings().GetEditorOnly()")]
1004-
get;
1005-
1006-
[StaticAccessor("GetPlayerSettings().GetEditorOnlyForUpdate()")]
1007-
set;
1008-
}
1009-
1010993
[StaticAccessor("GetPlayerSettings()")]
1011994
public static extern bool GetWsaHolographicRemotingEnabled();
1012995

Editor/Mono/Prefabs/PrefabOverrides/PrefabOverridesTreeView.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,8 @@ void Apply(object prefabAssetPathObject)
664664
if (!PrefabUtility.PromptAndCheckoutPrefabIfNeeded(prefabAssetPath, PrefabUtility.SaveVerb.Apply))
665665
return;
666666
m_Modification.Apply(prefabAssetPath);
667+
EditorUtility.ForceRebuildInspectors(); // handles applying RemovedComponents
668+
667669
UpdateAndClose();
668670
}
669671

Editor/Mono/PreferencesWindow/CacheServerPreferences.cs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -428,18 +428,16 @@ static void CacheServerVersion2GUI(bool allowCacheServerChanges, string override
428428
if (GUILayout.Button("Check Connection", GUILayout.Width(150)))
429429
{
430430
var address = s_CacheServer2IPAddress.Split(':');
431-
if (address.Length == 2) // Expected format is '0.0.0.0:0'
432-
{
433-
var ip = address[0];
434-
var port = Convert.ToUInt16(address[1]);
431+
var ip = address[0];
432+
UInt16 port = 0;
433+
if (address.Length == 2)
434+
port = Convert.ToUInt16(address[1]);
435435

436-
if (AssetDatabaseExperimental.CanConnectToCacheServer(ip, port))
437-
s_ConnectionState = ConnectionState.Success;
438-
else
439-
s_ConnectionState = ConnectionState.Failure;
440-
}
436+
if (AssetDatabaseExperimental.CanConnectToCacheServer(ip, port))
437+
s_ConnectionState = ConnectionState.Success;
441438
else
442439
s_ConnectionState = ConnectionState.Failure;
440+
443441
}
444442
}
445443

Editor/Mono/SceneView/SceneView.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -906,13 +906,6 @@ internal override void SetSearchFilter(string searchFilter, SearchMode mode, boo
906906

907907
internal void OnLostFocus()
908908
{
909-
// don't bleed our scene view rendering into game view
910-
var playModeView = PlayModeView.GetMainPlayModeView();
911-
if (playModeView && playModeView.m_Parent != null && m_Parent != null && playModeView.m_Parent == m_Parent)
912-
{
913-
playModeView.m_Parent.backgroundValid = false;
914-
}
915-
916909
if (s_LastActiveSceneView == this)
917910
SceneViewMotion.ResetMotion();
918911
}
@@ -943,7 +936,6 @@ public override void OnEnable()
943936

944937
wantsMouseMove = true;
945938
wantsMouseEnterLeaveWindow = true;
946-
dontClearBackground = true;
947939
s_SceneViews.Add(this);
948940

949941
m_SceneViewOverlay = new SceneViewOverlay(this);

Editor/Mono/ScriptableSingleton.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System;
77
using System.IO;
88
using UnityEditorInternal;
9-
using Object = UnityEngine.Object;
109

1110

1211
namespace UnityEditor
@@ -17,7 +16,7 @@ namespace UnityEditor
1716
[AttributeUsage(AttributeTargets.Class)]
1817
internal class FilePathAttribute : Attribute
1918
{
20-
public enum Location { PreferencesFolder, ProjectFolder, AppDataFolder }
19+
public enum Location { PreferencesFolder, ProjectFolder }
2120

2221
private string filePath;
2322
private string relativePath;
@@ -62,8 +61,6 @@ static string GetFilePath(string relativePath, Location location)
6261

6362
if (location == Location.PreferencesFolder)
6463
return InternalEditorUtility.unityPreferencesFolder + "/" + relativePath;
65-
else if (location == Location.AppDataFolder)
66-
return InternalEditorUtility.userAppDataFolder + "/" + relativePath;
6764
else //location == Location.ProjectFolder
6865
return relativePath;
6966
}

Editor/Mono/Scripting/ScriptCompilation/AssemblyBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ internal bool Build(EditorCompilation editorCompilation)
101101

102102
compilationTask = new CompilationTask(new ScriptAssembly[] { scriptAssembly }, scriptAssembly.OutputDirectory, this,
103103
EditorScriptCompilationOptions.BuildingEmpty, CompilationTaskOptions.StopOnFirstError, 1,
104-
editorCompilation.ILPostProcessing.PostProcess);
104+
editorCompilation.ILPostProcessing);
105105

106106
compilationTask.OnCompilationTaskStarted += (context) =>
107107
{

0 commit comments

Comments
 (0)