Contain some helper functions for when working with Unity editor related scripts.
More...
|
static ScriptableObject | LoadOrCreateAsset< T > (string fn, string prettyName) |
| Loads asset at given path and filename (fn), else create it. Pretty name will be shown to the user in a popup when asking if the asset may be created. Set prettyName = null to have it silently create the asset. More...
|
|
static GameObject | CreatePrefab (string type, string name, string fn) |
| Creates a new prefab and adds a component to it. More...
|
|
static GameObject | CreatePrefab< T > (string name, string fn) |
| Creates a new prefab and adds component of type T to it. More...
|
|
static GameObject | LoadOrCreatePrefab< T > (string name, string fn) |
| Loads a prefab. Creates the prefab if it does not exist. Makes sure that component T is on it. More...
|
|
static GameObject | CopyPrefab (string prefabFn, string targetFn) |
|
static void | DeletePrefab (GameObject fab) |
|
static List< T > | FindPrefabsOfTypeAll< T > (string progressbarTitle, string progressbarInfo) |
| Returns a list of prefabs of given type More...
|
|
static List< T > | FindPrefabsOfTypeAll< T > (string progressbarTitle, string progressbarInfo, string underFolder) |
| Returns a list of prefabs of given type More...
|
|
static void | RegisterDataPathChangeListener (GeneralCallback callback) |
|
static void | ChangeDataPath (ref string newPath, ref string prevPath) |
|
static string | PackagesPathStart () |
| Will return a path relative to where the package path starts. It is assumed that plyCommonEditor.dll is in /plyCommon/Editor/. More...
|
|
static string | PackagesRelativePathStart () |
| Uses PackagesPathStart() to get the path but will return the 'Assets/.../' relative path rather than the full path. More...
|
|
static string | ProjectRelativePath (string fullPath) |
| Return a relative path from a full path, or null if given path does not lead to a file in this project's Assets folder. Relative paths starts with 'Assets/'. More...
|
|
static string | ToAssetsRelativePath (string relativePath) |
| Removes the starting 'Assets/' from a relative path. More...
|
|
static string | ToRelativePath (string fullPath) |
| Convert Full Path to Relative Path that starts with "Assets/" More...
|
|
static bool | RelativeFileExist (string filePath) |
| Return true if the file exist (filePath should start with 'Assets') More...
|
|
static bool | RelativePathExist (string path) |
| Return true if the path exist (path should start with 'Assets') More...
|
|
static string | GetProjectName () |
| Get project name via the project's folder name. More...
|
|
static string | GetFileName (string path) |
| Returns file name from path. More...
|
|
static string | RemoveFileExt (string fn) |
| Removes the extension from the file name. More...
|
|
static string | GetFolder (string fn) |
| Removes the file.ext form the path and return only folder. More...
|
|
static void | CheckPath (string path) |
| Checks that the path exist. Do not send a path that includes a file name. Path should start at 'Assets'. More...
|
|
static string | MoveContents (string from, string to) |
| Moves contents of 'from' path to 'to' path. Returns error message if failed, else null. Path should start at 'Assets'. More...
|
|
static string | SceneNameFromPath (string path) |
| Return only the name of the scene after removing path and '.unity' part. More...
|
|
static string | FullPathFromPattern (string pattern) |
| Looks for the specified path to file pattern in the full project path and return full path up to the file, if found. Return null if not found. More...
|
|
static string | CheckDataPath (string parentPath, string newPath) |
| Check if the newPath exist. If it does not exist it will be created. newPath must be direct child folder of parentPath. More...
|
|
static Color | EdPrefs_GetColor (string key, Color col) |
| Read saved colour value from EditorPrefs. More...
|
|
static void | EdPrefs_SetColor (string key, Color col) |
| Write colour value to EditorPrefs. More...
|
|
static GameObject | CreateGameObjectInSceneView (string name, Vector3 offset, bool checkColliders, int mask) |
|
static GameObject | CreateGameObjectInSceneView (string name, Vector3 offset, bool checkColliders, int mask, GameObject prefab) |
| Creates new GameObject and try to place it around where scene view camera is looking. More...
|
|
static Vector3 | GetCreatePositionInSceneView (Vector3 offset, bool checkColliders, int mask) |
| Return a position that a new object can be created at More...
|
|
static void | PeakScriptableObject (string fn) |
|
static string | BuildLinkFileData (bool delOldFile, List< System.Type > usedTypes) |
|
static void | PlayAudioClip (AudioClip clip) |
| Play audio clip in editor. More...
|
|
static void | StopAllAudioClips () |
| Stops all audio clips playing in editor. More...
|
|
static GUIContent | IconContent (string name, string tooltip) |
| Created a GUIContent object that is an icon and tooltip. The icon is retrieved by looking up the . This is a wrapper that expose UnityEditor.EditorGUIUtility.IconContent() More...
|
|
static float | EditorGUIIndent () |
| Get the pixel size of an indent More...
|
|
static Texture2D | LoadIcon (string iconName) |
| load internal (Unity Editor) icon More...
|
|
static void | SetIconForObject (Object obj, Texture2D icon) |
| set the icon of an object. as seen in inspector and on gizmo. More...
|
|
static void | GetIconForObject (Object obj) |
| get the icon of an object. More...
|
|
static void | RepaintInspector (System.Type t) |
| fore an inspector to repaint if it is active More...
|
|
Contain some helper functions for when working with Unity editor related scripts.