-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added script for exporting the package. - Updated some tooltips.
- Loading branch information
Jan Discart
committed
Sep 4, 2021
1 parent
63b5488
commit 1112196
Showing
4 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.IO; | ||
using UnityEngine; | ||
using UnityEditor; | ||
|
||
public static class ExportMouseEventsPackage | ||
{ | ||
private const string ExportPackageDirectoryKey = "ImpossibleOdds_Export_Path"; | ||
private const string ExportPackageNameKey = "ImpossibleOdds_Export_MouseEvents_Filename"; | ||
|
||
private const string PackageExtension = "unitypackage"; | ||
|
||
[MenuItem("Assets/Impossible Odds/Export/Mouse Events")] | ||
private static void ExportToolkit() | ||
{ | ||
string path = EditorPrefs.GetString(ExportPackageDirectoryKey, Application.dataPath); | ||
string name = EditorPrefs.GetString(ExportPackageNameKey, "Impossible Odds Mouse Events"); | ||
string fullPath = EditorUtility.SaveFilePanel("Export Impossible Odds Mouse Events", path, name, PackageExtension); | ||
|
||
if (string.IsNullOrEmpty(fullPath)) | ||
{ | ||
return; | ||
} | ||
|
||
FileInfo fileInfo = new FileInfo(fullPath); | ||
path = fileInfo.DirectoryName; | ||
name = Path.GetFileNameWithoutExtension(fileInfo.Name); | ||
EditorPrefs.SetString(ExportPackageDirectoryKey, path); | ||
EditorPrefs.SetString(ExportPackageNameKey, name); | ||
|
||
AssetDatabase.ExportPackage("Assets/Impossible Odds", fullPath, ExportPackageOptions.Recurse); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters