Skip to content

Commit c4e4e5f

Browse files
author
Unity Technologies
committed
Unity 2020.2.0a19 C# reference source code
1 parent 25d51bd commit c4e4e5f

File tree

113 files changed

+2134
-1330
lines changed

Some content is hidden

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

113 files changed

+2134
-1330
lines changed

Editor/Mono/2D/SpriteAtlas/SpriteAtlasImporterInspector.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,11 +610,15 @@ private void HandleTextureSettingUI()
610610
EditorGUI.indentLevel--;
611611

612612
if (m_SelectedPlatformSettings == 0)
613+
{
614+
GUILayout.Space(EditorGUI.kSpacing);
613615
HandlePlatformSettingUI(null);
616+
}
614617
else
615618
{
616619
EditorGUILayout.BeginVertical();
617620
{
621+
GUILayout.Space(EditorGUI.kSpacing);
618622
string oldSecondaryTextureName = m_PlatformSettingsOptions[m_SelectedPlatformSettings];
619623
GUI.SetNextControlName(s_Styles.secondaryTextureNameTextControlName);
620624

Editor/Mono/2D/SpriteAtlas/SpriteAtlasInspector.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,11 +532,15 @@ private void HandleTextureSettingUI()
532532
EditorGUI.indentLevel--;
533533

534534
if (m_SelectedPlatformSettings == 0)
535+
{
536+
GUILayout.Space(EditorGUI.kSpacing);
535537
HandlePlatformSettingUI(null);
538+
}
536539
else
537540
{
538541
EditorGUILayout.BeginVertical();
539542
{
543+
GUILayout.Space(EditorGUI.kSpacing);
540544
string oldSecondaryTextureName = m_PlatformSettingsOptions[m_SelectedPlatformSettings];
541545
GUI.SetNextControlName(s_Styles.secondaryTextureNameTextControlName);
542546

Editor/Mono/AssetDatabase/AssetDatabase.deprecated.cs

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
using System;
66
using System.Runtime.InteropServices;
7+
using UnityEngine;
8+
using UnityEditor.AssetImporters;
9+
using UnityEngine.Bindings;
710

811
namespace UnityEditor
912
{
@@ -50,3 +53,98 @@ public sealed class AssetsItem
5053
}
5154
}
5255

56+
namespace UnityEditor.Experimental
57+
{
58+
public partial class AssetDatabaseExperimental
59+
{
60+
[FreeFunction("AssetDatabase::ClearImporterOverride")]
61+
[Obsolete("AssetDatabaseExperimental.ClearImporterOverride() has been deprecated. Use AssetDatabase.ClearImporterOverride() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.ClearImporterOverride(*)", false)]
62+
extern public static void ClearImporterOverride(string path);
63+
64+
[FreeFunction("AssetDatabase::IsCacheServerEnabled")]
65+
[Obsolete("AssetDatabaseExperimental.IsCacheServerEnabled() has been deprecated. Use AssetDatabase.IsCacheServerEnabled() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.IsCacheServerEnabled(*)", false)]
66+
public extern static bool IsCacheServerEnabled();
67+
68+
[Obsolete("AssetDatabaseExperimental.SetImporterOverride<T>() has been deprecated. Use AssetDatabase.SetImporterOverride<T>() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.SetImporterOverride<T>(*)", false)]
69+
public static void SetImporterOverride<T>(string path)
70+
where T : ScriptedImporter
71+
{
72+
AssetDatabase.SetImporterOverrideInternal(path, typeof(T));
73+
}
74+
75+
[FreeFunction("AssetDatabase::GetImporterOverride")]
76+
[Obsolete("AssetDatabaseExperimental.GetImporterOverride() has been deprecated. Use AssetDatabase.GetImporterOverride() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetImporterOverride(*)", false)]
77+
extern public static System.Type GetImporterOverride(string path);
78+
79+
[FreeFunction("AssetDatabase::GetAvailableImporterTypes")]
80+
[Obsolete("AssetDatabaseExperimental.GetAvailableImporterTypes() has been deprecated. Use AssetDatabase.GetAvailableImporterTypes() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetAvailableImporterTypes(*)", false)]
81+
extern public static Type[] GetAvailableImporterTypes(string path);
82+
83+
[FreeFunction("AcceleratorClientCanConnectTo")]
84+
[Obsolete("AssetDatabaseExperimental.CanConnectToCacheServer() has been deprecated. Use AssetDatabase.CanConnectToCacheServer() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.CanConnectToCacheServer(*)", false)]
85+
public extern static bool CanConnectToCacheServer(string ip, UInt16 port);
86+
87+
[FreeFunction()]
88+
[Obsolete("AssetDatabaseExperimental.RefreshSettings() has been deprecated. Use AssetDatabase.RefreshSettings() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.RefreshSettings(*)", false)]
89+
public extern static void RefreshSettings();
90+
91+
[Obsolete("AssetDatabaseExperimental.CacheServerConnectionChangedParameters has been deprecated. Use UnityEditor.CacheServerConnectionChangedParameters instead (UnityUpgradable) -> UnityEditor.CacheServerConnectionChangedParameters", false)]
92+
public struct CacheServerConnectionChangedParameters
93+
{
94+
}
95+
96+
#pragma warning disable 67
97+
[Obsolete("AssetDatabaseExperimental.cacheServerConnectionChanged has been deprecated. Use AssetDatabase.cacheServerConnectionChanged instead (UnityUpgradable) -> UnityEditor.AssetDatabase.cacheServerConnectionChanged", false)]
98+
public static event Action<CacheServerConnectionChangedParameters> cacheServerConnectionChanged;
99+
#pragma warning restore 67
100+
101+
[FreeFunction("IsConnectedToCacheServerV2")]
102+
[Obsolete("AssetDatabaseExperimental.IsConnectedToCacheServer() has been deprecated. Use AssetDatabase.IsConnectedToCacheServer() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.IsConnectedToCacheServer(*)", false)]
103+
public extern static bool IsConnectedToCacheServer();
104+
105+
[FreeFunction()]
106+
[Obsolete("AssetDatabaseExperimental.GetCacheServerAddress() has been deprecated. Use AssetDatabase.GetCacheServerAddress() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetCacheServerAddress(*)", false)]
107+
public extern static string GetCacheServerAddress();
108+
109+
[FreeFunction()]
110+
[Obsolete("AssetDatabaseExperimental.GetCacheServerPort() has been deprecated. Use AssetDatabase.GetCacheServerPort() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetCacheServerPort(*)", false)]
111+
public extern static UInt16 GetCacheServerPort();
112+
113+
[FreeFunction("AssetDatabase::GetCacheServerNamespacePrefix")]
114+
[Obsolete("AssetDatabaseExperimental.GetCacheServerNamespacePrefix() has been deprecated. Use AssetDatabase.GetCacheServerNamespacePrefix() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetCacheServerNamespacePrefix(*)", false)]
115+
public extern static string GetCacheServerNamespacePrefix();
116+
117+
[FreeFunction("AssetDatabase::GetCacheServerEnableDownload")]
118+
[Obsolete("AssetDatabaseExperimental.GetCacheServerEnableDownload() has been deprecated. Use AssetDatabase.GetCacheServerEnableDownload() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetCacheServerEnableDownload(*)", false)]
119+
public extern static bool GetCacheServerEnableDownload();
120+
121+
[FreeFunction("AssetDatabase::GetCacheServerEnableUpload")]
122+
[Obsolete("AssetDatabaseExperimental.GetCacheServerEnableUpload() has been deprecated. Use AssetDatabase.GetCacheServerEnableUpload() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.GetCacheServerEnableUpload(*)", false)]
123+
public extern static bool GetCacheServerEnableUpload();
124+
125+
[FreeFunction("AssetDatabase::IsDirectoryMonitoringEnabled")]
126+
[Obsolete("AssetDatabaseExperimental.IsDirectoryMonitoringEnabled() has been deprecated. Use AssetDatabase.IsDirectoryMonitoringEnabled() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.IsDirectoryMonitoringEnabled(*)", false)]
127+
public extern static bool IsDirectoryMonitoringEnabled();
128+
129+
[FreeFunction("AssetDatabaseExperimental::RegisterCustomDependency")]
130+
[PreventExecutionInState(AssetDatabasePreventExecution.kPreventCustomDependencyChanges, PreventExecutionSeverity.PreventExecution_ManagedException, "Custom dependencies can only be removed when the assetdatabase is not importing.")]
131+
[Obsolete("AssetDatabaseExperimental.RegisterCustomDependency() has been deprecated. Use AssetDatabase.RegisterCustomDependency() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.RegisterCustomDependency(*)", false)]
132+
public extern static void RegisterCustomDependency(string dependency, Hash128 hashOfValue);
133+
134+
[FreeFunction("AssetDatabaseExperimental::UnregisterCustomDependencyPrefixFilter")]
135+
[PreventExecutionInState(AssetDatabasePreventExecution.kPreventCustomDependencyChanges, PreventExecutionSeverity.PreventExecution_ManagedException, "Custom dependencies can only be removed when the assetdatabase is not importing.")]
136+
[Obsolete("AssetDatabaseExperimental.UnregisterCustomDependencyPrefixFilter() has been deprecated. Use AssetDatabase.UnregisterCustomDependencyPrefixFilter() instead (UnityUpgradable) -> UnityEditor.AssetDatabase.UnregisterCustomDependencyPrefixFilter(*)", false)]
137+
public extern static UInt32 UnregisterCustomDependencyPrefixFilter(string prefixFilter);
138+
139+
[FreeFunction("AssetDatabase::IsAssetImportProcess")]
140+
[Obsolete("AssetDatabaseExperimental.IsAssetImportWorkerProcess() has been deprecated. Use AssetDatabase.IsAssetImportWorkerProcess()", false)]
141+
public extern static bool IsAssetImportWorkerProcess();
142+
143+
[Obsolete("Has been replaced by AssetDatabaseExperimental.RefreshSettings", true)]
144+
public static void ReconnectToCacheServer()
145+
{
146+
throw new NotSupportedException("Please use AssetdatabaseExperimental.RefreshSettings instead.");
147+
}
148+
}
149+
}
150+

Editor/Mono/BuildPipeline/AssemblyStripper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ private static void GetUnityLinkerPlatformStringsFromBuildTarget(BuildTarget tar
642642
break;
643643
case BuildTarget.StandaloneOSX:
644644
platform = "MacOSX";
645-
architecture = "x64";
645+
architecture = "";
646646
break;
647647
case BuildTarget.WSAPlayer:
648648
platform = "WinRT";

Editor/Mono/BuildPipeline/BuildPlatform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public string GetBuildTargetDisplayName(BuildTargetGroup group, BuildTarget targ
116116
case BuildTarget.StandaloneOSXIntel:
117117
case BuildTarget.StandaloneOSXIntel64:
118118
#pragma warning restore 612, 618
119-
return "Mac OS X";
119+
return "macOS";
120120
// Deprecated
121121
#pragma warning disable 612, 618
122122
case BuildTarget.StandaloneLinux:

Editor/Mono/BuildPipeline/DesktopStandaloneBuildWindowExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ private void SetupStandaloneSubtargets()
4040
if (ModuleManager.IsPlatformSupportLoadedByBuildTarget(BuildTarget.StandaloneOSX))
4141
{
4242
standaloneSubtargetsList.Add(BuildTarget.StandaloneOSX);
43-
standaloneSubtargetStringsList.Add(EditorGUIUtility.TrTextContent("Mac OS X"));
43+
standaloneSubtargetStringsList.Add(EditorGUIUtility.TrTextContent("macOS"));
4444
}
4545
if (ModuleManager.IsPlatformSupportLoadedByBuildTarget(BuildTarget.StandaloneLinux64))
4646
{

Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ private void CopyNativePlugins(BuildPostProcessArgs args, BuildTarget buildTarge
105105

106106
foreach (PluginImporter imp in PluginImporter.GetImporters(buildTarget))
107107
{
108+
if (!IsPluginCompatibleWithCurrentBuild(buildTarget, imp))
109+
continue;
110+
108111
// Skip .cpp files. They get copied to il2cpp output folder just before code compilation
109112
if (DesktopPluginImporterExtension.IsCppPluginFile(imp.assetPath))
110113
{
@@ -182,6 +185,12 @@ private void CopyNativePlugins(BuildPostProcessArgs args, BuildTarget buildTarge
182185
}
183186
}
184187

188+
protected virtual bool IsPluginCompatibleWithCurrentBuild(BuildTarget buildTarget, PluginImporter imp)
189+
{
190+
var cpu = imp.GetPlatformData(buildTarget, "CPU");
191+
return !string.Equals(cpu, "None", StringComparison.OrdinalIgnoreCase);
192+
}
193+
185194
private void CopyCppPlugins(BuildPostProcessArgs args, string cppOutputDir, IEnumerable<string> cppPlugins)
186195
{
187196
if (GetCreateSolution(args))
@@ -224,7 +233,7 @@ private void SetupStagingArea(BuildPostProcessArgs args, HashSet<string> filesTo
224233
if (UseIl2Cpp)
225234
{
226235
var il2cppPlatformProvider = GetPlatformProvider(args);
227-
IL2CPPUtils.RunIl2Cpp(args.stagingAreaData, il2cppPlatformProvider, (cppOutputDir) => CopyCppPlugins(args, cppOutputDir, cppPlugins), args.usedClassRegistry);
236+
RunIL2CPP(args, il2cppPlatformProvider, cppPlugins);
228237

229238
if (GetCreateSolution(args))
230239
{
@@ -246,6 +255,11 @@ private void SetupStagingArea(BuildPostProcessArgs args, HashSet<string> filesTo
246255
}
247256
}
248257

258+
protected virtual void RunIL2CPP(BuildPostProcessArgs args, IIl2CppPlatformProvider il2cppPlatformProvider, List<string> cppPlugins)
259+
{
260+
IL2CPPUtils.RunIl2Cpp(args.stagingAreaData, il2cppPlatformProvider, (cppOutputDir) => CopyCppPlugins(args, cppOutputDir, cppPlugins), args.usedClassRegistry);
261+
}
262+
249263
private void ProcessIl2CppOutputForBinary(BuildPostProcessArgs args)
250264
{
251265
// Move GameAssembly next to game executable
@@ -375,8 +389,9 @@ protected bool CopyPlayerFilter(string path, BuildPostProcessArgs args)
375389
{
376390
// Don't copy assemblies that are being overridden by a User assembly.
377391
var fileName = Path.GetFileName(path);
378-
for (int i = 0; i < args.report.files.Length; ++i)
379-
if (Path.GetFileName(args.report.files[i].path) == fileName && args.report.files[i].isOverridingUnityAssembly)
392+
var files = args.report.files;
393+
for (var i = 0; i < files.Length; ++i)
394+
if (Path.GetFileName(files[i].path) == fileName && files[i].isOverridingUnityAssembly)
380395
return false;
381396

382397
// Don't copy UnityEngine mdb/pdb files
@@ -507,9 +522,13 @@ protected static bool IsHeadlessMode(BuildPostProcessArgs args)
507522
return ((args.options & BuildOptions.EnableHeadlessMode) != 0);
508523
}
509524

510-
protected virtual string GetVariationName(BuildPostProcessArgs args)
525+
protected string GetVariationName(BuildPostProcessArgs args)
526+
{
527+
return GetVariationName(args, PlatformStringFor(args.target));
528+
}
529+
530+
protected virtual string GetVariationName(BuildPostProcessArgs args, string platformString)
511531
{
512-
var platformString = PlatformStringFor(args.target);
513532
var configurationString = GetDevelopment(args) ? "development" : "nondevelopment";
514533

515534
var scriptingBackend = "mono";

0 commit comments

Comments
 (0)