Skip to content

Commit fbd61e6

Browse files
moved files that are now required at runtime outside of the editor folder to address build time errors
1 parent 4073f34 commit fbd61e6

9 files changed

+36
-13
lines changed

Packages/Ink/Editor/Core/InkEditorUtils.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@ public static bool IsInkFile(string path) {
270270
/// TODO - If the editor is inky, this code should load the master file, but immediately show the correct child file at the correct line.
271271
/// </summary>
272272
public static void OpenInEditor (InkFile inkFile, InkCompilerLog log) {
273-
var targetFilePath = log.GetAbsoluteFilePath(inkFile);
273+
var assetPath = AssetDatabase.GetAssetPath(inkFile);
274+
var targetFilePath = InkEditorUtils.UnityRelativeToAbsolutePath(assetPath);
275+
274276
// EditorUtility.OpenWithDefaultApp(targetFilePath);
275277
AssetDatabase.OpenAsset(inkFile, log.lineNumber);
276278
// Unity.CodeEditor.CodeEditor.OSOpenFile();

Packages/Ink/Editor/InkEditor.asmdef

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"name": "InkEditor",
3+
"rootNamespace": "",
34
"references": [
4-
"Ink-Libraries"
5+
"Ink-Libraries",
6+
"Ink"
57
],
6-
"optionalUnityReferences": [],
78
"includePlatforms": [
89
"Editor"
910
],
@@ -12,5 +13,7 @@
1213
"overrideReferences": false,
1314
"precompiledReferences": [],
1415
"autoReferenced": true,
15-
"defineConstraints": []
16+
"defineConstraints": [],
17+
"versionDefines": [],
18+
"noEngineReferences": false
1619
}

Packages/Ink/Editor/Core/Ink Library.meta renamed to Packages/Ink/Scripts.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/Ink/Scripts/Ink.asmdef

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "Ink",
3+
"rootNamespace": "",
4+
"references": [
5+
"GUID:58bed0e7c5306824586d7eda03609289"
6+
],
7+
"includePlatforms": [],
8+
"excludePlatforms": [],
9+
"allowUnsafeCode": false,
10+
"overrideReferences": false,
11+
"precompiledReferences": [],
12+
"autoReferenced": true,
13+
"defineConstraints": [],
14+
"versionDefines": [],
15+
"noEngineReferences": false
16+
}

Packages/Ink/Scripts/Ink.asmdef.meta

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/Ink/Editor/Core/Ink Library/InkCompilerLog.cs renamed to Packages/Ink/Scripts/InkCompilerLog.cs

-5
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ public InkCompilerLog (Ink.ErrorType type, string content, string relativeFilePa
1818
this.lineNumber = lineNumber;
1919
}
2020

21-
public string GetAbsoluteFilePath (InkFile masterInkFile) {
22-
var assetPath = AssetDatabase.GetAssetPath(masterInkFile);
23-
return InkEditorUtils.UnityRelativeToAbsolutePath(assetPath);
24-
}
25-
2621
public static bool TryParse (string rawLog, out InkCompilerLog log) {
2722
var match = _errorRegex.Match(rawLog);
2823
if (match.Success) {

Packages/Ink/Editor/Core/Ink Library/InkFile.cs renamed to Packages/Ink/Scripts/InkFile.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.IO;
44
using System.Text;
55
using System.Text.RegularExpressions;
6-
using UnityEditor;
76
using UnityEngine;
87

98
namespace Ink.UnityIntegration {
@@ -41,12 +40,13 @@ public class InkFile : ScriptableObject {
4140
public List<InkCompilerLog> todos = new List<InkCompilerLog>();
4241
public bool hasTodos => todos.Count > 0;
4342

43+
#if UNITY_EDITOR
4444
/// <summary>
4545
/// Gets the last edit date of the file.
4646
/// </summary>
4747
/// <value>The last edit date of the file.</value>
48-
public DateTime lastEditDate => File.GetLastWriteTime(AssetDatabase.GetAssetPath(this));
49-
48+
public DateTime lastEditDate => File.GetLastWriteTime(UnityEditor.AssetDatabase.GetAssetPath(this));
49+
#endif
5050
/// <summary>
5151
/// Invoked by <see cref="InkImporter"/> to initialize the ScriptableObject. This is not intended to be used elsewhere.
5252
/// </summary>

0 commit comments

Comments
 (0)