Skip to content

Commit 6db3e9d

Browse files
authored
Merge pull request #21 from badawe/feature/fix-mobile-builds
fix: mobile builds
2 parents 54b5384 + 2353077 commit 6db3e9d

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

CHANGELOG.MD

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.1.8]
8+
## Changed
9+
- Fixed mobile builds (using editor references on runtime files)
10+
711

812
## [1.1.7]
913
## Added
@@ -92,6 +96,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9296
## [Unreleased]
9397
- Add a setup wizzard for first time settings creation
9498

99+
[1.1.8]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.1.8
95100
[1.1.7]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.1.7
96101
[1.1.6]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.1.6
97102
[1.1.5]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.1.5

Scripts/Runtime/ScriptableObjectCollectionSettings.cs

+11-2
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,19 @@ private class CollectionToSettings
4040

4141
[SerializeField]
4242
private UnityEditor.DefaultAsset defaultGeneratedCodeFolder;
43-
44-
private string DefaultGeneratedCodeFolder => UnityEditor.AssetDatabase.GetAssetPath(defaultGeneratedCodeFolder);
4543
#pragma warning restore 0649
4644
#endif
45+
46+
private string DefaultGeneratedCodeFolder
47+
{
48+
get
49+
{
50+
#if UNITY_EDITOR
51+
return UnityEditor.AssetDatabase.GetAssetPath(defaultGeneratedCodeFolder);
52+
#endif
53+
return string.Empty;
54+
}
55+
}
4756

4857
[SerializeField]
4958
private GeneratedStaticFileType defaultGenerator = GeneratedStaticFileType.DirectAccess;

Scripts/Runtime/Utils/PathUtility.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using UnityEditor;
21
using UnityEngine;
32

43
namespace System.IO
@@ -14,9 +13,12 @@ public static string GetRelativePath(string path)
1413

1514
public static bool IsObjectDeeperThanObject(Object childObject, Object parentObject)
1615
{
17-
Uri childPath = new Uri(Path.GetFullPath(AssetDatabase.GetAssetPath((UnityEngine.Object) childObject)));
18-
Uri parentPath = new Uri(Path.GetFullPath(AssetDatabase.GetAssetPath((UnityEngine.Object) parentObject)));
16+
#if UNITY_EDITOR
17+
Uri childPath = new Uri(Path.GetFullPath(UnityEditor.AssetDatabase.GetAssetPath((UnityEngine.Object) childObject)));
18+
Uri parentPath = new Uri(Path.GetFullPath(UnityEditor.AssetDatabase.GetAssetPath((UnityEngine.Object) parentObject)));
1919
return parentPath.IsBaseOf(childPath);
20+
#endif
21+
return false;
2022
}
2123
}
2224
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.brunomikoski.scriptableobjectcollection",
33
"displayName": "Scriptable Object Collection",
4-
"version": "1.1.7",
4+
"version": "1.1.8",
55
"unity": "2018.4",
66
"description": "Scriptable Object Collection",
77
"keywords": [

0 commit comments

Comments
 (0)