Skip to content

Commit 73f36bf

Browse files
author
Unity Technologies
committed
Unity 2018.3.0b1 C# reference source code
1 parent b9bc712 commit 73f36bf

89 files changed

Lines changed: 1240 additions & 784 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/AssetStore/AssetStoreContext.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using System.Linq;
1313
using System.IO;
1414
using UnityEditor.Web;
15+
using UnityEditor.Analytics;
1516

1617
namespace UnityEditor
1718
{
@@ -163,6 +164,15 @@ public void OpenBrowser(string url)
163164
Application.OpenURL(url);
164165
}
165166

167+
[Serializable]
168+
public struct DownloadAssetInfo
169+
{
170+
public string package_id;
171+
public string package_name;
172+
public string publisher_name;
173+
public string category_name;
174+
}
175+
166176
public void Download(Package package, DownloadInfo downloadInfo)
167177
{
168178
Download(
@@ -205,6 +215,13 @@ public static void Download(string package_id, string url, string key, string pa
205215
parameters["download"] = download;
206216

207217
AssetStoreUtils.Download(package_id, url, dest, key, parameters.ToString(), resumeOK, doneCallback);
218+
EditorAnalytics.SendAssetDownloadEvent(new DownloadAssetInfo()
219+
{
220+
package_id = package_id,
221+
package_name = package_name,
222+
publisher_name = publisher_name,
223+
category_name = category_name
224+
});
208225
}
209226

210227
/// <summary>

Editor/Mono/Audio/Mixer/GUI/AudioMixerExposedParameterView.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ void DrawElement(Rect rect, int index, bool isActive, bool isFocused)
106106

107107
public Vector2 CalcSize()
108108
{
109+
if (m_ReorderableListWithRenameAndScrollView.list.count != m_Controller.exposedParameters.Length)
110+
{
111+
RecreateListControl();
112+
}
109113
float maxWidth = 0;
110114
for (int index = 0; index < m_ReorderableListWithRenameAndScrollView.list.count; index++)
111115
{

Editor/Mono/Audio/Mixer/GUI/AudioMixerExposedParametersPopup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ internal static void Popup(AudioMixerController controller, GUIStyle style, para
1818
Rect buttonRect = GUILayoutUtility.GetRect(content, style, options);
1919
if (EditorGUI.DropdownButton(buttonRect, content, FocusType.Passive, style))
2020
{
21-
PopupWindow.Show(buttonRect, new AudioMixerExposedParametersPopup(controller), null, ShowMode.PopupMenuWithKeyboardFocus);
21+
PopupWindow.Show(buttonRect, new AudioMixerExposedParametersPopup(controller));
2222
}
2323
}
2424

Editor/Mono/BuildPipeline/AssemblyStripper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private static bool StripAssembliesTo(string[] assemblies, string[] searchDirs,
7777
args.AddRange(additionalBlacklist.Select(path => "-x \"" + path + "\""));
7878

7979
args.AddRange(searchDirs.Select(d => "-d \"" + d + "\""));
80-
args.AddRange(assemblies.Select(assembly => "-a \"" + Path.GetFullPath(assembly) + "\""));
80+
args.AddRange(assemblies.Select(assembly => "--include-unity-root-assembly=\"" + Path.GetFullPath(assembly) + "\""));
8181
args.Add($"--dotnetruntime={GetRuntimeArgumentValueForLinker(buildTargetGroup)}");
8282
args.Add($"--dotnetprofile={GetProfileArgumentValueForLinker(buildTargetGroup)}");
8383
args.Add("--use-editor-options");

Editor/Mono/Collab/Collab.bindings.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,17 @@ public extern void TestClearSoftLockAsCollaborator(string projectGuid, string pr
206206
[NativeMethod(HasExplicitThis = true, ThrowsException = true, IsThreadSafe = true)]
207207
extern void SetChangesToPublishInternal(ChangeItem[] changes);
208208

209+
[NativeMethod(HasExplicitThis = true, ThrowsException = true, IsThreadSafe = true)]
210+
extern Change[] GetSelectedChangesInternal();
211+
209212
[NativeMethod(Name = "GetJobProgress", HasExplicitThis = true, ThrowsException = true)]
210213
extern bool GetJobProgressInternal([Out] ProgressInfo info, int jobId);
211214

212215
[NativeMethod(HasExplicitThis = true, ThrowsException = true)]
213216
public extern void Publish(string comment, bool useSelectedAssets, bool confirmMatchesPrevious);
214217

218+
[NativeMethod(HasExplicitThis = true, ThrowsException = true, IsThreadSafe = true)]
219+
public extern void ClearSelectedChangesToPublish();
215220

216221
[NativeMethod(HasExplicitThis = true, ThrowsException = true)]
217222
public extern SoftLock[] GetSoftLocks(string assetGuid);

Editor/Mono/Collab/Collab.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,17 @@ public bool SetConflictsResolvedTheirs(string[] paths)
364364

365365
public PublishInfo GetChangesToPublish()
366366
{
367-
Change[] changes = GetChangesToPublishInternal();
367+
Change[] changes = GetSelectedChangesInternal();
368+
bool isFiltered = false;
369+
if (Toolbar.isLastShowRequestPartial)
370+
{
371+
isFiltered = true;
372+
}
373+
368374
return new PublishInfo()
369375
{
370376
changes = changes,
371-
filter = false
377+
filter = isFiltered
372378
};
373379
}
374380

Editor/Mono/Commands/GOCreationCommands.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ static void CreateEmptyChild(MenuCommand menuCommand)
5252
{
5353
var parent = menuCommand.context as GameObject;
5454
if (parent == null)
55-
parent = Selection.activeGameObject;
55+
{
56+
var activeGO = Selection.activeGameObject;
57+
if (activeGO != null && !EditorUtility.IsPersistent(activeGO))
58+
parent = activeGO;
59+
}
60+
5661
var go = ObjectFactory.CreateGameObject("GameObject");
5762
Place(go, parent);
5863
}

Editor/Mono/ContainerWindow.bindings.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ internal enum ShowMode
1212
{
1313
// Show as a normal window with max, min & close buttons.
1414
NormalWindow = 0,
15-
// Used for a popup menu and tooltip. On mac this means light shadow and no titlebar.
15+
// Used for a popup menu. On mac this means light shadow and no titlebar.
1616
PopupMenu = 1,
1717
// Utility window - floats above the app. Disappears when app loses focus.
1818
Utility = 2,
@@ -22,8 +22,8 @@ internal enum ShowMode
2222
MainWindow = 4,
2323
// Aux windows. The ones that close the moment you move the mouse out of them.
2424
AuxWindow = 5,
25-
// Like PopupMenu, but allows keyboard focus (e.g. AddComponentWindow)
26-
PopupMenuWithKeyboardFocus = 6
25+
// Like PopupMenu, but without keyboard focus
26+
Tooltip = 6
2727
}
2828

2929
//[StaticAccessor("ContainerWindowBindings", StaticAccessorType.DoubleColon)]

Editor/Mono/ContainerWindow.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,24 @@ internal void __internalAwake()
5959

6060
internal static bool IsPopup(ShowMode mode)
6161
{
62-
return (ShowMode.PopupMenu == mode || ShowMode.PopupMenuWithKeyboardFocus == mode);
62+
return (ShowMode.PopupMenu == mode);
6363
}
6464

6565
internal bool isPopup { get { return IsPopup((ShowMode)m_ShowMode); } }
6666

6767
internal void ShowPopup()
6868
{
69-
m_ShowMode = (int)ShowMode.PopupMenu;
69+
ShowPopupWithMode(ShowMode.PopupMenu);
70+
}
71+
72+
internal void ShowTooltip()
73+
{
74+
ShowPopupWithMode(ShowMode.Tooltip);
75+
}
76+
77+
internal void ShowPopupWithMode(ShowMode mode)
78+
{
79+
m_ShowMode = (int)mode;
7080
Internal_Show(m_PixelRect, m_ShowMode, m_MinSize, m_MaxSize);
7181
if (m_RootView)
7282
m_RootView.SetWindowRecurse(this);

Editor/Mono/EditorApplication.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ public static void DirtyHierarchyWindowSorting()
187187
// Global key up/down event that was not handled by anyone
188188
internal static CallbackFunction globalEventHandler;
189189

190+
// Returns true when the pressed keys are defined in the Trigger
191+
internal static Func<bool> doPressedKeysTriggerAnyShortcut;
192+
190193
// Windows were reordered
191194
internal static CallbackFunction windowsReordered;
192195

@@ -313,6 +316,14 @@ static void Internal_CallWindowsReordered()
313316
windowsReordered();
314317
}
315318

319+
[RequiredByNativeCode]
320+
static bool DoPressedKeysTriggerAnyShortcutHandler()
321+
{
322+
if (doPressedKeysTriggerAnyShortcut != null)
323+
return doPressedKeysTriggerAnyShortcut();
324+
return false;
325+
}
326+
316327
[RequiredByNativeCode]
317328
static void Internal_CallGlobalEventHandler()
318329
{

0 commit comments

Comments
 (0)