Skip to content

Commit 2334921

Browse files
author
Unity Technologies
committed
Unity 2017.3.0b8 C# reference source code
1 parent 389d0a8 commit 2334921

File tree

14 files changed

+113
-19
lines changed

14 files changed

+113
-19
lines changed

Editor/Mono/2D/Common/TexturePlatformSettingsFormatHelper.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ public void AcquireTextureFormatValuesAndStrings(BuildTarget buildTarget, out in
3636
formatValues = TextureImportPlatformSettings.kTextureFormatsValueWiiU;
3737
formatStrings = TextureImporterInspector.s_TextureFormatStringsWiiU;
3838
}
39+
else if (buildTarget == BuildTarget.PSP2)
40+
{
41+
formatValues = TextureImportPlatformSettings.kTextureFormatsValuePSP2;
42+
formatStrings = TextureImporterInspector.s_TextureFormatStringsPSP2;
43+
}
3944
else if (buildTarget == BuildTarget.Switch)
4045
{
4146
formatValues = TextureImportPlatformSettings.kTextureFormatsValueSwitch;

Editor/Mono/BuildPlayerWindow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public GUIContent GetDownloadErrorForTarget(BuildTarget target)
113113
public GUIContent enableHeadlessMode = EditorGUIUtility.TextContent("Headless Mode");
114114
public GUIContent buildScriptsOnly = EditorGUIUtility.TextContent("Scripts Only Build");
115115
public GUIContent learnAboutUnityCloudBuild = EditorGUIUtility.TextContent("Learn about Unity Cloud Build");
116-
public GUIContent compressionMethod = EditorGUIUtility.TextContent("Compression Method|Compression applied to Player data (scenes and resources).\nNone - no compression.\nLZ4 - fast compression suitable for Development Builds.\nLZ4HC - higher compression rate variance of LZ4, causes longer build times. Works best for Release Builds.");
116+
public GUIContent compressionMethod = EditorGUIUtility.TextContent("Compression Method|Compression applied to Player data (scenes and resources).\nDefault - none or default platform compression.\nLZ4 - fast compression suitable for Development Builds.\nLZ4HC - higher compression rate variance of LZ4, causes longer build times. Works best for Release Builds.");
117117

118118
public Compression[] compressionTypes =
119119
{
@@ -124,7 +124,7 @@ public GUIContent GetDownloadErrorForTarget(BuildTarget target)
124124

125125
public GUIContent[] compressionStrings =
126126
{
127-
EditorGUIUtility.TextContent("None"),
127+
EditorGUIUtility.TextContent("Default"),
128128
EditorGUIUtility.TextContent("LZ4"),
129129
EditorGUIUtility.TextContent("LZ4HC"),
130130
};

Editor/Mono/ImportSettings/TextureImportPlatformSettings.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ public bool SupportsFormat(TextureImporterFormat format, TextureImporter importe
193193
case BuildTarget.WiiU:
194194
testValues = kTextureFormatsValueWiiU;
195195
break;
196+
case BuildTarget.PSP2:
197+
testValues = kTextureFormatsValuePSP2;
198+
break;
196199
case BuildTarget.Switch:
197200
testValues = kTextureFormatsValueSwitch;
198201
break;
@@ -337,6 +340,18 @@ public void Apply()
337340
(int)TextureImporterFormat.RGBA16, // R4G4B4A4
338341
};
339342

343+
public static readonly int[] kTextureFormatsValuePSP2 =
344+
{
345+
(int)TextureImporterFormat.DXT1,
346+
(int)TextureImporterFormat.DXT5,
347+
(int)TextureImporterFormat.RGB16,
348+
(int)TextureImporterFormat.RGB24,
349+
(int)TextureImporterFormat.RGBA16,
350+
(int)TextureImporterFormat.RGBA32,
351+
(int)TextureImporterFormat.Alpha8,
352+
(int)TextureImporterFormat.RGBAHalf,
353+
};
354+
340355
public static readonly int[] kTextureFormatsValueSwitch =
341356
{
342357
(int)TextureImporterFormat.DXT1,

Editor/Mono/ImportSettings/TextureImporterInspector.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ internal static int[] NormalFormatsValueAll
359359
#pragma warning disable 649
360360
internal static string[] s_TextureFormatStringsAll;
361361
internal static string[] s_TextureFormatStringsWiiU;
362+
internal static string[] s_TextureFormatStringsPSP2;
362363
internal static string[] s_TextureFormatStringsSwitch;
363364
internal static string[] s_TextureFormatStringsWebGL;
364365
internal static string[] s_TextureFormatStringsApplePVR;
@@ -1470,6 +1471,8 @@ internal static void InitializeTextureFormatStrings()
14701471
s_TextureFormatStringsWebGL = TextureImporterInspector.BuildTextureStrings(TextureImportPlatformSettings.kTextureFormatsValueWebGL);
14711472
if (s_TextureFormatStringsWiiU == null)
14721473
s_TextureFormatStringsWiiU = TextureImporterInspector.BuildTextureStrings(TextureImportPlatformSettings.kTextureFormatsValueWiiU);
1474+
if (s_TextureFormatStringsPSP2 == null)
1475+
s_TextureFormatStringsPSP2 = TextureImporterInspector.BuildTextureStrings(TextureImportPlatformSettings.kTextureFormatsValuePSP2);
14731476
if (s_TextureFormatStringsSwitch == null)
14741477
s_TextureFormatStringsSwitch = TextureImporterInspector.BuildTextureStrings(TextureImportPlatformSettings.kTextureFormatsValueSwitch);
14751478
if (s_TextureFormatStringsDefault == null)

Editor/Mono/Inspector/SkinnedMeshRendererEditor.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public override void OnEnable()
4747
"m_Materials",
4848
"m_BlendShapeWeights",
4949
"m_AABB",
50-
"m_LightmapParameters"
50+
"m_LightmapParameters",
51+
"m_DynamicOccludee"
5152
});
5253
excludedProperties.AddRange(Probes.GetFieldsStringArray());
5354
m_ExcludedProperties = excludedProperties.ToArray();
@@ -84,6 +85,8 @@ public override void OnInspectorGUI()
8485

8586
EditorGUILayout.PropertyField(m_Materials, true);
8687

88+
CullDynamicFieldGUI();
89+
8790
serializedObject.ApplyModifiedProperties();
8891
}
8992

