PO/Library/Artifacts/8d/8dc813dbc105cf19d5ab7835125...

129 lines
8.7 KiB
Plaintext
Raw Normal View History

2022-01-12 10:06:03 +03:00
<0F>"<22>2019.4.19f1<00><><EFBFBD><EFBFBD> <00><>f<EFBFBD><66>!<21>5<>9<EFBFBD>4Q<0E><>B<00>7<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><><00> E<00> <00><00>#<00>.<00>,<00>5a<00> <00><00>#<00>.<00>,<00><00><00>r<00> <00><00># <00>.<00>,
<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD> <01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00> Q<00>j<00><00><00>J<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><00><00>j<00><><EFBFBD><EFBFBD><EFBFBD><00>\<00><00><><EFBFBD><EFBFBD><EFBFBD><00>H<00>r<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>H<00>w<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>H<00><><00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>y<00>
<00> <00><00>#!<00>.<00>,"<00><00><><00><><EFBFBD><EFBFBD>#@1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>$<00><00><00>%.<00>j<00>&<00><00><><00><><EFBFBD><EFBFBD>'<00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>(<00><00><00><00>)<00>j<00><><EFBFBD><EFBFBD><EFBFBD>*<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD>+<00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>,@<00><00><00>-Q<00>j<00>.y<00>
<00> /<00><00>#0<00>.<00>,1<00> <00><>2@<00><00><> 3@<00><00>#4<00>.<00>,5<00>H<00><><00><><EFBFBD><EFBFBD>6<01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>7@<00><00><00>8Q<00>j<00>9H<00><><00><><EFBFBD><EFBFBD>:<01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>;@<00><00><00><Q<00>j<00>=H<00><><00><><EFBFBD><EFBFBD>><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>?@<00><00><00>@Q<00>j<00>AMonoImporterPPtr<EditorExtension>m_FileIDm_PathIDPPtr<PrefabInstance>m_ExternalObjectsSourceAssetIdentifiertypeassemblynamem_UsedFileIDsm_DefaultReferencesexecutionOrdericonm_UserDatam_AssetBundleNamem_AssetBundleVariants<00><><EFBFBD>G<EFBFBD><47>܏Z56<35>:!@i<>J*<00><00>7<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><><00>E<00> <00><00><00>.<00><00>(a<00> <00><00><00>.<00><00><00><00>r<00> <00><00> <00>.<00>
<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD> <01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00> Q<00>j<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00><00><00>=<00><><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD><01><00><00><00><00>j<00><><EFBFBD><EFBFBD><EFBFBD><01>H<00><><00><><EFBFBD><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>y<00>
<00> <00><00><00>.<00><00>y<00>Q <00><00><00>.<00> <00><00><00>X!H<00>i<00><><EFBFBD><EFBFBD>"<10>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>#@<00><00><00>$Q<00>j<00>%H<00>u<00><><EFBFBD><EFBFBD>&<10>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>'@<00><00><00>(Q<00>j<00>)PPtr<EditorExtension>m_FileIDm_PathIDPPtr<PrefabInstance>m_DefaultReferencesm_Iconm_ExecutionOrderm_ClassNamem_Namespace\<00>y<EFBFBD>`X<00>y<EFBFBD>IAction<00>using System;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using UnityEditor.ShortcutManagement;
using UnityEngine;
namespace UnityEditor.Timeline.Actions
{
/// interface indicating an Action class
interface IAction {}
/// extension methods for IActions
static class ActionExtensions
{
const string kActionPostFix = "Action";
public static string GetUndoName(this IAction action)
{
if (action == null)
throw new ArgumentNullException(nameof(action));
var attr = action.GetType().GetCustomAttribute<ApplyDefaultUndoAttribute>(false);
if (attr != null && !string.IsNullOrWhiteSpace(attr.UndoTitle))
return attr.UndoTitle;
return action.GetDisplayName();
}
public static string GetMenuEntryName(this IAction action)
{
var menuAction = action as IMenuName;
if (menuAction != null && !string.IsNullOrWhiteSpace(menuAction.menuName))
return menuAction.menuName;
var attr = action.GetType().GetCustomAttribute<MenuEntryAttribute>(false);
if (attr != null && !string.IsNullOrWhiteSpace(attr.name))
return attr.name;
return action.GetDisplayName();
}
public static string GetDisplayName(this IAction action)
{
if (action == null)
throw new ArgumentNullException(nameof(action));
var attr = action.GetType().GetCustomAttribute<DisplayNameAttribute>(false);
if (attr != null && !string.IsNullOrEmpty(attr.DisplayName))
return attr.DisplayName;
var name = action.GetType().Name;
if (name.EndsWith(kActionPostFix))
return ObjectNames.NicifyVariableName(name.Substring(0, name.Length - kActionPostFix.Length));
return ObjectNames.NicifyVariableName(name);
}
public static bool HasAutoUndo(this IAction action)
{
return action != null && ActionManager.ActionsWithAutoUndo.Contains(action.GetType());
}
public static bool IsChecked(this IAction action)
{
return (action is IMenuChecked menuAction) && menuAction.isChecked;
}
public static bool IsActionActiveInMode(this IAction action, TimelineModes mode)
{
var attr = action.GetType().GetCustomAttribute<ActiveInModeAttribute>(true);
return attr != null && (attr.modes & mode) != 0;
}
public static string GetShortcut(this IAction action)
{
if (action == null)
throw new ArgumentNullException(nameof(action));
var shortcutAttribute = GetShortcutAttributeForAction(action);
var shortCut = shortcutAttribute == null ? string.Empty : shortcutAttribute.GetMenuShortcut();
if (string.IsNullOrWhiteSpace(shortCut))
{
//Check if there is a static method with attribute
var customShortcutMethod = action.GetType().GetMethods().FirstOrDefault(m => m.GetCustomAttribute<TimelineShortcutAttribute>(true) != null);
if (customShortcutMethod != null)
{
var shortcutId = customShortcutMethod.GetCustomAttribute<TimelineShortcutAttribute>(true).identifier;
var shortcut = ShortcutIntegration.instance.directory.FindShortcutEntry(shortcutId);
if (shortcut != null && shortcut.combinations.Any())
shortCut = KeyCombination.SequenceToMenuString(shortcut.combinations);
}
}
return shortCut;
}
static ShortcutAttribute GetShortcutAttributeForAction(this IAction action)
{
if (action == null)
throw new ArgumentNullException(nameof(action));
var shortcutAttributes = action.GetType()
.GetCustomAttributes(typeof(ShortcutAttribute), true)
.Cast<ShortcutAttribute>();
foreach (var shortcutAttribute in shortcutAttributes)
{
if (shortcutAttribute is ShortcutPlatformOverrideAttribute shortcutOverride)
{
if (shortcutOverride.MatchesCurrentPlatform())
return shortcutOverride;
}
else
{
return shortcutAttribute;
}
}
return null;
}
}
}
IAction