Skip to content

Commit 5bc2902

Browse files
author
Unity Technologies
committed
Unity 2020.1.0a17 C# reference source code
1 parent e8c54a3 commit 5bc2902

File tree

195 files changed

+6570
-3762
lines changed

Some content is hidden

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

195 files changed

+6570
-3762
lines changed

Editor/Mono/Animation/AnimationWindow/AnimationWindowControl.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ private void RebuildGraph(Animator animator)
558558
m_ClipPlayable.SetApplyFootIK(false);
559559

560560
m_CandidateClipPlayable = AnimationClipPlayable.Create(m_Graph, m_CandidateClip);
561+
m_CandidateClipPlayable.SetApplyFootIK(false);
561562

562563
IAnimationWindowPreview[] previewComponents = FetchPostProcessComponents();
563564
bool requiresDefaultPose = previewComponents != null && previewComponents.Length > 0;
@@ -590,6 +591,7 @@ private void RebuildGraph(Animator animator)
590591
AnimationWindowUtility.CreateDefaultCurves(state, m_DefaultPose, streamBindings);
591592

592593
m_DefaultPosePlayable = AnimationClipPlayable.Create(m_Graph, m_DefaultPose);
594+
m_DefaultPosePlayable.SetApplyFootIK(false);
593595

594596
mixer.ConnectInput(inputIndex++, m_DefaultPosePlayable, 0, 1.0f);
595597
}

Editor/Mono/AssemblyInfo/AssemblyInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,6 @@
116116
[assembly: InternalsVisibleTo("Unity.UIElements.Tests")]
117117
[assembly: InternalsVisibleTo("Unity.UIElements.EditorTests")]
118118
[assembly: InternalsVisibleTo("Unity.SceneTemplate.Editor")]
119+
[assembly: InternalsVisibleTo("com.unity.purchasing.udp.Editor")]
119120

120121
[assembly: AssemblyIsEditorAssembly]

Editor/Mono/AssetModificationProcessor.cs

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
using System;
66
using System.Collections.Generic;
7-
using System.Globalization;
87
using UnityEngine;
98
using UnityEditor.VersionControl;
109
using UnityEditorInternal;
@@ -243,6 +242,65 @@ static AssetDeleteResult OnWillDeleteAsset(string assetPath, RemoveAssetOptions
243242
return finalResult;
244243
}
245244

