Skip to content

Commit

Permalink
Merge pull request #21 from badawe/feature/fix-mobile-builds
Browse files Browse the repository at this point in the history
fix: mobile builds
  • Loading branch information
brunomikoski authored Aug 4, 2020
2 parents 54b5384 + 2353077 commit 6db3e9d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.8]
## Changed
- Fixed mobile builds (using editor references on runtime files)


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

[1.1.8]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.1.8
[1.1.7]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.1.7
[1.1.6]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.1.6
[1.1.5]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.1.5
Expand Down
13 changes: 11 additions & 2 deletions Scripts/Runtime/ScriptableObjectCollectionSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,19 @@ private class CollectionToSettings

[SerializeField]
private UnityEditor.DefaultAsset defaultGeneratedCodeFolder;

private string DefaultGeneratedCodeFolder => UnityEditor.AssetDatabase.GetAssetPath(defaultGeneratedCodeFolder);
#pragma warning restore 0649
#endif

private string DefaultGeneratedCodeFolder
{
get
{
#if UNITY_EDITOR
return UnityEditor.AssetDatabase.GetAssetPath(defaultGeneratedCodeFolder);
#endif
return string.Empty;
}
}

[SerializeField]
private GeneratedStaticFileType defaultGenerator = GeneratedStaticFileType.DirectAccess;
Expand Down
8 changes: 5 additions & 3 deletions Scripts/Runtime/Utils/PathUtility.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using UnityEditor;
using UnityEngine;

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

public static bool IsObjectDeeperThanObject(Object childObject, Object parentObject)
{
Uri childPath = new Uri(Path.GetFullPath(AssetDatabase.GetAssetPath((UnityEngine.Object) childObject)));
Uri parentPath = new Uri(Path.GetFullPath(AssetDatabase.GetAssetPath((UnityEngine.Object) parentObject)));
#if UNITY_EDITOR
Uri childPath = new Uri(Path.GetFullPath(UnityEditor.AssetDatabase.GetAssetPath((UnityEngine.Object) childObject)));
Uri parentPath = new Uri(Path.GetFullPath(UnityEditor.AssetDatabase.GetAssetPath((UnityEngine.Object) parentObject)));
return parentPath.IsBaseOf(childPath);
#endif
return false;
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.brunomikoski.scriptableobjectcollection",
"displayName": "Scriptable Object Collection",
"version": "1.1.7",
"version": "1.1.8",
"unity": "2018.4",
"description": "Scriptable Object Collection",
"keywords": [
Expand Down

0 comments on commit 6db3e9d

Please sign in to comment.