Class CoreEditorUtility
Provides a set of various utility functions for the AlchemyBow.Core editor windows.
Inheritance
Namespace: AlchemyBow.Core.Editor.Utilities
Assembly: AlchemyBow.Core.Editor.dll
Syntax
public static class CoreEditorUtility
Methods
AssetsPathToSystemPath(String, out String)
Converts a project local path (starting with "Assets") to an absolute system path.
Declaration
public static bool AssetsPathToSystemPath(string assetsPath, out string systemPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | assetsPath | A project local path (starting with "Assets"). |
System.String | systemPath | The result absolute system path. |
Returns
Type | Description |
---|---|
System.Boolean |
|
CheckIfCanCreateFilesInFolderAndLogErrors(String, String[])
Checks if files with the specified names can be created in the specified folder (inside the 'Assets' folder) and logs errors to the console.
Declaration
public static bool CheckIfCanCreateFilesInFolderAndLogErrors(string folder, params string[] fileNames)
Parameters
Type | Name | Description |
---|---|---|
System.String | folder | The folder (inside the 'Assets' folder). |
System.String[] | fileNames | The file names. |
Returns
Type | Description |
---|---|
System.Boolean |
|
EnsureOnlyForwardSlashes(String)
Replaces all backslashes with forward slashes.
Declaration
public static string EnsureOnlyForwardSlashes(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The initial value. |
Returns
Type | Description |
---|---|
System.String | A value with all backslashes replaced by forward slashes. |
FindAllCoreControllerTypes(Type)
Finds the types of all non-abstract CoreController
subclasses for the specified CoreProjectContext
type.
Declaration
public static Type[] FindAllCoreControllerTypes(Type projectContextType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | projectContextType | The project context type used to filter the result. |
Returns
Type | Description |
---|---|
System.Type[] | The types of all non-abstract |
FindAllCoreProjectContextTypes()
Finds the types of all non-abstract CoreProjectContext
subclasses.
Declaration
public static Type[] FindAllCoreProjectContextTypes()
Returns
Type | Description |
---|---|
System.Type[] | The types of all non-abstract |
FocusProjectWindowAndPingObject(Object)
Focuses the project window and pings the specified object.
Declaration
public static void FocusProjectWindowAndPingObject(Object obj)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Object | obj | The object to ping. |
FolderField(String, String)
Makes a field for selecting folders inside the 'Assets' folder.
Declaration
public static string FolderField(string label, string currentFolder)
Parameters
Type | Name | Description |
---|---|---|
System.String | label | The label to display in front of the field. |
System.String | currentFolder | The current folder. |
Returns
Type | Description |
---|---|
System.String | The folder selected by user if modified and valid; Otherwise, the current folder. |
GetAllCoreFolders()
Gets all 'Assets/.../Resources/Core' folders in the project.
Declaration
public static string[] GetAllCoreFolders()
Returns
Type | Description |
---|---|
System.String[] | An array of 'Assets/.../Resources/Core' folders. |
GetAllResourcesFolders()
Gets all 'Assets/.../Resources' folders in the project.
Declaration
public static string[] GetAllResourcesFolders()
Returns
Type | Description |
---|---|
System.String[] | An array of 'Assets/.../Resources' folders. |
GetCoreProjectContextResourcesPath(Type)
Gets the resource path for the specified core project context type.
Declaration
public static string GetCoreProjectContextResourcesPath(Type coreProjectContextType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | coreProjectContextType | The core project context type. |
Returns
Type | Description |
---|---|
System.String | The resource path for the specified core project context type. |
GetProjectName()
Determines the name of the Unity project.
Declaration
public static string GetProjectName()
Returns
Type | Description |
---|---|
System.String | The name of the Unity project. |
IsValidClassName(String)
Validates the class name according to the (English) identifier naming rules.
Declaration
public static bool IsValidClassName(string className)
Parameters
Type | Name | Description |
---|---|---|
System.String | className | The class name. |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsValidNamespaceName(String)
Validates the namespace name according to the (English) identifier naming rules.
Declaration
public static bool IsValidNamespaceName(string namespaceName)
Parameters
Type | Name | Description |
---|---|---|
System.String | namespaceName | The namespace name. |
Returns
Type | Description |
---|---|
System.Boolean |
|
LoadCoreProjectContextFromResources(Type)
Loads the prefab for the specified core project context type from resources.
Declaration
public static GameObject LoadCoreProjectContextFromResources(Type coreProjectContextType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | coreProjectContextType | The core project context type. |
Returns
Type | Description |
---|---|
UnityEngine.GameObject | The prefab if it exists; Otherwise, |
SystemPathToAssetsPath(String, out String)
Converts an absolute system path to a project local path (starting with "Assets").
Declaration
public static bool SystemPathToAssetsPath(string systemPath, out string assetsPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | systemPath | An absolute system path. |
System.String | assetsPath | The result project local path (starting with "Assets"). |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryGetCoreFolderAt(String)
Attempts to find or create the best match for '.../Resources/Core' in the specified folder.
Declaration
public static string TryGetCoreFolderAt(string parentFolder)
Parameters
Type | Name | Description |
---|---|---|
System.String | parentFolder | The parent folder for '.../Resources/Core'. |
Returns
Type | Description |
---|---|
System.String | The folder if succeeded; Otherwise, |
TryPingScript(Type)
Attempts to ping a mono script for the specified type.
Declaration
public static bool TryPingScript(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type. |
Returns
Type | Description |
---|---|
System.Boolean |
|