Skip to content

Commit 4073f34

Browse files
committed
updated docs + comments
1 parent 73fe62a commit 4073f34

File tree

3 files changed

+10
-24
lines changed

3 files changed

+10
-24
lines changed

Packages/Ink/Editor/Core/Ink Library/InkFile.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
using UnityEngine;
88

99
namespace Ink.UnityIntegration {
10-
// Helper class for ink files that maintains INCLUDE connections between ink files
10+
/// <summary>
11+
/// ScriptableObject that serves as the imported version of .ink files.
12+
/// </summary>
1113
[Serializable]
1214
public class InkFile : ScriptableObject {
13-
// Ink version. This should really come from the core ink code.
15+
// TODO: Ink version. This should really come from the core ink code.
1416
public static System.Version inkVersionCurrent = new System.Version(1,2,0);
1517
public static System.Version unityIntegrationVersionCurrent = new System.Version(1,2,1);
1618

Packages/Ink/Editor/Core/InkImporter.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
using UnityEditor;
66
using Ink;
77

8+
/// <summary>
9+
/// Automatically compiles .ink assets each time they are imported, and creates an InkFile asset.
10+
/// </summary>
811
[ScriptedImporter(1, "ink")]
912
public class InkImporter : ScriptedImporter
1013
{
1114
public override void OnImportAsset(AssetImportContext ctx)
1215
{
13-
1416
var inkFile = ScriptableObject.CreateInstance<InkFile>();
1517
var absolutePath = InkEditorUtils.UnityRelativeToAbsolutePath(ctx.assetPath);
1618
var inputString = File.ReadAllText(ctx.assetPath);

README.md

+3-21
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This Unity package allows you to integrate inkle's [ink narrative scripting lang
88

99
- **ink player**: Provides a powerful [Ink Player Window](https://github.com/inkle/ink-unity-integration/blob/master/Documentation/InkPlayerWindow.md) for playing and debugging stories.
1010

11-
- **Auto compilation**: Instantly creates and updates a JSON story file when a `.ink` is updated.
11+
- **Auto compilation**: Instantly creates compiles story file when a `.ink` is updated.
1212

1313
- **Inspector tools**: Provides an icon for ink files, and a custom inspector that provides information about a file.
1414

@@ -77,18 +77,8 @@ To keep up to date with the latest news about ink [sign up for the mailing list]
7777

7878
## Compilation
7979

80-
Ink files must be compiled to JSON before they can be used in-game.
81-
**This package compiles all edited ink files automatically.**
82-
By default, compiled files are created next to their ink file.
83-
84-
### Editor Compilation
85-
This package provides tools to automate this process when a .ink file is edited.
86-
87-
**Disabling auto-compilation**: You might want to have manual control over ink compilation. If this is the case, you can disable "Compile ink automatically" in the InkSettings file or delete the InkPostProcessor class.
88-
89-
**Manual compilation**: If you have disabled auto-compilation, you can manually compile all ink files using the **Assets > Recompile Ink** menu item, individually via the inspector of an ink file, or via code using InkCompiler.CompileInk().
90-
91-
**Play mode delay**: By default, ink does not compile while in play mode. This can be disabled in the InkSettings file.
80+
Ink files must be compiled to JSON before they can be used in-game at runtime.
81+
**This package compiles all edited ink files automatically via a [scripted importer](https://docs.unity3d.com/Manual/ScriptedImporters.html)**. The compiled JSON string is stored within the imported ink asset.
9282

9383
### In-game Compilation
9484

@@ -128,14 +118,6 @@ There's [unofficial support for PlayMaker here.](https://github.com/inkle/ink-un
128118

129119
We'd love to see this supported more if you'd like to assist the effort!
130120

131-
132-
# Source control tips
133-
134-
When you edit ink files, the compiler will also update the corresponding compiled .json file. If no compiled file existed before, Unity will also create a meta file for it. It is recommended that you always commit both ink and json files at the same time to avoid the file being re-compiled by your team members.
135-
136-
Adding or removing ink files will also make changes to the InkLibrary file, and we could recommend authors also commit this file for the same reasons.
137-
138-
139121
# <a name="WebGLBestPractices"></a>WebGL best practices
140122

141123
WebGL builds should be as small as possible. The ink compiler is included in builds, but is typically only used in the editor.

0 commit comments

Comments
 (0)