Skip to content

Commit 7091799

Browse files
author
Unity Technologies
committed
Unity 2019.2.0a4 C# reference source code
1 parent eb33413 commit 7091799

File tree

560 files changed

+21200
-45843
lines changed

Some content is hidden

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

560 files changed

+21200
-45843
lines changed

Editor/Mono/2D/SpriteEditorModule/SpriteFrameModule/SpriteFrameModule.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,6 @@ UnityTexture2D GetTextureToSlice()
268268
return readableTexture;
269269
// we want to slice based on the original texture slice. Upscale the imported texture
270270
var texture = UnityEditor.SpriteUtility.CreateTemporaryDuplicate(readableTexture, width, height);
271-
if (texture != null)
272-
texture.filterMode = texture.filterMode;
273271
return texture;
274272
}
275273

@@ -303,7 +301,7 @@ public void ScaleSpriteRect(Rect r)
303301

304302
public void TrimAlpha()
305303
{
306-
var texture = m_TextureDataProvider.GetReadableTexture2D();
304+
var texture = GetTextureToSlice();
307305
if (texture == null)
308306
return;
309307

@@ -346,6 +344,7 @@ public void TrimAlpha()
346344
spriteEditor.SetDataModified();
347345

348346
selected.rect = rect;
347+
PopulateSpriteFrameInspectorField();
349348
}
350349
}
351350

Editor/Mono/Animation/AnimationWindow/DopeSheetEditor.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
44

55
using System;
6-
using Boo.Lang.Compiler.Ast;
76
using UnityEngine;
87
using UnityEditor;
9-
using System.Collections;
108
using System.Collections.Generic;
11-
using System.Linq;
129
using Event = UnityEngine.Event;
1310
using Object = UnityEngine.Object;
11+
using System.Collections;
1412

