Class TypeExtensions
Namespace: Aspid.FastTools.Types.Editors
Assembly: Aspid.FastTools.Editor.dll
Provides extension methods for locating and opening the MonoScript defining a
Type.
public static class TypeExtensions
Inheritance
Methods
FindMonoScript(Type)
Searches script assets for a declaration of type.
public static MonoScript FindMonoScript(this Type type)
Parameters
type Type
The type to locate, or null for no match.
Returns
MonoScript
The matching script asset; otherwise, null if no declaration is found.
Remarks
Text matching is limited to assets matching the type name and, for nested types, the declaring type's script.
Check GetClass before assigning the result to a component's m_Script property.
OpenInScriptEditor(Type)
Opens the script defining type at its declaration line.
public static void OpenInScriptEditor(this Type type)
Parameters
type Type
The type whose script to open.
Remarks
A type that ships with the Unity Editor has no script in the project and opens its API reference page
instead: a UnityEngine, UnityEditor or Unity type its online Scripting API page for
the running Editor version, a System or Microsoft type its .NET API page. Logs a warning when
neither exists;
a null type is ignored.