245+
static void OnWillDeleteAssets(string[] assetPaths, AssetDeleteResult[] outPathDeletionResults, RemoveAssetOptions options)
246+
{
247+
for (int i = 0; i < outPathDeletionResults.Length; i++)
248+
outPathDeletionResults[i] = (int)AssetDeleteResult.DidNotDelete;
249+
250+
List<string> nonDeletedPaths = new List<string>();
251+
List<int> nonDeletedPathIndices = new List<int>();
252+
foreach (var assetModificationProcessorClass in AssetModificationProcessors)
253+
{
254+
MethodInfo method = assetModificationProcessorClass.GetMethod("OnWillDeleteAsset", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
255+
if (method == null)
256+
continue;
257+
258+
for (int i = 0; i < assetPaths.Length; i++)
259+
{
260+
object[] args = { assetPaths[i], options };
261+
if (!CheckArgumentsAndReturnType(args, method, typeof(AssetDeleteResult)))
262+
continue;
263+
264+
AssetDeleteResult callbackResult = (AssetDeleteResult)method.Invoke(null, args);
265+
outPathDeletionResults[i] |= callbackResult;
266+
}
267+
}
268+
269+
for (int i = 0; i < assetPaths.Length; i++)
270+
{
271+
if (outPathDeletionResults[i] == (int)AssetDeleteResult.DidNotDelete)
272+
{
273+
nonDeletedPaths.Add(assetPaths[i]);
274+
nonDeletedPathIndices.Add(i);
275+
}
276+
}
277+
278+
if (nonDeletedPaths.Count > 0)
279+
{
280+
if (!Provider.enabled || EditorUserSettings.WorkOffline)
281+
return;
282+
283+
for (int i = 0; i < nonDeletedPaths.Count; i++)
284+
{
285+
if (!Provider.PathIsVersioned(nonDeletedPaths[i]))
286+
{
287+
nonDeletedPaths.RemoveAt(i);
288+
nonDeletedPathIndices.RemoveAt(i);
289+
i--;
290+
}
291+
}
292+
293+
var nonDeletedPathDeletionResults = new AssetDeleteResult[nonDeletedPaths.Count];
294+
295+
AssetModificationHook.OnWillDeleteAssets(nonDeletedPaths.ToArray(), nonDeletedPathDeletionResults, options);
296+
297+
for (int i = 0; i < nonDeletedPathIndices.Count; i++)
298+
{
299+
outPathDeletionResults[nonDeletedPathIndices[i]] = nonDeletedPathDeletionResults[i];
300+
}
301+
}
302+
}
303+
246304
static MethodInfo[] isOpenForEditMethods = null;
247305
static MethodInfo[] GetIsOpenForEditMethods()
248306
{

Editor/Mono/AssetPipeline/TextureImporter.bindings.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ public static bool IsDefaultPlatformTextureFormatValid(TextureImporterType textu
246246
[NativeConditional("ENABLE_TEXTURE_STREAMING")]
247247
public extern int streamingMipmapsPriority { get; set; }
248248

249+
// Is texture VT only
250+
[NativeConditional("ENABLE_VIRTUALTEXTURING")]
251+
[NativeProperty("VTOnly")]
252+
public extern bool vtOnly { get; set; }
253+
249254
// Generate mip maps for the texture?
250255
public extern bool mipmapEnabled { get; set; }
251256
// Keep texture borders the same when generating mipmaps?

Editor/Mono/AssetPipeline/TextureImporterTypes.bindings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public sealed partial class TextureImporterSettings
6464
[SerializeField]
6565
int m_StreamingMipmapsPriority;
6666

67+
6768
[SerializeField]
6869
int m_NPOTScale;
6970
[SerializeField]
@@ -277,6 +278,7 @@ public int streamingMipmapsPriority
277278
set { m_StreamingMipmapsPriority = value; }
278279
}
279280

281+
280282
public TextureImporterNPOTScale npotScale
281283
{
282284
get {return (TextureImporterNPOTScale)m_NPOTScale; }

Editor/Mono/BuildPipeline/AssemblyTypeInfoGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private string GetMonoEmbeddedFullTypeNameFor(TypeReference type)
130130

131131
// Mono compiler generates internal types with names such as "<byteArray>__FixedBuffer0" and "<OnFinishSubmit>c__Iterator0"
132132
// so we only replace angle brackets with square brackets if the type is a generic instance or has generic parameters.
133-
if (type.HasGenericParameters || type.IsGenericInstance)
133+
if (type.HasGenericParameters || type.IsGenericInstance || (type.IsArray && (type.GetElementType().IsGenericInstance || type.GetElementType().HasGenericParameters)))
134134
typeName = typeName.Replace('<', '[').Replace('>', ']');
135135

136136
return typeName.Replace('/', '+');

Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,13 @@ private void ProcessIl2CppOutputForBinary(BuildPostProcessArgs args)
287287
var dataBackupFolder = Path.Combine(args.stagingArea, GetIl2CppDataBackupFolderName(args));
288288
FileUtil.CreateOrCleanDirectory(dataBackupFolder);
289289

290+
var il2cppOutputFolder = Path.Combine(args.stagingAreaData, "il2cppOutput");
291+
292+
// Delete duplicate il2cpp_data that was created in il2cppOutput directory (case 1198179)
293+
FileUtil.DeleteFileOrDirectory(Path.Combine(il2cppOutputFolder, "Data"));
294+
290295
// Move generated C++ code out of Data directory
291-
FileUtil.MoveFileOrDirectory(Path.Combine(args.stagingAreaData, "il2cppOutput"), Path.Combine(dataBackupFolder, "il2cppOutput"));
296+
FileUtil.MoveFileOrDirectory(il2cppOutputFolder, Path.Combine(dataBackupFolder, "il2cppOutput"));
292297

293298
if (IL2CPPUtils.UseIl2CppCodegenWithMonoBackend(BuildPipeline.GetBuildTargetGroup(args.target)))
294299
{

Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ private string GetIl2CppExe()
539539

540540
private string GetIl2CppCoreExe()
541541
{
542-
return IL2CPPUtils.GetIl2CppFolder() + "/build/deploy/il2cppcore/il2cppcore.dll";
542+
return IL2CPPUtils.GetIl2CppFolder() + "/build/deploy/netcoreapp2.1/publish/il2cppcore.dll";
543543
}
544544

545545
private bool ShouldUseIl2CppCore()

Editor/Mono/ConsoleWindow.cs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ internal void OnEnable()
304304
if (m_ConsoleAttachToPlayerState == null)
305305
m_ConsoleAttachToPlayerState = new ConsoleAttachToPlayerState(this);
306306

307+
SetFilter(null);
308+
307309
titleContent = GetLocalizedTitleContent();
308310
ms_ConsoleWindow = this;
309311
m_DevBuild = Unsupported.IsDeveloperMode();
@@ -754,10 +756,7 @@ private void SearchField(Event e)
754756
var filteringText = EditorGUI.ToolbarSearchField(rect, searchText, false);
755757
if (m_SearchText != filteringText)
756758
{
757-
m_SearchText = filteringText;
758-
LogEntries.SetFilteringText(filteringText);
759-
// Reset the active entry when we change the filtering text
760-
SetActiveEntry(null);
759+
SetFilter(filteringText);
761760
}
762761
}
763762

@@ -915,6 +914,21 @@ private void AddStackTraceLoggingMenu(GenericMenu menu)
915914
}
916915
}
917916

917+
private void SetFilter(string filteringText)
918+
{
919+
if (filteringText == null)
920+
{
921+
m_SearchText = "";
922+
LogEntries.SetFilteringText("");
923+
}
924+
else
925+
{
926+
m_SearchText = filteringText;
927+
LogEntries.SetFilteringText(filteringText); // Reset the active entry when we change the filtering text
928+
}
929+
SetActiveEntry(null);
930+
}
931+
918932
[UsedImplicitly] private static event EntryDoubleClickedDelegate entryWithManagedCallbackDoubleClicked;
919933

920934
[UsedImplicitly, RequiredByNativeCode]

Editor/Mono/EditorApplication.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,5 +463,11 @@ static void FireFileMenuNewScene()
463463
if (!ModeService.Execute("file_new_scene"))
464464
FileMenuNewScene();
465465
}
466+
467+
internal static void TogglePlaying()
468+
{
469+
isPlaying = !isPlaying;
470+
InternalEditorUtility.RepaintAllViews();
471+
}
466472
}
467473
}

0 commit comments

Comments
 (0)