public static void ImportTMProPackage() { var version = Compatibility.GetTMProVersion(); var path = Utilites.GetAssetPath("TMProSupport" + version + "Package"); var interactive = IsTMProPrefabsInstalled(); Compatibility.ImportPackage(path, interactive); AssetDatabase.Refresh(); }
/// <summary> /// Set forced recompilation status to file with label. /// </summary> /// <param name="label">Label.</param> /// <param name="status">Status.</param> public static void SetStatus(string label, string status) { var path = Utilites.GetAssetPath(label + FileSuffix); if (path == null) { return; } File.WriteAllText(path, status); }
/// <summary> /// Get forced recompilation status from file with label. /// </summary> /// <param name="label">Label.</param> /// <returns>Status.</returns> public static string GetStatus(string label) { var path = Utilites.GetAssetPath(label + FileSuffix); if (path == null) { return(StatusInitial); } return(File.ReadAllText(path)); }
static bool TypeExists(string fileLabel) { var path = Utilites.GetAssetPath(fileLabel); var script = AssetDatabase.LoadAssetAtPath(path, typeof(MonoScript)) as MonoScript; if ((script == null) || (script.GetClass() != null)) { return(false); } return(true); }
public static void DisableDataBindSupport() { if (CanDisableDataBindSupport()) { var root = Path.GetDirectoryName(Utilites.GetAssetPath("ScriptsFolder")); var current_path = Utilites.GetAssetPath("DataBindFolder"); var new_path = root + "/Scripts/ThirdPartySupport/" + Path.GetFileName(current_path); if (current_path != new_path) { AssetDatabase.MoveAsset(current_path, new_path); } ScriptingDefineSymbols.Remove(DataBindSupport); } }
public static void EnableDataBindSupport() { if (CanEnableDataBindSupport()) { var root = Path.GetDirectoryName(Utilites.GetAssetPath("ScriptsFolder")); var current_path = Utilites.GetAssetPath("DataBindFolder"); var new_path = root + "/" + Path.GetFileName(current_path); if (current_path != new_path) { AssetDatabase.MoveAsset(current_path, new_path); } ScriptingDefineSymbols.Add(DataBindSupport); ScriptsRecompile.SetStatus("DataBind", ScriptsRecompile.StatusSymbolsAdded); } }
/// <summary> /// Remove text previously added to force recompile. /// </summary> /// <param name="label">Label.</param> /// <returns>True if text removed; otherwise false</returns> public static bool RemoveForceRecompileByLabel(string label) { var path = Utilites.GetAssetPath(label); if (path == null) { return(false); } if (Directory.Exists(path)) { RemoveForceRecompileFolder(path); } else { RemoveForceRecompileFile(path); } return(true); }