Editor/Mono/Modules/DefaultTextureImportSettingsExtension.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ public virtual void ShowImportSettings(Editor baseEditor, TextureImportPlatformS
158158
formatValues = TextureImportPlatformSettings.kTextureFormatsValueWiiU;
159159
formatStrings = TextureImporterInspector.s_TextureFormatStringsWiiU;
160160
}
161+
else if (platformSettings.m_Target == BuildTarget.PSP2)
162+
{
163+
formatValues = TextureImportPlatformSettings.kTextureFormatsValuePSP2;
164+
formatStrings = TextureImporterInspector.s_TextureFormatStringsPSP2;
165+
}
161166
else if (platformSettings.m_Target == BuildTarget.Switch)
162167
{
163168
formatValues = TextureImportPlatformSettings.kTextureFormatsValueSwitch;

Editor/Mono/PreferencesWindow/CacheServerPreferences.cs

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public Constants()
3737
}
3838

3939
const string kIPAddressKey = "CacheServerIPAddress";
40+
const string kIpAddressKeyArgs = "-" + kIPAddressKey;
4041
const string kModeKey = "CacheServerMode";
4142
const string kDeprecatedEnabledKey = "CacheServerEnabled";
4243

@@ -65,6 +66,10 @@ public static void ReadPreferences()
6566

6667
public static void WritePreferences()
6768
{
69+
// Don't change anything if there's a command line override
70+
if (GetCommandLineRemoteAddressOverride() != null)
71+
return;
72+
6873
CacheServerMode oldMode = (CacheServerMode)EditorPrefs.GetInt(kModeKey);
6974
var oldPath = EditorPrefs.GetString(LocalCacheServer.PathKey);
7075
var oldCustomPath = EditorPrefs.GetBool(LocalCacheServer.CustomPathKey);
@@ -103,6 +108,17 @@ public static void WritePreferences()
103108
}
104109
}
105110

