Skip to content

Commit 59e35c8

Browse files
author
Unity Technologies
committed
Unity 2017.1.1p2 C# reference source code
1 parent 99e9d03 commit 59e35c8

35 files changed

+406
-106
lines changed

Editor/Mono/Annotation/SceneRenderModeWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public override void OnOpen()
207207
var so = new SerializedObject(LightmapEditorSettings.GetLightmapSettings());
208208
m_EnableRealtimeGI = so.FindProperty("m_GISettings.m_EnableRealtimeLightmaps");
209209
m_EnableBakedGI = so.FindProperty("m_GISettings.m_EnableBakedLightmaps");
210-
m_PathTracerBackend = (LightmapEditorSettings.giBakeBackend == LightmapEditorSettings.GIBakeBackend.PathTracer);
210+
m_PathTracerBackend = (LightmapEditorSettings.lightmapper == LightmapEditorSettings.Lightmapper.PathTracer);
211211
}
212212

213213
public override void OnGUI(Rect rect)

Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,11 @@ private bool ShouldUseIl2CppCore()
355355
if (SystemInfo.operatingSystem.StartsWith("Mac OS X 10."))
356356
{
357357
var versionText = SystemInfo.operatingSystem.Substring(9);
358-
if (new Version(versionText) >= new Version(10, 9))
358+
var version = new Version(versionText);
359+
360+
// our version of .NET Core does not support high sierra. We need to upgrade to .NET Core 2.0 before we can use il2cppcore
361+
// on high sierra
362+
if (version >= new Version(10, 9) && version < new Version(10, 13))
359363
shouldUse = true;
360364
}
361365
else

Editor/Mono/GI/LightmapEditorSettingsDeprecated.cs

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,76 @@ public static float resolution
106106
get { return realtimeResolution; }
107107
set { realtimeResolution = value; }
108108
}
109+
[System.Obsolete("GIBakeBackend has been renamed to Lightmapper. (UnityUpgradable) -> UnityEditor.LightmapEditorSettings/Lightmapper", false)]
110+
public enum GIBakeBackend
111+
{
112+
Radiosity = 0,
113+
PathTracer = 1
114+
}
115+
[System.Obsolete("The giBakeBackend property has been renamed to lightmapper. (UnityUpgradable) -> lightmapper", false)]
116+
public static GIBakeBackend giBakeBackend
117+
{
118+
get
119+
{
120+
if (lightmapper == Lightmapper.PathTracer)
121+
return GIBakeBackend.PathTracer;
122+
else
123+
return GIBakeBackend.Radiosity;
124+
}
125+
set
126+
{
127+
if (value == GIBakeBackend.PathTracer)
128+
lightmapper = Lightmapper.PathTracer;
129+
else
130+
lightmapper = Lightmapper.Radiosity;
131+
}
132+
}
133+
[System.Obsolete("PathTracerSampling has been renamed to Sampling. (UnityUpgradable) -> UnityEditor.LightmapEditorSettings/Sampling", false)]
134+
public enum PathTracerSampling
135+
{
136+
Auto = 0,
137+
Fixed = 1
138+
}
139+
[System.Obsolete("The giPathTracerSampling property has been renamed to sampling. (UnityUpgradable) -> sampling", false)]
140+
public static PathTracerSampling giPathTracerSampling
141+
{
142+
get
143+
{
144+
if (sampling == Sampling.Auto)
145+
return PathTracerSampling.Auto;
146+
else
147+
return PathTracerSampling.Fixed;
148+
}
149+
set
150+
{
151+
if (value == PathTracerSampling.Auto)
152+
sampling = Sampling.Auto;
153+
else
154+
sampling = Sampling.Fixed;
155+
}
156+
}
157+
[System.Obsolete("PathTracerFilter has been renamed to FilterType. (UnityUpgradable) -> UnityEditor.LightmapEditorSettings/FilterType", false)]
158+
public enum PathTracerFilter
159+
{
160+
Gaussian = 0,
161+
ATrous = 1
162+
}
163+
[System.Obsolete("The giPathTracerFilter property has been deprecated. There are three independent properties to set individual filter types for direct, indirect and AO GI textures: filterTypeDirect, filterTypeIndirect and filterTypeAO.")]
164+
public static PathTracerFilter giPathTracerFilter
165+
{
166+
get
167+
{
168+
if (LightmapEditorSettings.filterTypeDirect == FilterType.Gaussian)
169+
return PathTracerFilter.Gaussian;
170+
else
171+
return PathTracerFilter.ATrous;
172+
}
173+
set
174+
{
175+
LightmapEditorSettings.filterTypeDirect = FilterType.Gaussian;
176+
LightmapEditorSettings.filterTypeIndirect = FilterType.Gaussian;
177+
LightmapEditorSettings.filterTypeAO = FilterType.Gaussian;
178+
}
179+
}
109180
}
110181
}

Editor/Mono/Inspector/AvatarPreview.cs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,14 @@ private class Styles
122122
}
123123
private static Styles s_Styles;
124124

125-
private static void SetEnabledRecursive(GameObject go, bool enabled)
126-
{
127-
foreach (Renderer renderer in go.GetComponentsInChildren<Renderer>())
128-
renderer.enabled = enabled;
129-
}
130-
131125
void SetPreviewCharacterEnabled(bool enabled, bool showReference)
132126
{
133127
if (m_PreviewInstance != null)
134-
SetEnabledRecursive(m_PreviewInstance, enabled);
135-
SetEnabledRecursive(m_ReferenceInstance, showReference && enabled);
136-
SetEnabledRecursive(m_DirectionInstance, showReference && enabled);
137-
SetEnabledRecursive(m_PivotInstance, showReference && enabled);
138-
SetEnabledRecursive(m_RootInstance, showReference && enabled);
128+
PreviewRenderUtility.SetEnabledRecursive(m_PreviewInstance, enabled);
129+
PreviewRenderUtility.SetEnabledRecursive(m_ReferenceInstance, showReference && enabled);
130+
PreviewRenderUtility.SetEnabledRecursive(m_DirectionInstance, showReference && enabled);
131+
PreviewRenderUtility.SetEnabledRecursive(m_PivotInstance, showReference && enabled);
132+
PreviewRenderUtility.SetEnabledRecursive(m_RootInstance, showReference && enabled);
139133
}
140134

