Initial commit

This commit is contained in:
AbstractConcept 2022-09-13 00:36:34 -05:00
commit 3c7cc0c973
8391 changed files with 704313 additions and 0 deletions

View file

@ -0,0 +1,14 @@
using System;
namespace UnityEditor.Timeline
{
[AttributeUsage(AttributeTargets.Class)]
class ActiveInModeAttribute : Attribute
{
public TimelineModes modes { get; private set; }
public ActiveInModeAttribute(TimelineModes timelineModes)
{
modes = timelineModes;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3a784fb721704576b3b4c3a7f3324264
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,37 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UnityEditor.Timeline
{
/// <summary>
/// Used to indicate path and priority of classes that are auto added to the menu
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
internal class MenuEntryAttribute : Attribute
{
public readonly int priority;
public readonly string name;
public readonly string subMenuPath;
public MenuEntryAttribute(string path, int priority)
{
path = path ?? string.Empty;
path = L10n.Tr(path);
this.priority = priority;
int index = path.LastIndexOf('/');
if (index >= 0)
{
name = (index == path.Length - 1) ? string.Empty : path.Substring(index + 1);
subMenuPath = path.Substring(0, index + 1);
}
else
{
name = path;
subMenuPath = string.Empty;
}
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e6870f707805737429a719f575621041
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,71 @@
using System;
using System.Linq;
using UnityEditor.ShortcutManagement;
using UnityEngine;
namespace UnityEditor.Timeline
{
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
class ShortcutAttribute : Attribute
{
readonly string m_Identifier;
readonly string m_EventCommandName;
readonly string m_MenuShortcut;
public ShortcutAttribute(string identifier)
{
m_Identifier = identifier;
m_EventCommandName = identifier;
}
public ShortcutAttribute(string identifier, string commandName)
{
m_Identifier = identifier;
m_EventCommandName = commandName;
}
public ShortcutAttribute(KeyCode key, ShortcutModifiers modifiers = ShortcutModifiers.None)
{
m_MenuShortcut = new KeyCombination(key, modifiers).ToMenuShortcutString();
}
public string GetMenuShortcut()
{
if (m_MenuShortcut != null)
return m_MenuShortcut;
//find the mapped shortcut in the shortcut manager
var shortcut = ShortcutIntegration.instance.directory.FindShortcutEntry(m_Identifier);
if (shortcut != null && shortcut.combinations.Any())
{
return KeyCombination.SequenceToMenuString(shortcut.combinations);
}
return string.Empty;
}
public bool MatchesEvent(Event evt)
{
if (evt.type != EventType.ExecuteCommand)
return false;
return evt.commandName == m_EventCommandName;
}
}
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
class ShortcutPlatformOverrideAttribute : ShortcutAttribute
{
RuntimePlatform platform { get; }
public ShortcutPlatformOverrideAttribute(RuntimePlatform platform, KeyCode key, ShortcutModifiers modifiers = ShortcutModifiers.None)
: base(key, modifiers)
{
this.platform = platform;
}
public bool MatchesCurrentPlatform()
{
return Application.platform == platform;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c50a694a8232898498c1cdd47ce9873f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: