-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## [1.2.2] - 2021-04-21 ### Fixes & Improvements. - Fix error 'Unable to find required resource at Fonts/consola.ttf' when using logcat package with 2021.2. - Provide user friendly message when NDK directory is incorrect or is not set. - The NDK presence will only be checked when it's actually needed, for ex., when resolving stacktraces. - Don't show Add/Remove Tag menu item, if tag is empty. - Don't show Filter By Process Id menu item, if process id is invalid. - When using AutoRun, logcat will appear automatically if you're building only for Android, previously it would appear for any platform, which is undesired.
- Loading branch information
Unity Technologies
committed
Apr 21, 2021
1 parent
817c1b2
commit 0f42611
Showing
9 changed files
with
217 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using NUnit.Framework; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace Unity.Android.Logcat | ||
{ | ||
internal enum ContextMenuItem | ||
{ | ||
None, | ||
Copy, | ||
SelectAll, | ||
SaveSelection, | ||
AddTag, | ||
RemoveTag, | ||
FilterByProcessId | ||
} | ||
|
||
class AndroidContextMenu | ||
{ | ||
internal class MenuItemData | ||
{ | ||
public ContextMenuItem Item { get; } | ||
public string Name { get; } | ||
|
||
public MenuItemData(ContextMenuItem item, string name) | ||
{ | ||
Item = item; | ||
Name = name; | ||
} | ||
} | ||
|
||
public object UserData { set; get; } | ||
|
||
private List<MenuItemData> m_Items = new List<MenuItemData>(); | ||
|
||
public void Add(ContextMenuItem item, string name) | ||
{ | ||
m_Items.Add(new MenuItemData(item, name)); | ||
} | ||
|
||
public void AddSplitter() | ||
{ | ||
Add(ContextMenuItem.None, string.Empty); | ||
} | ||
|
||
public string[] Names => m_Items.Select(i => i.Name).ToArray(); | ||
|
||
public MenuItemData GetItemAt(int selected) | ||
{ | ||
if (selected < 0 || selected > m_Items.Count - 1) | ||
return null; | ||
return m_Items[selected]; | ||
} | ||
|
||
public void Show(Vector2 mousePosition, EditorUtility.SelectMenuItemFunction callback) | ||
{ | ||
var enabled = Enumerable.Repeat(true, Names.Length).ToArray(); | ||
var separator = new bool[Names.Length]; | ||
EditorUtility.DisplayCustomMenuWithSeparators(new Rect(mousePosition.x, mousePosition.y, 0, 0), | ||
Names, | ||
enabled, | ||
separator, | ||
null, | ||
callback, | ||
this); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.