111+
private static string GetCommandLineRemoteAddressOverride()
112+
{
113+
string address = null;
114+
var argv = Environment.GetCommandLineArgs();
115+
var index = Array.IndexOf(argv, kIpAddressKeyArgs);
116+
if (index >= 0 && argv.Length > index + 1)
117+
address = argv[index + 1];
118+
119+
return address;
120+
}
121+
106122
[PreferenceItem("Cache Server")]
107123
private static void OnGUI()
108124
{
@@ -135,17 +151,33 @@ private static void OnGUI()
135151

136152
EditorGUI.BeginChangeCheck();
137153

138-
s_CacheServerMode = (CacheServerMode)EditorGUILayout.EnumPopup("Cache Server Mode", s_CacheServerMode);
154+
var overrideAddress = GetCommandLineRemoteAddressOverride();
155+
156+
if (overrideAddress != null)
157+
{
158+
EditorGUILayout.HelpBox("Cache Server preferences cannot be modified because a remote address was specified via command line argument. To modify Cache Server preferences, restart Unity without the " + kIpAddressKeyArgs + " command line argument.", MessageType.Info, true);
159+
}
160+
161+
using (new EditorGUI.DisabledScope(overrideAddress != null))
162+
{
163+
var displayMode = overrideAddress != null ? CacheServerMode.Remote : s_CacheServerMode;
164+
s_CacheServerMode = (CacheServerMode)EditorGUILayout.EnumPopup("Cache Server Mode", displayMode);
165+
}
139166

140167
if (s_CacheServerMode == CacheServerMode.Remote)
141168
{
142-
s_CacheServerIPAddress = EditorGUILayout.DelayedTextField("IP Address", s_CacheServerIPAddress);
143-
if (GUI.changed)
169+
using (new EditorGUI.DisabledScope(overrideAddress != null))
144170
{
145-
s_ConnectionState = ConnectionState.Unknown;
171+
var displayAddress = overrideAddress != null ? overrideAddress : s_CacheServerIPAddress;
172+
s_CacheServerIPAddress = EditorGUILayout.DelayedTextField("IP Address", displayAddress);
173+
if (GUI.changed)
174+
{
175+
s_ConnectionState = ConnectionState.Unknown;
176+
}
146177
}
147178

148179
GUILayout.Space(5);
180+
149181
if (GUILayout.Button("Check Connection", GUILayout.Width(150)))
150182
{
151183
if (InternalEditorUtility.CanConnectToCacheServer())

Editor/Mono/PreferencesWindow/PreferencesWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ void OnEnable()
242242

243243
private void AddCustomSections()
244244
{
245-
AttributeHelper.MethodInfoSorter methods = AttributeHelper.GetMethodsWithAttribute<PreferenceItem>(BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.DeclaredOnly);
245+
AttributeHelper.MethodInfoSorter methods = AttributeHelper.GetMethodsWithAttribute<PreferenceItem>(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.DeclaredOnly);
246246
var methodsWithAttributes = methods.MethodsWithAttributes;
247247
foreach (var method in methodsWithAttributes)
248248
{

Editor/Mono/Scripting/Compilers/MicrosoftCSharpCompiler.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,10 @@ private string[] GetClassLibraries()
4848

4949
if (PlayerSettings.GetApiCompatibilityLevel(buildTargetGroup) == ApiCompatibilityLevel.NET_4_6)
5050
{
51-
// Assemblies compiled against .NET 4.6 in Visual Studio might reference these 5 assemblies.
52-
// In mono class libraries, they have no type definitions, and just forward all types to mscorlib
51+
// Assemblies compiled against .NET 4.6 in Visual Studio might reference facade DLLs. Therefore we
52+
// need to reference them too, as otherwise compiler will complain about them being missing.
5353
var facadesDirectory = Path.Combine(monoAssemblyDirectory, "Facades");
54-
classLibraries.Add(Path.Combine(facadesDirectory, "System.ObjectModel.dll"));
55-
classLibraries.Add(Path.Combine(facadesDirectory, "System.Runtime.dll"));
56-
classLibraries.Add(Path.Combine(facadesDirectory, "System.Runtime.InteropServices.WindowsRuntime.dll"));
57-
classLibraries.Add(Path.Combine(monoAssemblyDirectory, "System.Numerics.dll"));
58-
classLibraries.Add(Path.Combine(monoAssemblyDirectory, "System.Numerics.Vectors.dll"));
54+
classLibraries.AddRange(Directory.GetFiles(facadesDirectory, "*.dll"));
5955
}
6056

6157
return classLibraries.ToArray();

Modules/TilemapEditor/Editor/Managed/Grid/GridPaintPaletteWindow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ static class Styles
4343
"", // Other OS
4444
"Cursors/macOS",
4545
"Cursors/Windows",
46-
"" // No cursors for Linux yet
46+
"Cursors/Linux",
4747
};
4848
// The following paths match the enums in OperatingSystemFamily
4949
public static readonly Vector2[] mouseCursorOSHotspot =
5050
{
5151
Vector2.zero, // Other OS
5252
new Vector2(6f, 4f),
5353
new Vector2(6f, 4f),
54-
Vector2.zero // No cursors for Linux yet
54+
new Vector2(6f, 4f),
5555
};
5656
// The following paths match the enums in sceneViewEditModes above
5757
public static readonly string[] mouseCursorTexturePaths =

Modules/TilemapEditor/Editor/Managed/Grid/GridPaletteAddPopup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void Init(Rect buttonRect, GridPaintPaletteWindow owner)
3333
m_Owner = owner;
3434
m_CellSize = new Vector3(1, 1, 0);
3535
buttonRect = GUIUtility.GUIToScreenRect(buttonRect);
36-
ShowAsDropDown(buttonRect, new Vector2(312, 140));
36+
ShowAsDropDown(buttonRect, new Vector2(312, 140), null, ShowMode.PopupMenuWithKeyboardFocus);
3737
}
3838

3939
internal void OnGUI()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Unity 2017.3.0b7 C# reference source code
1+
## Unity 2017.3.0b8 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.

artifacts/generated/common/editor/AssetDatabaseBindings.gen.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ public static bool IsMainAsset(Object obj)
6464
}
6565

6666

67+
[UnityEngine.Scripting.GeneratedByOldBindingsGeneratorAttribute] // Temporarily necessary for bindings migration
68+
[System.Runtime.CompilerServices.MethodImplAttribute((System.Runtime.CompilerServices.MethodImplOptions)0x1000)]
69+
extern public static string GetCurrentCacheServerIp () ;
70+
6771
[UnityEngine.Scripting.GeneratedByOldBindingsGeneratorAttribute] // Temporarily necessary for bindings migration
6872
[System.Runtime.CompilerServices.MethodImplAttribute((System.Runtime.CompilerServices.MethodImplOptions)0x1000)]
6973
extern public static bool IsMainAsset (int instanceID) ;

artifacts/generated/common/editor/PlayerSettingsIOSBindings.gen.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,17 @@ public sealed partial class iOSDeviceRequirement
118118
public IDictionary<string, string> values { get { return m_Values; } }
119119
}
120120

121+
[Flags]
122+
public enum iOSSystemGestureDeferMode : uint
123+
{
124+
None = 0,
125+
TopEdge = 1 << 0,
126+
LeftEdge = 1 << 1,
127+
BottomEdge = 1 << 2,
128+
RightEdge = 1 << 3,
129+
All = TopEdge | LeftEdge | BottomEdge | RightEdge
130+
}
131+
121132
internal sealed partial class iOSDeviceRequirementGroup
122133
{
123134
private string m_VariantName;
@@ -307,6 +318,26 @@ public extern static iOSStatusBarStyle statusBarStyle
307318
set;
308319
}
309320

321+
public extern static iOSSystemGestureDeferMode deferSystemGesturesMode
322+
{
323+
[UnityEngine.Scripting.GeneratedByOldBindingsGeneratorAttribute] // Temporarily necessary for bindings migration
324+
[System.Runtime.CompilerServices.MethodImplAttribute((System.Runtime.CompilerServices.MethodImplOptions)0x1000)]
325+
get;
326+
[UnityEngine.Scripting.GeneratedByOldBindingsGeneratorAttribute] // Temporarily necessary for bindings migration
327+
[System.Runtime.CompilerServices.MethodImplAttribute((System.Runtime.CompilerServices.MethodImplOptions)0x1000)]
328+
set;
329+
}
330+
331+
public extern static bool hideHomeButton
332+
{
333+
[UnityEngine.Scripting.GeneratedByOldBindingsGeneratorAttribute] // Temporarily necessary for bindings migration
334+
[System.Runtime.CompilerServices.MethodImplAttribute((System.Runtime.CompilerServices.MethodImplOptions)0x1000)]
335+
get;
336+
[UnityEngine.Scripting.GeneratedByOldBindingsGeneratorAttribute] // Temporarily necessary for bindings migration
337+
[System.Runtime.CompilerServices.MethodImplAttribute((System.Runtime.CompilerServices.MethodImplOptions)0x1000)]
338+
set;
339+
}
340+
310341
public extern static iOSAppInBackgroundBehavior appInBackgroundBehavior
311342
{
312343
[UnityEngine.Scripting.GeneratedByOldBindingsGeneratorAttribute] // Temporarily necessary for bindings migration

0 commit comments

Comments
 (0)