1513
namespace UnityEditorInternal
1614
{

Editor/Mono/Animation/AnimationWindow/MinMaxCurveEditorWindow.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public static MinMaxCurveEditorWindow instance
4949
public AnimationCurve minCurve { get { return m_MinCurve; } }
5050
public AnimationCurve maxCurve { get { return m_MaxCurve; } }
5151

52+
public static string xAxisLabel { get; set; } = "time";
53+
5254
public static bool visible
5355
{
5456
get { return s_SharedMinMaxCurveEditor != null; }
@@ -68,6 +70,7 @@ void Init(CurveEditorSettings settings)
6870
m_CurveEditor.settings.rectangleToolFlags = CurveEditorSettings.RectangleToolFlags.MiniRectangleTool;
6971
m_CurveEditor.settings.undoRedoSelection = true;
7072
m_CurveEditor.settings.showWrapperPopups = true;
73+
m_CurveEditor.settings.xAxisLabel = xAxisLabel;
7174
UpdateRegionDomain();
7275

7376
// For each of horizontal and vertical axis, if we have a finite range for that axis, use that range,

Editor/Mono/AssemblyHelper.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ namespace UnityEditor
1818
{
1919
internal partial class AssemblyHelper
2020
{
21+
static Dictionary<string, bool> managedToDllType = new Dictionary<string, bool>();
22+
2123
// Check if assmebly internal name doesn't match file name, and show the warning.
2224
static public void CheckForAssemblyFileNameMismatch(string assemblyPath)
2325
{
@@ -501,8 +503,14 @@ internal static IEnumerable<T> FindImplementors<T>(Assembly assembly) where T :
501503

502504
public static bool IsManagedAssembly(string file)
503505
{
504-
UnityEditorInternal.DllType type = UnityEditorInternal.InternalEditorUtility.DetectDotNetDll(file);
505-
return type != UnityEditorInternal.DllType.Unknown && type != UnityEditorInternal.DllType.Native;
506+
bool isManagedDll;
507+
if (managedToDllType.TryGetValue(file, out isManagedDll))
508+
{
509+
return isManagedDll;
510+
}
511+
var res = InternalEditorUtility.IsDotNetDll(file);
512+
managedToDllType[file] = res;
513+
return res;
506514
}
507515

508516
public static bool IsInternalAssembly(string file)

Editor/Mono/AssetDatabase/AssetDatabaseSearching.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private static IEnumerator<T> FindInFolders<T>(SearchFilter searchFilter, Func<H
5454
{
5555
var folders = new List<string>();
5656
folders.AddRange(searchFilter.folders);
57-
if (folders.Remove(PackageManager.Folders.GetPackagesMountPoint()))
57+
if (folders.Remove(PackageManager.Folders.GetPackagesPath()))
5858
{
5959
var packages = PackageManagerUtilityInternal.GetAllVisiblePackages();
6060
foreach (var package in packages)

Editor/Mono/AssetPipeline/TextureImporter.bindings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ internal static extern string defaultPlatformName
5353
public extern TextureImporterCompression textureCompression { get; set; }
5454
public extern TextureImporterAlphaSource alphaSource { get; set; }
5555

56+
internal extern bool forceMaximumCompressionQuality_BC6H_BC7 { get; set; }
57+
5658
// Generate alpha channel from intensity?
5759
[Obsolete("Use UnityEditor.TextureImporter.alphaSource instead.")]
5860
public bool grayscaleToAlpha

Editor/Mono/AssetPipeline/TextureImporterTypes.bindings.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,10 @@ public sealed partial class TextureImporterPlatformSettings
526526
int m_TextureCompression = (int)TextureImporterCompression.Compressed;
527527
[SerializeField]
528528
int m_CompressionQuality = (int)TextureCompressionQuality.Normal;
529+
530+
[SerializeField]
531+
internal int m_ForceMaximumCompressionQuality_BC6H_BC7 = 0;
532+
529533
[SerializeField]
530534
int m_CrunchedCompression = 0;
531535
[SerializeField]
@@ -574,6 +578,12 @@ public int compressionQuality
574578
set { m_CompressionQuality = value; }
575579
}
576580

581+
internal int forceMaximumCompressionQuality_BC6H_BC7
582+
{
583+
get { return m_ForceMaximumCompressionQuality_BC6H_BC7; }
584+
set { m_ForceMaximumCompressionQuality_BC6H_BC7 = value; }
585+
}
586+
577587
public bool crunchedCompression
578588
{
579589
get { return m_CrunchedCompression != 0; }

Editor/Mono/AssetStore.bindings.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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 UnityEditor;
6+
7+
namespace UnityEditorInternal
8+
{
9+
// Keep internal and undocumented until we expose more functionality
10+
//*undocumented*
11+
public sealed class AssetStore
12+
{
13+
//*undocumented*
14+
public static void Open(string assetStoreURL)
15+
{
16+
if (assetStoreURL != "")
17+
AssetStoreWindow.OpenURL(assetStoreURL);
18+
else
19+
AssetStoreWindow.Init();
20+
}
21+
}
22+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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 UnityEngine.Bindings;
6+
7+
namespace UnityEditor
8+
{
9+
[NativeHeader("Editor/Mono/AssetStore.bindings.h")]
10+
[StaticAccessor("AssetStoreScriptBindings", StaticAccessorType.DoubleColon)]
11+
internal partial class AssetStoreContext
12+
{
13+
extern public static void SessionSetString(string key, string value);
14+
extern public static string SessionGetString(string key);
15+
extern public static void SessionRemoveString(string key);
16+
extern public static bool SessionHasString(string key);
17+
}
18+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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 Object = UnityEngine.Object;
6+
using UnityEngine.Bindings;
7+
8+
namespace UnityEditorInternal
9+
{
10+
[NativeHeader("Editor/Mono/AssetStore.bindings.h")]
11+
[StaticAccessor("AssetStoreScriptBindings", StaticAccessorType.DoubleColon)]
12+
public sealed partial class AssetStoreToolUtils
13+
{
14+
extern public static bool BuildAssetStoreAssetBundle(Object targetObject, string targetPath);
15+
}
16+
}

0 commit comments

Comments
 (0)