Skip to content

Commit 6811906

Browse files
author
Unity Technologies
committed
Unity 2017.2.0a4 C# reference source code
1 parent 0c8e9ce commit 6811906

199 files changed

Lines changed: 14848 additions & 2904 deletions

File tree

Some content is hidden

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

Editor/Mono/2D/Utility2D.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ public override bool StartPlayback()
284284
if (!canPlay)
285285
return false;
286286

287-
if (!AnimationMode.InAnimationPlaybackMode())
287+
if (!playing)
288288
{
289289
AnimationMode.StartAnimationPlaybackMode();
290290

Editor/Mono/Animation/AnimationWindow/CurveEditorWindow.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ void InitCurvePresets()
260260

261261
void OnDestroy()
262262
{
263-
m_CurvePresets.GetPresetLibraryEditor().UnloadUsedLibraries();
263+
if (m_CurvePresets != null)
264+
m_CurvePresets.GetPresetLibraryEditor().UnloadUsedLibraries();
264265
}
265266

266267
void OnDisable()

Editor/Mono/Animation/TransitionPreview.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ private void CopyTransitionForPreview(AnimatorStateTransition src, ref AnimatorS
157157

158158
private bool MustResample(TransitionInfo info)
159159
{
160-
return mustResample || !info.IsEqual(m_RefTransitionInfo);
160+
bool isInPlayback = m_AvatarPreview != null && m_AvatarPreview.Animator != null && m_AvatarPreview.Animator.recorderMode == AnimatorRecorderMode.Playback;
161+
return mustResample || !info.IsEqual(m_RefTransitionInfo) || !isInPlayback;
161162
}
162163

163164
private void WriteParametersInController()

Editor/Mono/Annotation/AnnotationWindow.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ internal class AnnotationWindow : EditorWindow
1111
{
1212
class Styles
1313
{
14-
public GUIStyle toolbar = "toolbar";
1514
public GUIStyle toggle = "OL Toggle";
1615
public GUIStyle listEvenBg = "ObjectPickerResultsOdd";//"ObjectPickerResultsEven";//
1716
public GUIStyle listOddBg = "ObjectPickerResultsEven";//"ObjectPickerResultsEven";//
18-
public GUIStyle listSectionHeaderBg = "ObjectPickerResultsEven";
1917
public GUIStyle background = "grey_border";
2018
public GUIStyle seperator = "sv_iconselector_sep";
2119
public GUIStyle iconDropDown = "IN dropdown";
@@ -56,7 +54,6 @@ public Styles()
5654
List<AInfo> m_BuiltinAnnotations;
5755
List<AInfo> m_ScriptAnnotations;
5856
Vector2 m_ScrollPosition;
59-
const float k_AnimDuration = 0.4f;
6057
bool m_SyncWithState;
6158
string m_LastScriptThatHasShownTheIconSelector;
6259
List<MonoScript> m_MonoScriptIconsChanged;
@@ -320,7 +317,7 @@ void DrawTopSection(float topSectionHeight)
320317
float rowHeight = EditorGUI.kSingleLineHeight + 2 * EditorGUI.kControlVerticalSpacing;
321318

322319
// Toggle 3D gizmos
323-
Rect toggleRect = new Rect(margin - 2, curY, labelWidth, rowHeight);
320+
Rect toggleRect = new Rect(margin, curY, labelWidth, rowHeight);
324321
AnnotationUtility.use3dGizmos = GUI.Toggle(toggleRect, AnnotationUtility.use3dGizmos, icon3dGizmoContent);
325322

326323
// Texel world size
@@ -336,7 +333,7 @@ void DrawTopSection(float topSectionHeight)
336333
// Slider
337334
float sliderWidth = position.width - margin - labelWidth;
338335
float iconSize01 = ConvertTexelWorldSizeTo01(texelWorldSize);
339-
Rect sliderRect = new Rect(position.width - margin - sliderWidth , curY, sliderWidth, rowHeight);
336+
Rect sliderRect = new Rect(labelWidth + margin, curY, sliderWidth - margin, rowHeight);
340337
iconSize01 = GUI.HorizontalSlider(sliderRect, iconSize01, 0.0f, 1.0f);
341338
if (GUI.changed)
342339
{
@@ -350,12 +347,12 @@ void DrawTopSection(float topSectionHeight)
350347
// Show Grid
351348
using (new EditorGUI.DisabledScope(m_IsGameView))
352349
{
353-
toggleRect = new Rect(margin - 2, curY, labelWidth, rowHeight);
350+
toggleRect = new Rect(margin, curY, labelWidth, rowHeight);
354351
AnnotationUtility.showGrid = GUI.Toggle(toggleRect, AnnotationUtility.showGrid, showGridContent);
355-
curY += rowHeight;
352+
356353
toggleRect.y += rowHeight;
357354
AnnotationUtility.showSelectionOutline = GUI.Toggle(toggleRect, AnnotationUtility.showSelectionOutline, showOutlineContent);
358-
curY += rowHeight;
355+
359356
toggleRect.y += rowHeight;
360357
AnnotationUtility.showSelectionWire = GUI.Toggle(toggleRect, AnnotationUtility.showSelectionWire, showWireframeContent);
361358
}

Editor/Mono/Annotation/SceneRenderModeWindow.cs

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

214214
public override void OnGUI(Rect rect)

Editor/Mono/AssemblyHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ private static bool IsTypeAUserExtendedScript(AssemblyDefinition assembly, TypeR
224224

225225
// Look up the type in UnityEngine.dll or UnityEditor.dll
226226
Assembly builtinAssembly = null;
227-
if (type.Scope.Name == "UnityEngine")
227+
if (type.Scope.Name == "UnityEngine" || type.Scope.Name == "UnityEngine.CoreModule")
228228
builtinAssembly = typeof(MonoBehaviour).Assembly;
229229
else if (type.Scope.Name == "UnityEditor")
230230
builtinAssembly = typeof(EditorWindow).Assembly;

0 commit comments

Comments
 (0)