Skip to content

Commit 57f4711

Browse files
author
Unity Technologies
committed
Unity 2018.1.0b5 C# reference source code
1 parent d64a9e0 commit 57f4711

File tree

52 files changed

+967
-312
lines changed

Some content is hidden

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

52 files changed

+967
-312
lines changed

Editor/Mono/AssemblyInfo/AssemblyInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// ADD_NEW_PLATFORM_HERE
99
[assembly: InternalsVisibleTo("UnityEditor.Advertisements")]
1010
[assembly: InternalsVisibleTo("UnityEditor.UIAutomation")]
11+
[assembly: InternalsVisibleTo("Unity.Burst")]
1112
[assembly: InternalsVisibleTo("Unity.PackageManager")]
1213
[assembly: InternalsVisibleTo("Unity.PackageManagerStandalone")]
1314
[assembly: InternalsVisibleTo("Unity.Automation")]

Editor/Mono/AssetPipeline/TextureGenerator.bindings.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,15 @@ public TextureGenerationSettings(TextureImporterType type)
218218
[NativeHeader("Editor/Src/AssetPipeline/TextureImporting/TextureImporterTypes.h")]
219219
[NativeHeader("Editor/Src/AssetPipeline/TextureImporting/TextureImporter.bindings.h")]
220220
[NativeHeader("Runtime/Serialize/BuildTarget.h")]
221-
public static class TextureGenerator
221+
public static unsafe class TextureGenerator
222222
{
223223
public static TextureGenerationOutput GenerateTexture(TextureGenerationSettings settings, NativeArray<Color32> colorBuffer)
224224
{
225-
return GenerateTextureImpl(settings, colorBuffer.GetUnsafeReadOnlyPtr(), colorBuffer.Length * 4);
225+
return GenerateTextureImpl(settings, colorBuffer.GetUnsafeReadOnlyPtr(), colorBuffer.Length * UnsafeUtility.SizeOf<Color32>());
226226
}
227227

228228
[NativeThrows]
229229
[NativeMethod("GenerateTextureScripting")]
230-
extern static TextureGenerationOutput GenerateTextureImpl(TextureGenerationSettings settings, IntPtr colorBuffer, int colorBufferLength);
230+
extern static unsafe TextureGenerationOutput GenerateTextureImpl(TextureGenerationSettings settings, void* colorBuffer, int colorBufferLength);
231231
}
232232
}

Editor/Mono/BuildPipeline/CodeStrippingUtils.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ public static UnityType[] BlackListNativeClasses
7575

7676
static readonly Dictionary<string, string> s_blackListNativeClassesDependencyNames = new Dictionary<string, string>
7777
{
78-
{"ParticleSystemRenderer", "ParticleSystem"}
78+
{"ParticleSystemRenderer", "ParticleSystem"},
79+
{"ParticleSystem", "ParticleSystemRenderer"}
7980
};
8081

8182
static Dictionary<UnityType, UnityType> s_blackListNativeClassesDependency;

Editor/Mono/BuildPlayerWindow.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Styles
6262
const string kShopURL = "https://store.unity3d.com/shop/";
6363
const string kDownloadURL = "http://unity3d.com/unity/download/";
6464
const string kMailURL = "http://unity3d.com/company/sales?type=sales";
65-
const string kMultiPlatformURL = "https://unity3d.com/unity/features/multiplatform";
65+
const string kPlatformInstallationURL = "https://unity3d.com/platform-installation";
6666
// ADD_NEW_PLATFORM_HERE
6767
public GUIContent[,] notLicensedMessages =
6868
{
@@ -71,9 +71,9 @@ class Styles
7171
{ EditorGUIUtility.TextContent("Your license does not cover Apple TV Publishing."), EditorGUIUtility.TrTextContent("Go to Our Online Store"), new GUIContent(kShopURL) },
7272
{ EditorGUIUtility.TextContent("Your license does not cover Android Publishing."), EditorGUIUtility.TrTextContent("Go to Our Online Store"), new GUIContent(kShopURL) },
7373
{ EditorGUIUtility.TextContent("Your license does not cover Tizen Publishing."), EditorGUIUtility.TrTextContent("Go to Our Online Store"), new GUIContent(kShopURL) },
74-
{ EditorGUIUtility.TextContent("Your license does not cover Xbox One Publishing. For more information please see 'Unity for Console' on the multiplatform site."), EditorGUIUtility.TrTextContent("Unity Multiplatform"), new GUIContent(kMultiPlatformURL) },
75-
{ EditorGUIUtility.TextContent("Your license does not cover PS Vita Publishing. For more information please see 'Unity for Console' on the multiplatform site."), EditorGUIUtility.TrTextContent("Unity Multiplatform"), new GUIContent(kMultiPlatformURL) },
76-
{ EditorGUIUtility.TextContent("Your license does not cover PS4 Publishing. For more information please see 'Unity for Console' on the multiplatform site."), EditorGUIUtility.TrTextContent("Unity Multiplatform"), new GUIContent(kMultiPlatformURL) },
74+
{ EditorGUIUtility.TextContent("Your license does not cover Xbox One Publishing. Please see the Xbox One section of the Platform Module Installation documentation for more details."), EditorGUIUtility.TrTextContent("Platform Module Installation"), new GUIContent(kPlatformInstallationURL) },
75+
{ EditorGUIUtility.TextContent("Your license does not cover PS Vita Publishing. Please see the PS Vita section of the Platform Module Installation documentation for more details."), EditorGUIUtility.TrTextContent("Platform Module Installation"), new GUIContent(kPlatformInstallationURL) },
76+
{ EditorGUIUtility.TextContent("Your license does not cover PS4 Publishing. Please see the PS4 section of the Platform Module Installation documentation for more details."), EditorGUIUtility.TrTextContent("Platform Module Installation"), new GUIContent(kPlatformInstallationURL) },
7777
{ EditorGUIUtility.TextContent("Your license does not cover Universal Windows Platform Publishing."), EditorGUIUtility.TrTextContent("Go to Our Online Store"), new GUIContent(kShopURL) },
7878
{ EditorGUIUtility.TextContent("Your license does not cover Windows Phone 8 Publishing."), EditorGUIUtility.TrTextContent("Go to Our Online Store"), new GUIContent(kShopURL) },
7979
{ EditorGUIUtility.TextContent("Your license does not cover Nintendo 3DS Publishing"), EditorGUIUtility.TrTextContent("Contact sales"), new GUIContent(kMailURL) },
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Unity C# reference source
2+
// Copyright (c) Unity Technologies. For terms of use, see
3+
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
4+
5+
using System.Collections;
6+
using System.Collections.Generic;
7+
using UnityEngine;
8+
using System;
9+
using System.IO;
10+
using UnityEngine.Bindings;
11+
using System.Reflection;
12+
13+
namespace Unity.Burst.LowLevel
14+
{
15+
[NativeHeader("Runtime/Burst/Burst.h")]
16+
[StaticAccessor("BurstCompilerService::Get()", StaticAccessorType.Arrow)]
17+
internal static partial class BurstCompilerService
18+
{
19+
[NativeMethod("Initialize")]
20+
static extern string InitializeInternal(string path, ExtractCompilerFlags extractCompilerFlags);
21+
22+
public static extern string GetDisassembly(MethodInfo m, string compilerOptions);
23+
24+
public static extern bool IsInitialized { get; }
25+
}
26+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Unity C# reference source
2+
// Copyright (c) Unity Technologies. For terms of use, see
3+
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
4+
5+
using System.Collections;
6+
using System.Collections.Generic;
7+
using UnityEngine;
8+
using System;
9+
using System.IO;
10+
using UnityEngine.Bindings;
11+
12+
namespace Unity.Burst.LowLevel
13+
{
14+
internal static partial class BurstCompilerService
15+
{
16+
public delegate bool ExtractCompilerFlags(Type jobType, out string flags);
17+
18+
public static void Initialize(string folderRuntime, ExtractCompilerFlags extractCompilerFlags)
19+
{
20+
if (folderRuntime == null) throw new ArgumentNullException(nameof(folderRuntime));
21+
if (extractCompilerFlags == null) throw new ArgumentNullException(nameof(extractCompilerFlags));
22+
23+
if (!Directory.Exists(folderRuntime))
24+
{
25+
Debug.LogError($"Unable to initialize the burst JIT compiler. The folder `{folderRuntime}` does not exist");
26+
return;
27+
}
28+
29+
var message = InitializeInternal(folderRuntime, extractCompilerFlags);
30+
31+
if (message != null)
32+
Debug.LogError($"Unexpected error while trying to initialize the burst JIT compiler: {message}");
33+
}
34+
}
35+
}

Editor/Mono/EditorGUI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,7 @@ internal static double DoubleFieldInternal(Rect position, GUIContent label, doub
17061706
}
17071707

17081708
// Handle dragging of value
1709-
private static void DragNumberValue(RecycledTextEditor editor, Rect position, Rect dragHotZone, int id, bool isDouble, ref double doubleVal, ref long longVal, string formatString, GUIStyle style, double dragSensitivity)
1709+
internal static void DragNumberValue(RecycledTextEditor editor, Rect position, Rect dragHotZone, int id, bool isDouble, ref double doubleVal, ref long longVal, string formatString, GUIStyle style, double dragSensitivity)
17101710
{
17111711
Event evt = Event.current;
17121712

Editor/Mono/Inspector/BlendTreeInspector.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,11 @@ public void RemoveButton(UnityEditorInternal.ReorderableList list)
13051305
if (list.index >= m_Childs.arraySize)
13061306
list.index = m_Childs.arraySize - 1;
13071307
SetMinMaxThresholds();
1308+
1309+
serializedObject.ApplyModifiedProperties();
1310+
1311+
// Layout has changed, bail out now.
1312+
EditorGUIUtility.ExitGUI();
13081313
}
13091314
}
13101315

Editor/Mono/Inspector/LineRendererInspector.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public override void OnEnable()
4343
excludedProperties.Add("m_MotionVectors");
4444
if (!SupportedRenderingFeatures.active.rendererSupportsReceiveShadows)
4545
excludedProperties.Add("m_ReceiveShadows");
46+
excludedProperties.Add("m_RenderingLayerMask");
4647
m_ExcludedProperties = excludedProperties.ToArray();
4748

4849
m_CurveEditor.OnEnable(serializedObject);

Editor/Mono/Inspector/QualitySettingsEditor.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using UnityEditor.Build;
88
using System.Linq;
99
using UnityEditorInternal;
10+
using UnityEngine.Experimental.Rendering;
1011
using UnityEngine.Rendering;
1112

1213
namespace UnityEditor
@@ -534,14 +535,16 @@ public override void OnInspectorGUI()
534535
EditorGUILayout.PropertyField(resolutionScalingFixedDPIFactorProperty);
535536
GUILayout.Space(10);
536537

538+
GUILayout.Label(EditorGUIUtility.TempContent("Shadows"), EditorStyles.boldLabel);
539+
if (SupportedRenderingFeatures.IsMixedLightingModeSupported(MixedLightingMode.Shadowmask))
540+
EditorGUILayout.PropertyField(shadowMaskUsageProperty);
541+
537542
if (!usingSRP)
538543
{
539-
GUILayout.Label(EditorGUIUtility.TempContent("Shadows"), EditorStyles.boldLabel);
540544
EditorGUILayout.PropertyField(shadowsProperty);
541545
EditorGUILayout.PropertyField(shadowResolutionProperty);
542546
EditorGUILayout.PropertyField(shadowProjectionProperty);
543547
EditorGUILayout.PropertyField(shadowDistanceProperty);
544-
EditorGUILayout.PropertyField(shadowMaskUsageProperty);
545548
EditorGUILayout.PropertyField(shadowNearPlaneOffsetProperty);
546549
EditorGUILayout.PropertyField(shadowCascadesProperty);
547550

0 commit comments

Comments
 (0)