Skip to content

Commit d9eef20

Browse files
authored
Merge pull request #122 from FishingCactus/fix_create_prefab_tool
Fix CreatePrefab tool
2 parents e5baa84 + 5ec84c8 commit d9eef20

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [2.3.1] - 2025-04-04
4+
### Fixed
5+
- Path used in CreatePrefab is now relative to project folder.
6+
37
## [2.3.0] - 2024-07-25
48
### Fixed
59
- Add `OnDestroy` method to set `Singleton` static instance to null when object is destroyed, this fixes a memory leak when destroying singletons

Editor/CreateNewPrefab.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ PathSelection path_mode
4848
{
4949
destination_path = EditorUtility.OpenFolderPanel( "Destination Path :", PrefabCreationPath, "" );
5050

51+
if( destination_path.StartsWith( Application.dataPath ) )
52+
{
53+
destination_path = "Assets" + destination_path.Substring( Application.dataPath.Length );
54+
}
55+
5156
if( string.IsNullOrEmpty( destination_path )
5257
|| !AssetDatabase.IsValidFolder( destination_path )
5358
)
@@ -57,11 +62,6 @@ PathSelection path_mode
5762
return;
5863
}
5964

60-
if( destination_path.StartsWith( Application.dataPath ) )
61-
{
62-
destination_path = "Assets" + destination_path.Substring( Application.dataPath.Length );
63-
}
64-
6565
destination_path += "/";
6666

6767
EditorPrefs.SetString( PrefabPathLocalKey, destination_path );

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.fishingcactus.common-code",
3-
"version": "2.3.0",
3+
"version": "2.3.1",
44
"displayName": "FC - Common Code",
55
"description": "Code, Extensions and extra features for Fishing Cactus Games.",
66
"unity": "2020.3",

0 commit comments

Comments
 (0)