141135
static AnimationClip GetFirstAnimationClipFromMotion(Motion motion)

Editor/Mono/Inspector/Enlighten/LightmapParameters.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public override void OnInspectorGUI()
6565
EditorGUILayout.PropertyField(m_SystemTag, Styles.systemTagContent);
6666
EditorGUILayout.Space();
6767

68-
bool usesPathTracerBakeBackend = LightmapEditorSettings.giBakeBackend == LightmapEditorSettings.GIBakeBackend.PathTracer;
68+
bool usesPathTracerBakeBackend = LightmapEditorSettings.lightmapper == LightmapEditorSettings.Lightmapper.PathTracer;
6969

7070
GUILayout.Label(Styles.bakedGIContent, EditorStyles.boldLabel);
7171
using (new EditorGUI.DisabledScope(usesPathTracerBakeBackend))

Editor/Mono/Inspector/MaterialEditor.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,11 @@ public void BeginAnimatedCheck(Rect totalPosition, MaterialProperty prop)
961961
GUI.backgroundColor = overrideColor;
962962
}
963963

964+
public void BeginAnimatedCheck(MaterialProperty prop)
965+
{
966+
BeginAnimatedCheck(Rect.zero, prop);
967+
}
968+
964969
public void EndAnimatedCheck()
965970
{
966971
if (m_RendererForAnimationMode == null)

Editor/Mono/Inspector/MaterialEditorGUIHelpers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,15 @@ public void EnableInstancingField(Rect r)
139139
public bool DoubleSidedGIField()
140140
{
141141
Rect r = GetControlRectForSingleLine();
142-
if (LightmapEditorSettings.giBakeBackend == LightmapEditorSettings.GIBakeBackend.PathTracer)
142+
if (LightmapEditorSettings.lightmapper == LightmapEditorSettings.Lightmapper.PathTracer)
143143
{
144144
EditorGUI.PropertyField(r, m_DoubleSidedGI, Styles.doubleSidedGILabel);
145145
serializedObject.ApplyModifiedProperties();
146146
return true;
147147
}
148148
else
149149
{
150-
using (new EditorGUI.DisabledScope(LightmapEditorSettings.giBakeBackend != LightmapEditorSettings.GIBakeBackend.PathTracer))
150+
using (new EditorGUI.DisabledScope(LightmapEditorSettings.lightmapper != LightmapEditorSettings.Lightmapper.PathTracer))
151151
EditorGUI.Toggle(r, Styles.doubleSidedGILabel, false);
152152
}
153153
return false;

Editor/Mono/Inspector/PreviewRenderUtility.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ public PreviewRenderUtility()
101101
Light1.color = new Color(.4f, .4f, .45f, 0f) * .7f;
102102
}
103103

104+
internal static void SetEnabledRecursive(GameObject go, bool enabled)
105+
{
106+
foreach (Renderer renderer in go.GetComponentsInChildren<Renderer>())
107+
renderer.enabled = enabled;
108+
}
109+
104110
[Obsolete("Use the property camera instead (UnityUpgradable) -> camera", false)]
105111
public Camera m_Camera;
106112

Editor/Mono/Inspector/VideoPlayerEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Styles
4848
public GUIContent audioOutputModeContent =
4949
EditorGUIUtility.TextContent("Audio Output Mode|Where the audio in the movie will be output.");
5050
public GUIContent audioSourceContent =
51-
EditorGUIUtility.TextContent("Audio Source|AudioSource component tha will receive this track's audio samples.");
51+
EditorGUIUtility.TextContent("Audio Source|AudioSource component that will receive this track's audio samples.");
5252
public GUIContent aspectRatioLabel = EditorGUIUtility.TextContent("Aspect Ratio");
5353
public GUIContent muteLabel = EditorGUIUtility.TextContent("Mute");
5454
public GUIContent volumeLabel = EditorGUIUtility.TextContent("Volume");

Editor/Mono/LookDevView/LookDevConfig.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -339,12 +339,6 @@ private void DestroyCurrentPreviewObject(LookDevEditionContext context)
339339
}
340340
}
341341

342-
public void SetEnabledRecursive(GameObject go, bool enabled)
343-
{
344-
foreach (Renderer renderer in go.GetComponentsInChildren<Renderer>())
345-
renderer.enabled = enabled;
346-
}
347-
348342
internal static void DisableRendererProperties(GameObject go)
349343
{
350344
foreach (Renderer renderer in go.GetComponentsInChildren<Renderer>())
@@ -433,7 +427,7 @@ public void SetCurrentPreviewObject(GameObject go, LookDevEditionContext context
433427
m_PreviewObjects[index][i].transform.rotation = Quaternion.identity;
434428
EditorUtility.InitInstantiatedPreviewRecursive(m_PreviewObjects[index][i]);
435429
DisableRendererProperties(m_PreviewObjects[index][i]); // Avoid light probe influence from the main scene (but still have the default probe lighting)
436-
SetEnabledRecursive(m_PreviewObjects[index][i], false);
430+
PreviewRenderUtility.SetEnabledRecursive(m_PreviewObjects[index][i], false);
437431
}
438432

439433
UpdateCurrentObjectArray();

0 commit comments

Comments
 (0)