├── .gitignore ├── Assets ├── Editor.meta ├── Editor │ ├── ImageEffects.meta │ └── ImageEffects │ │ ├── VignetteAndChromaticAberrationEditor.cs │ │ └── VignetteAndChromaticAberrationEditor.cs.meta ├── Fonts.meta ├── Fonts │ ├── Lato.meta │ ├── Lato │ │ ├── Lato-Light.ttf │ │ ├── Lato-Light.ttf.meta │ │ ├── Lato-LightItalic.ttf │ │ ├── Lato-LightItalic.ttf.meta │ │ ├── Lato-Medium.ttf │ │ ├── Lato-Medium.ttf.meta │ │ ├── Lato-Readme.txt │ │ ├── Lato-Readme.txt.meta │ │ ├── Lato-Thin.ttf │ │ ├── Lato-Thin.ttf.meta │ │ ├── Lato-ThinItalic.ttf │ │ └── Lato-ThinItalic.ttf.meta │ ├── Remington-Noiseless.ttf │ └── Remington-Noiseless.ttf.meta ├── Ink.meta ├── Ink │ ├── TheIntercept.ink │ ├── TheIntercept.ink.meta │ ├── TheIntercept.json │ └── TheIntercept.json.meta ├── Plugins.meta ├── Plugins │ ├── Ink.meta │ └── Ink │ │ ├── DLLs.meta │ │ ├── DLLs │ │ ├── Newtonsoft.Json.dll │ │ ├── Newtonsoft.Json.dll.meta │ │ ├── ink-engine.dll │ │ ├── ink-engine.dll.meta │ │ ├── inklecate_mac │ │ ├── inklecate_mac.meta │ │ ├── inklecate_win.exe │ │ └── inklecate_win.exe.meta │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── Compiler.meta │ │ ├── Compiler │ │ │ ├── Auto Compiler.meta │ │ │ ├── Auto Compiler │ │ │ │ ├── InkPostProcessor.cs │ │ │ │ └── InkPostProcessor.cs.meta │ │ │ ├── InkCompiler.cs │ │ │ └── InkCompiler.cs.meta │ │ ├── Ink Inspector.meta │ │ ├── Ink Inspector │ │ │ ├── File Icons.meta │ │ │ ├── File Icons │ │ │ │ ├── InkBrowserIcons.cs │ │ │ │ ├── InkBrowserIcons.cs.meta │ │ │ │ ├── Resources.meta │ │ │ │ └── Resources │ │ │ │ │ ├── InkFileIcon-retina.psd │ │ │ │ │ ├── InkFileIcon-retina.psd.meta │ │ │ │ │ ├── InkFileIcon.psd │ │ │ │ │ └── InkFileIcon.psd.meta │ │ │ ├── Ink Inspector.meta │ │ │ └── Ink Inspector │ │ │ │ ├── InkInspector.cs │ │ │ │ ├── InkInspector.cs.meta │ │ │ │ ├── ObjectEditor.cs │ │ │ │ ├── ObjectEditor.cs.meta │ │ │ │ ├── ObjectInspector.cs │ │ │ │ └── ObjectInspector.cs.meta │ │ ├── Ink Library.meta │ │ ├── Ink Library │ │ │ ├── InkFile.cs │ │ │ ├── InkFile.cs.meta │ │ │ ├── InkLibrary.cs │ │ │ └── InkLibrary.cs.meta │ │ ├── Player Window.meta │ │ ├── Player Window │ │ │ ├── InkPlayerWindow.cs │ │ │ └── InkPlayerWindow.cs.meta │ │ ├── Tools.meta │ │ └── Tools │ │ │ ├── InkEditorUtils.cs │ │ │ └── InkEditorUtils.cs.meta │ │ ├── Licence.txt │ │ ├── Licence.txt.meta │ │ ├── Readme.md │ │ └── Readme.md.meta ├── Prefabs.meta ├── Prefabs │ ├── Chevron.prefab │ ├── Chevron.prefab.meta │ ├── Choice Group.prefab │ ├── Choice Group.prefab.meta │ ├── Choice.prefab │ ├── Choice.prefab.meta │ ├── Content.prefab │ ├── Content.prefab.meta │ ├── Empty.prefab │ └── Empty.prefab.meta ├── SFX.meta ├── SFX │ ├── 222549__caderesounds__horror-cinema-2-2014.wav │ ├── 222549__caderesounds__horror-cinema-2-2014.wav.meta │ ├── Key Sounds.meta │ ├── Key Sounds │ │ ├── 193945__soundslikewillem__d.wav │ │ ├── 193945__soundslikewillem__d.wav.meta │ │ ├── 193946__soundslikewillem__c.wav │ │ ├── 193946__soundslikewillem__c.wav.meta │ │ ├── 193947__soundslikewillem__b.wav │ │ ├── 193947__soundslikewillem__b.wav.meta │ │ ├── 193948__soundslikewillem__a.wav │ │ ├── 193948__soundslikewillem__a.wav.meta │ │ ├── 193949__soundslikewillem__h.wav │ │ ├── 193949__soundslikewillem__h.wav.meta │ │ ├── 193950__soundslikewillem__g.wav │ │ ├── 193950__soundslikewillem__g.wav.meta │ │ ├── 193951__soundslikewillem__f.wav │ │ ├── 193951__soundslikewillem__f.wav.meta │ │ ├── 193952__soundslikewillem__e.wav │ │ ├── 193952__soundslikewillem__e.wav.meta │ │ ├── 193953__soundslikewillem__j.wav │ │ ├── 193953__soundslikewillem__j.wav.meta │ │ ├── 193954__soundslikewillem__i.wav │ │ ├── 193954__soundslikewillem__i.wav.meta │ │ ├── 193955__soundslikewillem__w.wav │ │ ├── 193955__soundslikewillem__w.wav.meta │ │ ├── 193956__soundslikewillem__x.wav │ │ ├── 193956__soundslikewillem__x.wav.meta │ │ ├── 193957__soundslikewillem__u.wav │ │ ├── 193957__soundslikewillem__u.wav.meta │ │ ├── 193958__soundslikewillem__v.wav │ │ ├── 193958__soundslikewillem__v.wav.meta │ │ ├── 193959__soundslikewillem__y.wav │ │ ├── 193959__soundslikewillem__y.wav.meta │ │ ├── _readme_and_license.txt │ │ ├── _readme_and_license.txt.meta │ │ ├── attachingPaper.mp3 │ │ └── attachingPaper.mp3.meta │ ├── looping-dark-ambience.mp3 │ └── looping-dark-ambience.mp3.meta ├── Scenes.meta ├── Scenes │ ├── Demo.unity │ └── Demo.unity.meta ├── Scripts.meta ├── Scripts │ ├── Audio.meta │ ├── Audio │ │ ├── AudioClipDatabase.cs │ │ ├── AudioClipDatabase.cs.meta │ │ ├── BackgroundAmbienceController.cs │ │ └── BackgroundAmbienceController.cs.meta │ ├── ContentManager.cs │ ├── ContentManager.cs.meta │ ├── DeviceScaler.cs │ ├── DeviceScaler.cs.meta │ ├── Main.meta │ ├── Main │ │ ├── Main.cs │ │ ├── Main.cs.meta │ │ ├── States.meta │ │ └── States │ │ │ ├── End.meta │ │ │ ├── End │ │ │ ├── EndState.cs │ │ │ ├── EndState.cs.meta │ │ │ ├── View.meta │ │ │ └── View │ │ │ │ ├── EndRestartButton.cs │ │ │ │ ├── EndRestartButton.cs.meta │ │ │ │ ├── EndView.cs │ │ │ │ └── EndView.cs.meta │ │ │ ├── Game.meta │ │ │ ├── Game │ │ │ ├── GameState.cs │ │ │ ├── GameState.cs.meta │ │ │ ├── View.meta │ │ │ └── View │ │ │ │ ├── ChevronButtonView.cs │ │ │ │ ├── ChevronButtonView.cs.meta │ │ │ │ ├── ChoiceGroupContainerView.cs │ │ │ │ ├── ChoiceGroupContainerView.cs.meta │ │ │ │ ├── ChoiceGroupView.cs │ │ │ │ ├── ChoiceGroupView.cs.meta │ │ │ │ ├── ChoiceView.cs │ │ │ │ ├── ChoiceView.cs.meta │ │ │ │ ├── ContentView.cs │ │ │ │ ├── ContentView.cs.meta │ │ │ │ ├── Credits.meta │ │ │ │ ├── Credits │ │ │ │ ├── CreditsView.cs │ │ │ │ └── CreditsView.cs.meta │ │ │ │ ├── EmptyView.cs │ │ │ │ ├── EmptyView.cs.meta │ │ │ │ ├── ScrollToBottomButtonView.cs │ │ │ │ ├── ScrollToBottomButtonView.cs.meta │ │ │ │ ├── Settings.meta │ │ │ │ ├── Settings │ │ │ │ ├── QuitButtonController.cs │ │ │ │ ├── QuitButtonController.cs.meta │ │ │ │ ├── SettingsButton.cs │ │ │ │ ├── SettingsButton.cs.meta │ │ │ │ ├── SettingsView.cs │ │ │ │ └── SettingsView.cs.meta │ │ │ │ ├── StoryElementView.cs │ │ │ │ └── StoryElementView.cs.meta │ │ │ ├── Intro.meta │ │ │ ├── Intro │ │ │ ├── IntroState.cs │ │ │ ├── IntroState.cs.meta │ │ │ ├── IntroTypedText.cs │ │ │ └── IntroTypedText.cs.meta │ │ │ ├── MainState.cs │ │ │ └── MainState.cs.meta │ ├── Tests.meta │ ├── Tests │ │ ├── Editor.meta │ │ └── Editor │ │ │ ├── RichTextSubstringTests.cs │ │ │ └── RichTextSubstringTests.cs.meta │ ├── Utils.meta │ └── Utils │ │ ├── MonoSingleton.cs │ │ ├── MonoSingleton.cs.meta │ │ ├── RichTextSubstring.cs │ │ ├── RichTextSubstring.cs.meta │ │ ├── Timer.meta │ │ ├── Timer │ │ ├── Timer.cs │ │ ├── Timer.cs.meta │ │ ├── TimerState.cs │ │ └── TimerState.cs.meta │ │ ├── Tween.meta │ │ ├── Tween │ │ ├── Types.meta │ │ └── Types │ │ │ ├── Base.meta │ │ │ ├── Base │ │ │ ├── TypeTween.cs │ │ │ └── TypeTween.cs.meta │ │ │ ├── ColorTween.cs │ │ │ ├── ColorTween.cs.meta │ │ │ ├── FloatTween.cs │ │ │ ├── FloatTween.cs.meta │ │ │ ├── Vector2Tween.cs │ │ │ └── Vector2Tween.cs.meta │ │ ├── TypedText.cs │ │ ├── TypedText.cs.meta │ │ ├── UI.meta │ │ ├── UI │ │ ├── CanvasGroupOpacityInteractionEnabler.cs │ │ ├── CanvasGroupOpacityInteractionEnabler.cs.meta │ │ ├── GraphicPulser.cs │ │ ├── GraphicPulser.cs.meta │ │ ├── LetterSpacing.cs │ │ ├── LetterSpacing.cs.meta │ │ ├── ScrollRectEventProxy.cs │ │ └── ScrollRectEventProxy.cs.meta │ │ ├── UIMonoBehaviour.cs │ │ └── UIMonoBehaviour.cs.meta ├── Standard Assets.meta ├── Standard Assets │ ├── Effects.meta │ └── Effects │ │ ├── ImageEffects.meta │ │ └── ImageEffects │ │ ├── Scripts.meta │ │ ├── Scripts │ │ ├── ImageEffectBase.cs │ │ ├── ImageEffectBase.cs.meta │ │ ├── PostEffectsBase.cs │ │ ├── PostEffectsBase.cs.meta │ │ ├── VignetteAndChromaticAberration.cs │ │ └── VignetteAndChromaticAberration.cs.meta │ │ ├── Shaders.meta │ │ ├── Shaders │ │ ├── ChromaticAberrationShader.shader │ │ ├── ChromaticAberrationShader.shader.meta │ │ ├── VignettingShader.shader │ │ ├── VignettingShader.shader.meta │ │ ├── _DepthOfField.meta │ │ └── _DepthOfField │ │ │ ├── SeparableBlur.shader │ │ │ └── SeparableBlur.shader.meta │ │ ├── Textures.meta │ │ └── Textures │ │ ├── VignetteMask.png │ │ └── VignetteMask.png.meta ├── Textures.meta └── Textures │ ├── Build.meta │ ├── Build │ ├── icon.png │ └── icon.png.meta │ ├── UI.meta │ ├── UI │ ├── marketCloseButton@2x.png │ ├── marketCloseButton@2x.png.meta │ ├── restartIcon.psd │ ├── restartIcon.psd.meta │ ├── settingsIcon.psd │ ├── settingsIcon.psd.meta │ ├── single-chevron.png │ ├── single-chevron.png.meta │ ├── story-double-chevron@2x.png │ └── story-double-chevron@2x.png.meta │ ├── background.psd │ ├── background.psd.meta │ ├── fade.psd │ ├── fade.psd.meta │ ├── paper.png │ └── paper.png.meta ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityAdsSettings.asset └── UnityConnectSettings.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # =============== # 2 | # Unity generated # 3 | # =============== # 4 | [Ll]ibrary/ 5 | [Tt]emp/ 6 | [Oo]bj/ 7 | [Uu]nityGenerated/ 8 | Assets/AssetStoreTools* 9 | 10 | # =============================================== # 11 | # Visual Studio / MonoDevelop / Sublime generated # 12 | # =============================================== # 13 | ExportedObj/ 14 | *.svd 15 | *.userprefs 16 | *.csproj 17 | *.pidb 18 | *.suo 19 | *.sln 20 | *.user 21 | *.unityproj 22 | *.booproj 23 | *.sublime-project 24 | 25 | # ============ # 26 | # OS generated # 27 | # ============ # 28 | .DS_Store 29 | .DS_Store? 30 | ._* 31 | .Spotlight-V100 32 | .Trashes 33 | Icon? 34 | ehthumbs.db 35 | Thumbs.db 36 | 37 | # ============== # 38 | # Game specific # 39 | # ============== # 40 | Bin/ 41 | 42 | # =========== # 43 | # Other files # 44 | # =========== # 45 | *~ 46 | Assets/Textures/intercept-design.psd 47 | Assets/Textures/intercept-design.psd.meta 48 | -------------------------------------------------------------------------------- /Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80c31d908857648ca9e6fe0eeffaeb61 3 | folderAsset: yes 4 | timeCreated: 1459433528 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Editor/ImageEffects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 225198e07aaae3547a6d1f6e7177555f 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/Editor/ImageEffects/VignetteAndChromaticAberrationEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace UnityStandardAssets.ImageEffects 6 | { 7 | [CustomEditor (typeof(VignetteAndChromaticAberration))] 8 | class VignetteAndChromaticAberrationEditor : Editor 9 | { 10 | private SerializedObject m_SerObj; 11 | private SerializedProperty m_Mode; 12 | private SerializedProperty m_Intensity; // intensity == 0 disables pre pass (optimization) 13 | private SerializedProperty m_ChromaticAberration; 14 | private SerializedProperty m_AxialAberration; 15 | private SerializedProperty m_Blur; // blur == 0 disables blur pass (optimization) 16 | private SerializedProperty m_BlurSpread; 17 | private SerializedProperty m_BlurDistance; 18 | private SerializedProperty m_LuminanceDependency; 19 | 20 | 21 | void OnEnable () 22 | { 23 | m_SerObj = new SerializedObject (target); 24 | m_Mode = m_SerObj.FindProperty ("mode"); 25 | m_Intensity = m_SerObj.FindProperty ("intensity"); 26 | m_ChromaticAberration = m_SerObj.FindProperty ("chromaticAberration"); 27 | m_AxialAberration = m_SerObj.FindProperty ("axialAberration"); 28 | m_Blur = m_SerObj.FindProperty ("blur"); 29 | m_BlurSpread = m_SerObj.FindProperty ("blurSpread"); 30 | m_LuminanceDependency = m_SerObj.FindProperty ("luminanceDependency"); 31 | m_BlurDistance = m_SerObj.FindProperty ("blurDistance"); 32 | } 33 | 34 | 35 | public override void OnInspectorGUI () 36 | { 37 | m_SerObj.Update (); 38 | 39 | EditorGUILayout.LabelField("Simulates the common lens artifacts 'Vignette' and 'Aberration'", EditorStyles.miniLabel); 40 | 41 | EditorGUILayout.Slider(m_Intensity, 0.0f, 1.0f, new GUIContent("Vignetting")); 42 | EditorGUILayout.Slider(m_Blur, 0.0f, 1.0f, new GUIContent(" Blurred Corners")); 43 | if (m_Blur.floatValue>0.0f) 44 | EditorGUILayout.Slider(m_BlurSpread, 0.0f, 1.0f, new GUIContent(" Blur Distance")); 45 | 46 | EditorGUILayout.Separator (); 47 | 48 | EditorGUILayout.PropertyField (m_Mode, new GUIContent("Aberration")); 49 | if (m_Mode.intValue>0) 50 | { 51 | EditorGUILayout.Slider(m_ChromaticAberration, 0.0f, 5.0f, new GUIContent(" Tangential Aberration")); 52 | EditorGUILayout.Slider(m_AxialAberration, 0.0f, 5.0f, new GUIContent(" Axial Aberration")); 53 | m_LuminanceDependency.floatValue = EditorGUILayout.Slider(" Contrast Dependency", m_LuminanceDependency.floatValue, 0.001f, 1.0f); 54 | m_BlurDistance.floatValue = EditorGUILayout.Slider(" Blur Distance", m_BlurDistance.floatValue, 0.001f, 5.0f); 55 | } 56 | else 57 | EditorGUILayout.PropertyField (m_ChromaticAberration, new GUIContent(" Chromatic Aberration")); 58 | 59 | m_SerObj.ApplyModifiedProperties(); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Assets/Editor/ImageEffects/VignetteAndChromaticAberrationEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 08126bf2baa528c4cb9c60340a24e5d6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/Fonts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8233454ba9dd343a483e54f592f822e3 3 | folderAsset: yes 4 | timeCreated: 1457766855 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Fonts/Lato.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3eb0cd502ea414e0ebc5a5f477be13ac 3 | folderAsset: yes 4 | timeCreated: 1459431686 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Fonts/Lato/Lato-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Fonts/Lato/Lato-Light.ttf -------------------------------------------------------------------------------- /Assets/Fonts/Lato/Lato-Light.ttf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7376d81b35219498996050ef2d8f0030 3 | timeCreated: 1432126964 4 | licenseType: Pro 5 | TrueTypeFontImporter: 6 | serializedVersion: 3 7 | fontSize: 32 8 | forceTextureCase: -2 9 | characterSpacing: 1 10 | characterPadding: 0 11 | includeFontData: 1 12 | fontNames: [] 13 | fallbackFontReferences: 14 | - {fileID: 12800000, guid: acd5ec74ebbd9484bba2394cfce7ebfe, type: 3} 15 | - {fileID: 12800000, guid: 64a251a49ee5e4384b123892aebb2945, type: 3} 16 | - {fileID: 12800000, guid: 75568c38d49464ddf908c324c582b2b2, type: 3} 17 | - {fileID: 12800000, guid: b9cf71af8663e4b439c5ff3421a32b42, type: 3} 18 | customCharacters: 19 | fontRenderingMode: 0 20 | ascentCalculationMode: 1 21 | userData: 22 | assetBundleName: 23 | assetBundleVariant: 24 | -------------------------------------------------------------------------------- /Assets/Fonts/Lato/Lato-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Fonts/Lato/Lato-LightItalic.ttf -------------------------------------------------------------------------------- /Assets/Fonts/Lato/Lato-LightItalic.ttf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 64a251a49ee5e4384b123892aebb2945 3 | timeCreated: 1432126964 4 | licenseType: Pro 5 | TrueTypeFontImporter: 6 | serializedVersion: 3 7 | fontSize: 32 8 | forceTextureCase: -2 9 | characterSpacing: 1 10 | characterPadding: 0 11 | includeFontData: 1 12 | fontNames: [] 13 | fallbackFontReferences: 14 | - {fileID: 12800000, guid: acd5ec74ebbd9484bba2394cfce7ebfe, type: 3} 15 | - {fileID: 12800000, guid: 75568c38d49464ddf908c324c582b2b2, type: 3} 16 | - {fileID: 12800000, guid: 7376d81b35219498996050ef2d8f0030, type: 3} 17 | - {fileID: 12800000, guid: b9cf71af8663e4b439c5ff3421a32b42, type: 3} 18 | customCharacters: 19 | fontRenderingMode: 0 20 | ascentCalculationMode: 1 21 | userData: 22 | assetBundleName: 23 | assetBundleVariant: 24 | -------------------------------------------------------------------------------- /Assets/Fonts/Lato/Lato-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Fonts/Lato/Lato-Medium.ttf -------------------------------------------------------------------------------- /Assets/Fonts/Lato/Lato-Medium.ttf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: acd5ec74ebbd9484bba2394cfce7ebfe 3 | timeCreated: 1432126964 4 | licenseType: Pro 5 | TrueTypeFontImporter: 6 | serializedVersion: 3 7 | fontSize: 32 8 | forceTextureCase: -2 9 | characterSpacing: 1 10 | characterPadding: 0 11 | includeFontData: 1 12 | fontNames: [] 13 | fallbackFontReferences: 14 | - {fileID: 12800000, guid: 64a251a49ee5e4384b123892aebb2945, type: 3} 15 | - {fileID: 12800000, guid: 75568c38d49464ddf908c324c582b2b2, type: 3} 16 | - {fileID: 12800000, guid: 7376d81b35219498996050ef2d8f0030, type: 3} 17 | - {fileID: 12800000, guid: b9cf71af8663e4b439c5ff3421a32b42, type: 3} 18 | customCharacters: 19 | fontRenderingMode: 0 20 | ascentCalculationMode: 1 21 | userData: 22 | assetBundleName: 23 | assetBundleVariant: 24 | -------------------------------------------------------------------------------- /Assets/Fonts/Lato/Lato-Readme.txt: -------------------------------------------------------------------------------- 1 | Lato Readme 2 | 3 | Downloaded from http://www.latofonts.com/lato-free-fonts/ 4 | 5 | Found originally on Google Fonts: 6 | 7 | https://www.google.com/fonts#UsePlace:use/Collection:Lato 8 | 9 | Used to replace Futura Medium. 10 | -------------------------------------------------------------------------------- /Assets/Fonts/Lato/Lato-Readme.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: efe6a80c2a3d540f5b81e74dee57f539 3 | timeCreated: 1432127025 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Fonts/Lato/Lato-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Fonts/Lato/Lato-Thin.ttf -------------------------------------------------------------------------------- /Assets/Fonts/Lato/Lato-Thin.ttf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75568c38d49464ddf908c324c582b2b2 3 | timeCreated: 1432127150 4 | licenseType: Pro 5 | TrueTypeFontImporter: 6 | serializedVersion: 3 7 | fontSize: 32 8 | forceTextureCase: -2 9 | characterSpacing: 1 10 | characterPadding: 0 11 | includeFontData: 1 12 | fontNames: [] 13 | fallbackFontReferences: 14 | - {fileID: 12800000, guid: acd5ec74ebbd9484bba2394cfce7ebfe, type: 3} 15 | - {fileID: 12800000, guid: 64a251a49ee5e4384b123892aebb2945, type: 3} 16 | - {fileID: 12800000, guid: 7376d81b35219498996050ef2d8f0030, type: 3} 17 | - {fileID: 12800000, guid: b9cf71af8663e4b439c5ff3421a32b42, type: 3} 18 | customCharacters: 19 | fontRenderingMode: 0 20 | ascentCalculationMode: 1 21 | userData: 22 | assetBundleName: 23 | assetBundleVariant: 24 | -------------------------------------------------------------------------------- /Assets/Fonts/Lato/Lato-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Fonts/Lato/Lato-ThinItalic.ttf -------------------------------------------------------------------------------- /Assets/Fonts/Lato/Lato-ThinItalic.ttf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9cf71af8663e4b439c5ff3421a32b42 3 | timeCreated: 1432127150 4 | licenseType: Pro 5 | TrueTypeFontImporter: 6 | serializedVersion: 3 7 | fontSize: 32 8 | forceTextureCase: -2 9 | characterSpacing: 1 10 | characterPadding: 0 11 | includeFontData: 1 12 | fontNames: [] 13 | fallbackFontReferences: 14 | - {fileID: 12800000, guid: acd5ec74ebbd9484bba2394cfce7ebfe, type: 3} 15 | - {fileID: 12800000, guid: 64a251a49ee5e4384b123892aebb2945, type: 3} 16 | - {fileID: 12800000, guid: 75568c38d49464ddf908c324c582b2b2, type: 3} 17 | - {fileID: 12800000, guid: 7376d81b35219498996050ef2d8f0030, type: 3} 18 | customCharacters: 19 | fontRenderingMode: 0 20 | ascentCalculationMode: 1 21 | userData: 22 | assetBundleName: 23 | assetBundleVariant: 24 | -------------------------------------------------------------------------------- /Assets/Fonts/Remington-Noiseless.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Fonts/Remington-Noiseless.ttf -------------------------------------------------------------------------------- /Assets/Fonts/Remington-Noiseless.ttf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 638a31bb876a94f4588b0d5010adaa60 3 | timeCreated: 1457767122 4 | licenseType: Pro 5 | TrueTypeFontImporter: 6 | serializedVersion: 3 7 | fontSize: 16 8 | forceTextureCase: -2 9 | characterSpacing: 1 10 | characterPadding: 0 11 | includeFontData: 1 12 | fontNames: [] 13 | fallbackFontReferences: [] 14 | customCharacters: 15 | fontRenderingMode: 0 16 | ascentCalculationMode: 1 17 | userData: 18 | assetBundleName: 19 | assetBundleVariant: 20 | -------------------------------------------------------------------------------- /Assets/Ink.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c50c7fe3482504f109496bda24473c29 3 | folderAsset: yes 4 | timeCreated: 1457765523 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Ink/TheIntercept.ink.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e341ae7b7f8644c282aeb27a9f1a33a 3 | timeCreated: 1458015680 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Ink/TheIntercept.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f34cfdd03b3248aeb09eb56c6cd1eda 3 | timeCreated: 1458015781 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9dc5d5c345b24935b883259c8e54e3e 3 | folderAsset: yes 4 | timeCreated: 1457765523 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 644b324b887a8483bb4b50d35a72ed20 3 | folderAsset: yes 4 | timeCreated: 1457765523 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/DLLs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8cab9ecb645d648e69ebb708c7b38f32 3 | folderAsset: yes 4 | timeCreated: 1459802219 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/DLLs/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Plugins/Ink/DLLs/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /Assets/Plugins/Ink/DLLs/Newtonsoft.Json.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a71af3e798e0f8348a93e9bda083a3d5 3 | timeCreated: 1460400547 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Android: 12 | enabled: 0 13 | settings: 14 | CPU: AnyCPU 15 | Any: 16 | enabled: 1 17 | settings: {} 18 | Editor: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | DefaultValueInitialized: true 23 | OS: AnyOS 24 | Linux: 25 | enabled: 0 26 | settings: 27 | CPU: x86 28 | Linux64: 29 | enabled: 0 30 | settings: 31 | CPU: x86_64 32 | OSXIntel: 33 | enabled: 0 34 | settings: 35 | CPU: AnyCPU 36 | OSXIntel64: 37 | enabled: 0 38 | settings: 39 | CPU: AnyCPU 40 | Win: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | Win64: 45 | enabled: 0 46 | settings: 47 | CPU: AnyCPU 48 | WindowsStoreApps: 49 | enabled: 0 50 | settings: 51 | CPU: AnyCPU 52 | iOS: 53 | enabled: 0 54 | settings: 55 | CompileFlags: 56 | FrameworkDependencies: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/DLLs/ink-engine.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Plugins/Ink/DLLs/ink-engine.dll -------------------------------------------------------------------------------- /Assets/Plugins/Ink/DLLs/ink-engine.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b4cb53f258bd495a9ee1e8241a395e7 3 | timeCreated: 1456859249 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 1 13 | settings: {} 14 | Editor: 15 | enabled: 0 16 | settings: 17 | DefaultValueInitialized: true 18 | WindowsStoreApps: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | userData: 23 | assetBundleName: 24 | assetBundleVariant: 25 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/DLLs/inklecate_mac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Plugins/Ink/DLLs/inklecate_mac -------------------------------------------------------------------------------- /Assets/Plugins/Ink/DLLs/inklecate_mac.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fcee72ed045ae4564bffdf02252459fe 3 | timeCreated: 1459775627 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/DLLs/inklecate_win.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Plugins/Ink/DLLs/inklecate_win.exe -------------------------------------------------------------------------------- /Assets/Plugins/Ink/DLLs/inklecate_win.exe.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe57173b56f7c4aa588b0425b097c3d7 3 | timeCreated: 1459775627 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df28596461d414a1b9f56cb406a23a3f 3 | folderAsset: yes 4 | timeCreated: 1459882215 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Compiler.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ddef5103d5ce1401da019f7df6c472af 3 | folderAsset: yes 4 | timeCreated: 1459882122 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Compiler/Auto Compiler.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e277a78690c74451084fbfbedc0507e8 3 | folderAsset: yes 4 | timeCreated: 1459941651 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Compiler/Auto Compiler/InkPostProcessor.cs: -------------------------------------------------------------------------------- 1 | // Automatically creates JSON files from an ink placed within the Assets/Ink folder. 2 | using UnityEngine; 3 | using UnityEditor; 4 | using System; 5 | using System.IO; 6 | using Debug = UnityEngine.Debug; 7 | using System.Collections; 8 | using System.Collections.Generic; 9 | 10 | using System.Linq; 11 | using System.Reflection; 12 | using System.Runtime.CompilerServices; 13 | 14 | namespace Ink.UnityIntegration { 15 | class InkPostProcessor : AssetPostprocessor { 16 | 17 | // Recompiles any ink files as a result of an ink file (re)import 18 | static void OnPostprocessAllAssets (string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { 19 | List importedInkAssets = new List(); 20 | string inklecateFileLocation = null; 21 | 22 | foreach (var importedAssetPath in importedAssets) { 23 | if(Path.GetExtension(importedAssetPath) == ".ink") 24 | importedInkAssets.Add(importedAssetPath); 25 | else if (Path.GetFileName(importedAssetPath) == "inklecate" && Path.GetExtension(importedAssetPath) == "") 26 | inklecateFileLocation = importedAssetPath; 27 | } 28 | 29 | if(importedInkAssets.Count > 0) 30 | PostprocessInkFiles(importedInkAssets); 31 | if(inklecateFileLocation != null) 32 | PostprocessInklecate(inklecateFileLocation); 33 | 34 | if(PlayerSettings.apiCompatibilityLevel == ApiCompatibilityLevel.NET_2_0_Subset) { 35 | Debug.LogWarning("Detected PlayerSettings.apiCompatibilityLevel is .NET 2.0 Subset. Due to JSON.Net as used by ink-engine.dll, API Compatibility Level must be set to .NET 2.0 for standalone builds to function. Change this in PlayerSettings."); 36 | } 37 | } 38 | 39 | static void PostprocessInklecate (string inklecateFileLocation) { 40 | Debug.Log("Inklecate updated. Recompiling all Ink files..."); 41 | InkCompiler.RecompileAll(); 42 | } 43 | 44 | static void PostprocessInkFiles (List importedInkAssets) { 45 | InkLibrary.Refresh(); 46 | List inkAssetsToCompile = new List(); 47 | foreach (var importedAssetPath in importedInkAssets) { 48 | InkFile file = InkLibrary.GetInkFileWithPath(importedAssetPath); 49 | if(file.master != null && !inkAssetsToCompile.Contains(file.master.absoluteFilePath)) 50 | inkAssetsToCompile.Add(file.master.absoluteFilePath); 51 | else if (!inkAssetsToCompile.Contains(file.absoluteFilePath)) 52 | inkAssetsToCompile.Add(file.absoluteFilePath); 53 | } 54 | 55 | foreach (var inkAssetToCompile in inkAssetsToCompile) { 56 | InkCompiler.CompileInk(inkAssetToCompile); 57 | } 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Compiler/Auto Compiler/InkPostProcessor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45a9c84618e20498993d11d2bb89946e 3 | timeCreated: 1459667420 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Compiler/InkCompiler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 430cb8f71c23c438cb8b0ce85cc80fa6 3 | timeCreated: 1459463931 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Inspector.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9dc6bf28e6e4a460a909a665c5bc048a 3 | folderAsset: yes 4 | timeCreated: 1459934446 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Inspector/File Icons.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 350bb01e156c14508a02fa0ab21edce5 3 | folderAsset: yes 4 | timeCreated: 1459941567 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Inspector/File Icons/InkBrowserIcons.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | /* 6 | * This script allows you to set custom icons for folders in project browser. 7 | * Recommended icon sizes - small: 16x16 px, large: 64x64 px; 8 | */ 9 | 10 | namespace Ink.UnityIntegration { 11 | [InitializeOnLoad] 12 | public class InkBrowserIcons { 13 | private const float largeIconSize = 64f; 14 | 15 | private static Texture2D inkFileIcon; 16 | 17 | static InkBrowserIcons() { 18 | if(Application.platform == RuntimePlatform.OSXEditor && Application.unityVersion.Substring(0,3) == ("5.4")) { 19 | inkFileIcon = Resources.Load("InkFileIcon-retina"); 20 | } else { 21 | inkFileIcon = Resources.Load("InkFileIcon"); 22 | } 23 | if(inkFileIcon != null) 24 | EditorApplication.projectWindowItemOnGUI += OnDrawProjectWindowItem; 25 | } 26 | 27 | static void OnDrawProjectWindowItem(string guid, Rect rect) { 28 | var path = AssetDatabase.GUIDToAssetPath(guid); 29 | 30 | if (Path.GetExtension(path) == InkEditorUtils.inkFileExtension) { 31 | var isSmall = rect.width > rect.height; 32 | if (isSmall) { 33 | rect.width = rect.height; 34 | } else { 35 | rect.height = rect.width; 36 | } 37 | 38 | if (rect.width > largeIconSize) { 39 | var offset = (rect.width - largeIconSize) * 0.5f; 40 | var position = new Rect(rect.x + offset, rect.y + offset, largeIconSize, largeIconSize); 41 | GUI.DrawTexture(position, inkFileIcon); 42 | } 43 | else { 44 | GUI.DrawTexture(rect, inkFileIcon); 45 | } 46 | } 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Inspector/File Icons/InkBrowserIcons.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 38c650d4ee11f47559699f833d29d4b9 3 | timeCreated: 1459341699 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Inspector/File Icons/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5081bfd12b67745ab9e8c560e5f4cad1 3 | folderAsset: yes 4 | timeCreated: 1459341721 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Inspector/File Icons/Resources/InkFileIcon-retina.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Plugins/Ink/Editor/Ink Inspector/File Icons/Resources/InkFileIcon-retina.psd -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Inspector/File Icons/Resources/InkFileIcon-retina.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd3c497264be941e3a935055a433bbb9 3 | timeCreated: 1459953147 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -3 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: 0 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 2 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Inspector/File Icons/Resources/InkFileIcon.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Plugins/Ink/Editor/Ink Inspector/File Icons/Resources/InkFileIcon.psd -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Inspector/File Icons/Resources/InkFileIcon.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e6b218461abe4192baeeabfbe7a9ced 3 | timeCreated: 1459341708 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -3 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: 0 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 16 48 | alphaIsTransparency: 1 49 | textureType: 2 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Inspector/Ink Inspector.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f99704ec1dd94cc1ba8f76bb71f6ae3 3 | folderAsset: yes 4 | timeCreated: 1460011342 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Inspector/Ink Inspector/InkInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6905e53703af64a70aa6eb42f98b047c 3 | timeCreated: 1460011343 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Inspector/Ink Inspector/ObjectEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System; 4 | using System.IO; 5 | using System.Collections; 6 | using System.Collections.Generic; 7 | using System.Reflection; 8 | 9 | namespace Ink.UnityIntegration { 10 | [CustomEditor(typeof(UnityEngine.Object), true)] 11 | public class ObjectEditor : Editor { 12 | 13 | private ObjectInspector objectInspector; 14 | 15 | private void OnEnable () { 16 | objectInspector = FindObjectInspector (); 17 | if(objectInspector != null) { 18 | objectInspector.serializedObject = serializedObject; 19 | objectInspector.target = target; 20 | objectInspector.OnEnable(); 21 | } 22 | } 23 | 24 | private void OnDisable () { 25 | if(objectInspector != null) 26 | objectInspector.OnDisable(); 27 | } 28 | 29 | public override void OnInspectorGUI () { 30 | if(objectInspector != null) 31 | objectInspector.OnInspectorGUI(); 32 | else if (target.GetType() != typeof(UnityEditor.DefaultAsset)) 33 | base.OnInspectorGUI(); 34 | } 35 | 36 | private ObjectInspector FindObjectInspector () { 37 | List assembliesToCheck = new List{"Assembly-CSharp-Editor", "Assembly-CSharp-Editor-firstpass", "Assembly-UnityScript-Editor", "Assembly-UnityScript-Editor-firstpass"}; 38 | string assetPath = AssetDatabase.GetAssetPath(target); 39 | Assembly[] referencedAssemblies = System.AppDomain.CurrentDomain.GetAssemblies(); 40 | for(int i = 0; i < referencedAssemblies.Length; ++i) { 41 | if(!assembliesToCheck.Contains(referencedAssemblies[i].GetName().Name)) 42 | continue; 43 | foreach(var type in referencedAssemblies[i].GetTypes()) { 44 | if(!type.IsSubclassOf(typeof(ObjectInspector))) 45 | continue; 46 | ObjectInspector objectInspector = (ObjectInspector)Activator.CreateInstance(type); 47 | if(objectInspector.IsValid(assetPath)) { 48 | objectInspector.target = target; 49 | return objectInspector; 50 | } 51 | } 52 | } 53 | return null; 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Inspector/Ink Inspector/ObjectEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e0ac3feecf474715b8c698e9495d833 3 | timeCreated: 1460011342 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Inspector/Ink Inspector/ObjectInspector.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | namespace Ink.UnityIntegration { 5 | public abstract class ObjectInspector { 6 | public Object target; 7 | public SerializedObject serializedObject; 8 | 9 | public abstract bool IsValid(string assetPath); 10 | public virtual void OnEnable () {} 11 | public virtual void OnDisable () {} 12 | public virtual void OnHeaderGUI () {} 13 | public virtual void OnInspectorGUI() {} 14 | } 15 | } -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Inspector/Ink Inspector/ObjectInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61e383d72b80d4b7eb886e2bf08ca9b7 3 | timeCreated: 1460011342 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Library.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6188b37f5f5824313b73fb964d1b269e 3 | folderAsset: yes 4 | timeCreated: 1459878666 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Library/InkFile.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System; 4 | using System.IO; 5 | using Debug = UnityEngine.Debug; 6 | using System.Collections; 7 | using System.Collections.Generic; 8 | 9 | using System.Linq; 10 | using System.Reflection; 11 | using System.Runtime.CompilerServices; 12 | 13 | namespace Ink.UnityIntegration { 14 | // Helper class for ink files that maintains INCLUDE connections between ink files 15 | public class InkFile { 16 | 17 | private const string includeKey = "INCLUDE "; 18 | 19 | // The full file path 20 | public string absoluteFilePath; 21 | public string absoluteFolderPath; 22 | // The file path relative to the Assets folder 23 | public string filePath; 24 | 25 | // The content of the .ink file 26 | public string fileContents; 27 | // The paths of the files included by this file 28 | public List includePaths; 29 | // The loaded files included by this file 30 | public List includes; 31 | // If this file is included by another, the other is the master file. 32 | 33 | public InkFile master; 34 | 35 | // A reference to the ink file (UnityEngine.DefaultAsset) 36 | public UnityEngine.Object inkFile; 37 | // The compiled json file. Use this to start a story. 38 | public TextAsset jsonAsset; 39 | 40 | public InkFile (string absoluteFilePath) { 41 | this.absoluteFilePath = absoluteFilePath; 42 | absoluteFolderPath = Path.GetDirectoryName(absoluteFilePath); 43 | filePath = absoluteFilePath.Substring(Application.dataPath.Length-6); 44 | fileContents = File.OpenText(absoluteFilePath).ReadToEnd(); 45 | inkFile = AssetDatabase.LoadAssetAtPath(filePath); 46 | GetIncludePaths(); 47 | } 48 | 49 | private void GetIncludePaths() { 50 | if (String.IsNullOrEmpty(includeKey)) 51 | throw new ArgumentException("the string to find may not be empty", "value"); 52 | includePaths = new List(); 53 | for (int index = 0;;) { 54 | index = fileContents.IndexOf(includeKey, index); 55 | if (index == -1) 56 | return; 57 | 58 | int lastIndex = fileContents.IndexOf("\n", index); 59 | if(lastIndex == -1) { 60 | index += includeKey.Length; 61 | } else { 62 | includePaths.Add(Path.Combine(absoluteFolderPath, fileContents.Substring(index + includeKey.Length, lastIndex - (index+ + includeKey.Length)))); 63 | index = lastIndex; 64 | } 65 | } 66 | } 67 | 68 | // Finds include files from paths and the list of all the ink files to check. 69 | public void GetIncludes (InkFile[] inkFiles) { 70 | includes = new List(); 71 | foreach (InkFile inkFile in inkFiles) { 72 | if(includePaths.Contains(inkFile.absoluteFilePath)) { 73 | inkFile.master = this; 74 | includes.Add(inkFile); 75 | } 76 | } 77 | } 78 | 79 | public void FindCompiledJSONAsset () { 80 | jsonAsset = AssetDatabase.LoadAssetAtPath(Path.Combine(Path.GetDirectoryName(filePath), Path.GetFileNameWithoutExtension(filePath))+".json"); 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Library/InkFile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f710753ff9fd84049b8c06fddd9af1af 3 | timeCreated: 1459464092 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Library/InkLibrary.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.IO; 7 | using System.Diagnostics; 8 | using UnityEditorInternal; 9 | using Debug = UnityEngine.Debug; 10 | using Ink.Runtime; 11 | 12 | /// 13 | /// Holds a reference to an InkFile object for every .ink file detected in the Assets folder. 14 | /// Provides helper functions to easily obtain these files. 15 | /// 16 | namespace Ink.UnityIntegration { 17 | public static class InkLibrary { 18 | public static InkFile[] inkLibrary; 19 | 20 | /// 21 | /// Updates the ink library. Executed whenever an ink file is changed by InkToJSONPostProcessor 22 | /// Can be called manually, but incurs a performance cost. 23 | /// 24 | public static void Refresh () { 25 | string[] inkFilePaths = Directory.GetFiles(Application.dataPath, "*.ink", SearchOption.AllDirectories); 26 | inkLibrary = new InkFile[inkFilePaths.Length]; 27 | for (int i = 0; i < inkFilePaths.Length; i++) { 28 | inkLibrary [i] = new InkFile (inkFilePaths [i].Replace('\\', '/')); 29 | } 30 | foreach (InkFile inkFile in inkLibrary) { 31 | if(inkFile.includePaths.Count > 0) { 32 | inkFile.GetIncludes(inkLibrary); 33 | } 34 | } 35 | foreach (InkFile inkFile in inkLibrary) { 36 | inkFile.FindCompiledJSONAsset(); 37 | } 38 | } 39 | 40 | public static List GetMasterInkFiles () { 41 | List masterInkFiles = new List(); 42 | foreach (InkFile inkFile in inkLibrary) { 43 | if(inkFile.master == null) { 44 | masterInkFiles.Add(inkFile); 45 | } 46 | } 47 | return masterInkFiles; 48 | } 49 | 50 | /// 51 | /// Gets the ink file with path relative to Assets folder, for example: "Assets/Ink/myStory.ink". 52 | /// 53 | /// The ink file with path. 54 | /// Path. 55 | public static InkFile GetInkFileWithPath (string path) { 56 | foreach(InkFile inkFile in inkLibrary) { 57 | if(inkFile.filePath == path) { 58 | return inkFile; 59 | } 60 | } 61 | return null; 62 | } 63 | 64 | /// 65 | /// Gets the ink file with absolute path. 66 | /// 67 | /// The ink file with path. 68 | /// Path. 69 | public static InkFile GetInkFileWithAbsolutePath (string absolutePath) { 70 | foreach(InkFile inkFile in inkLibrary) { 71 | if(inkFile.absoluteFilePath == absolutePath) { 72 | return inkFile; 73 | } 74 | } 75 | return null; 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Ink Library/InkLibrary.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb0d2db055db745819018cfdb3d82ea8 3 | timeCreated: 1459876783 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Player Window.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 76d8510b5dffa4afe814a18428526677 3 | folderAsset: yes 4 | timeCreated: 1459882092 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Player Window/InkPlayerWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf969d7f2c98e470c9797844e20b20ee 3 | timeCreated: 1459342679 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Tools.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c467be9178a5427983a7344e352e0be 3 | folderAsset: yes 4 | timeCreated: 1459878675 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Tools/InkEditorUtils.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.IO; 7 | using System.Diagnostics; 8 | using UnityEditorInternal; 9 | using Debug = UnityEngine.Debug; 10 | using Ink.Runtime; 11 | 12 | namespace Ink.UnityIntegration { 13 | public static class InkEditorUtils { 14 | public const string inkFileExtension = ".ink"; 15 | 16 | [MenuItem("Assets/Create/Ink")] 17 | public static void CreateFile() { 18 | // var icon = AssetDatabase.LoadAssetAtPath("Assets/Plugins/Ink/Resources/InkIcon.png", typeof(Texture2D)) as Texture2D; 19 | // ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance(), "NewFSharpFile.fs", icon, ""); 20 | //.... 21 | //IO stuff to create the file. 22 | // ProjectWindowUtil.ShowCreatedAsset(file); 23 | } 24 | 25 | [MenuItem("Ink/Help/About")] 26 | public static void OpenAbout() { 27 | Application.OpenURL("https://github.com/inkle/ink#ink"); 28 | } 29 | 30 | [MenuItem("Ink/Help/API Documentation...")] 31 | public static void OpenWritingDocumentation() { 32 | Application.OpenURL("https://github.com/inkle/ink/blob/master/Documentation/RunningYourInk.md"); 33 | } 34 | 35 | public static TextAsset CreateStoryStateTextFile (string jsonStoryState, string defaultPath = "Assets/Ink", string defaultName = "storyState") { 36 | string name = AssetDatabase.GenerateUniqueAssetPath(Path.Combine(defaultPath, defaultName+".json")).Substring(defaultPath.Length+1); 37 | string fullPathName = EditorUtility.SaveFilePanel("Save Story State", defaultPath, name, "json"); 38 | if(fullPathName == "") 39 | return null; 40 | using (StreamWriter outfile = new StreamWriter(fullPathName)) { 41 | outfile.Write(jsonStoryState); 42 | } 43 | AssetDatabase.ImportAsset(fullPathName.Substring(Application.dataPath.Length-6)); 44 | TextAsset textAsset = AssetDatabase.LoadAssetAtPath(fullPathName.Substring(Application.dataPath.Length-6)); 45 | return textAsset; 46 | } 47 | 48 | public static bool StoryContainsVariables (Story story) { 49 | return story.variablesState.GetEnumerator().MoveNext(); 50 | } 51 | 52 | public static bool CheckStoryIsValid (string storyJSON, out Exception exception) { 53 | try { 54 | new Story(storyJSON); 55 | } catch (Exception ex) { 56 | exception = ex; 57 | return false; 58 | } 59 | exception = null; 60 | return true; 61 | } 62 | 63 | public static bool CheckStoryIsValid (string storyJSON, out Story story) { 64 | try { 65 | story = new Story(storyJSON); 66 | } catch { 67 | story = null; 68 | return false; 69 | } 70 | return true; 71 | } 72 | 73 | public static bool CheckStoryIsValid (string storyJSON, out Exception exception, out Story story) { 74 | try { 75 | story = new Story(storyJSON); 76 | } catch (Exception ex) { 77 | exception = ex; 78 | story = null; 79 | return false; 80 | } 81 | exception = null; 82 | return true; 83 | } 84 | 85 | public static bool CheckStoryStateIsValid (string storyJSON, string storyStateJSON) { 86 | Story story; 87 | if(CheckStoryIsValid(storyJSON, out story)) { 88 | try { 89 | story.state.LoadJson(storyStateJSON); 90 | } catch { 91 | return false; 92 | } 93 | } 94 | return true; 95 | } 96 | } 97 | } -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Editor/Tools/InkEditorUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eeaeb991395be4e9e9ab83197c649ad8 3 | timeCreated: 1459944754 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Licence.txt: -------------------------------------------------------------------------------- 1 | License 2 | ink is released under the MIT license. Although we don't require attribution, we'd love to know if you decide to use ink a project! Let us know on Twitter or by email. 3 | 4 | Newtonsoft's Json.NET is included, and also has the MIT License. 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2016 inkle Ltd. 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Licence.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab29b77fe08764a52b4670b3baa54ade 3 | timeCreated: 1459887554 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Readme.md: -------------------------------------------------------------------------------- 1 | # ink-Unity integration 2 | 3 | This Unity package allows you to integrate inkle's [ink narrative scripting language](http://www.inklestudios.com/ink) with Unity, and provides tools to help quickly test your stories in-editor. 4 | 5 | Features: 6 | 7 | - **Running ink in game**: Allows usage of JSON-compiled ink files in Unity via the included `ink-engine.dll` (and Json.Net dependency). 8 | 9 | - **Auto Compilation**: Instantly creates and updates a JSON story file when a `.ink` is updated. 10 | 11 | - **Ink Player**: Provides a powerful player window for playing and debugging stories. 12 | 13 | - **Inspector tools**: Provides an icon for ink files, and a custom inspector that provides information about a file. 14 | 15 | 16 | ## Getting started 17 | 18 | * Download the [latest Unity package release](https://github.com/inkle/ink-unity-integration/releases), and add to your Unity project. 19 | * Select one of the sample `.ink` stories included in the package. In Unity's Inspector window, you should see a *Play* button. Click it to open the **ink player** window, useful for playing (previewing) ink stories. 20 | 21 | For more information on **ink**, see [the documentation in the main ink repo](https://github.com/inkle/ink). For convenience, the package also creates an (**Ink > Help**) menu option. 22 | 23 | ## Customisation 24 | 25 | This package is structured modularly. The folders correllating to the features described below can all be safely deleted if their functionality is not required. 26 | 27 | The only files required to play ink in your game is ink-engine and Newtonsoft.Json in the DLL folder. 28 | 29 | The inklecate DLLs used to compile ink are quite large files. You may safely delete the DLLs not corresponding to your current OS, or both of them if not using the compiler. 30 | 31 | ## Using ink in game your game. 32 | 33 | The **ink player** is the core feature of this package; the minimal requirements to actually run a compiled JSON story file are the `ink-engine.dll` and `Newtonsoft.Json.dll` libraries. 34 | 35 | ## Ink Player 36 | 37 | The Ink Player (**Ink > Player Window**) allows you to play stories in an editor window, and provides functionality to edit variables on the fly, save and load states, and divert. 38 | 39 | **Playing a story**: You can play stories by clicking the "Play" button on the inspector of a master ink file, or by manually choosing a compiled ink story TextAsset in the Ink Player window and clicking "Play". You can then use the choice panel to advance the story, and the undo/redo buttons to rewind and test different paths. 40 | 41 | **Saving and restoring story states**: You can save and restore the current state of the story using the save and load buttons in the Story State panel. States are stored as .json files. 42 | 43 | **Diverting to a stitch**: To instantly move to a specific stitch in a story, you can manually enter the path of a stitch in the Divert panel. You need to use the full path of a stitch, including the knot that contains it. For example: "the_orient_express.in_first_class". 44 | 45 | **Editing variables**: The variables panel allows you to view and edit all the story variables. 46 | 47 | ## Automatic compilation 48 | 49 | Ink files must be compiled to JSON before they can be used in-game. 50 | 51 | This package provides tools to automate this process when a .ink file is edited. 52 | 53 | **Disabling auto-compilation**: You might want to have manual control over ink compilation. If this is the case, you can safely delete the InkPostProcessor class. 54 | 55 | **Manual compilation**: If you have disabled auto-compilation, you can manually compile ink using the **Ink > Compile All** menu item, via the inspector of an ink file, or using the functions in the InkCompiler class. 56 | 57 | ## Inspector Tools 58 | 59 | This package also replaces the icon for ink files to make them easier to spot, and populates the inspector for a selected ink file. 60 | 61 | **The Inspector**: To replace the inspector for ink files, we've created a system that allows you to provide a custom inspector for any file. If this conflicts with existing behaviour in your project, you can delete the Ink Inspector folder altogether. 62 | 63 | ## Updating Ink manually 64 | 65 | The ink git repo is updated far more frequently than this asset store package. 66 | 67 | If you're interested in keeping up-to-date with cutting edge features, you can download the [latest releases from the GitHub repo](https://github.com/inkle/ink/releases). 68 | 69 | ## FAQ 70 | 71 | * Is the Linux Unity Editor supported? 72 | 73 | *We haven't implemented it, although it should be easy enough by running inklecate.exe with mono. Take a look at `InkCompiler.cs` if you want to add it.* 74 | 75 | * I'm getting this error: 76 | 77 | Internal compiler error. See the console log for more information. output was: 78 | Unhandled Exception: System.TypeLoadException: Could not load type 'Newtonsoft.Json.Linq.JContainer' from assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.` 79 | 80 | You need to change your API compatibility level from .NET 2.0 subset to .NET 2.0. 81 | -------------------------------------------------------------------------------- /Assets/Plugins/Ink/Readme.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85254203c0564478cab552275fc29e5f 3 | timeCreated: 1459881646 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 835aff129f41744eab8b2309a8210f53 3 | folderAsset: yes 4 | timeCreated: 1457767713 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prefabs/Chevron.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Prefabs/Chevron.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Chevron.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b488a38d9c5f4804be1798096451c61 3 | timeCreated: 1459520983 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Choice Group.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Prefabs/Choice Group.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Choice Group.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d3079b04a8d64dfc8c8e244a3e5b644 3 | timeCreated: 1457889468 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Choice.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Prefabs/Choice.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Choice.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69c7e86886359484ca02ca751a1a33b3 3 | timeCreated: 1457767707 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Content.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Prefabs/Content.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Content.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a6c128d53f574dfb953f2fe55083257 3 | timeCreated: 1457767706 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Empty.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Prefabs/Empty.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Empty.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8cdcc425c610b4d10bce02dd28dd93f7 3 | timeCreated: 1459525728 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SFX.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69cc97e9120e64e0aaf82154d7c19444 3 | folderAsset: yes 4 | timeCreated: 1458050675 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SFX/222549__caderesounds__horror-cinema-2-2014.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/222549__caderesounds__horror-cinema-2-2014.wav -------------------------------------------------------------------------------- /Assets/SFX/222549__caderesounds__horror-cinema-2-2014.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60f518e7a0ea04dcb9d4c223e9bf9957 3 | timeCreated: 1459515602 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 772f1acc2cec84f5fa89c836b0eefe4f 3 | folderAsset: yes 4 | timeCreated: 1459515600 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193945__soundslikewillem__d.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/Key Sounds/193945__soundslikewillem__d.wav -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193945__soundslikewillem__d.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4a76855a65d34ab8b87eb64b879cd0a 3 | timeCreated: 1458050758 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193946__soundslikewillem__c.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/Key Sounds/193946__soundslikewillem__c.wav -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193946__soundslikewillem__c.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1a9c9147e4c54ffa9462af805563b67 3 | timeCreated: 1458050758 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193947__soundslikewillem__b.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/Key Sounds/193947__soundslikewillem__b.wav -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193947__soundslikewillem__b.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e8836e5078d44672a2eb9b3292d6f80 3 | timeCreated: 1458060604 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193948__soundslikewillem__a.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/Key Sounds/193948__soundslikewillem__a.wav -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193948__soundslikewillem__a.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f66f8f5c8ebd4f61bd3946d15d0efc5 3 | timeCreated: 1458060606 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193949__soundslikewillem__h.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/Key Sounds/193949__soundslikewillem__h.wav -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193949__soundslikewillem__h.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a63a6b9e7f1614ba8a4a169ef6de04ad 3 | timeCreated: 1458060608 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193950__soundslikewillem__g.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/Key Sounds/193950__soundslikewillem__g.wav -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193950__soundslikewillem__g.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81eb16bc51ca341de9994db6d3eaec9b 3 | timeCreated: 1458060607 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193951__soundslikewillem__f.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/Key Sounds/193951__soundslikewillem__f.wav -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193951__soundslikewillem__f.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a3e9aea83b5e4e39bab3c32f458dde8 3 | timeCreated: 1458060604 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193952__soundslikewillem__e.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/Key Sounds/193952__soundslikewillem__e.wav -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193952__soundslikewillem__e.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4325484e28fa4454ab00f0f29944a05a 3 | timeCreated: 1458060603 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193953__soundslikewillem__j.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/Key Sounds/193953__soundslikewillem__j.wav -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193953__soundslikewillem__j.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f05a991c5ed4455faea32fc7d345584 3 | timeCreated: 1458060605 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193954__soundslikewillem__i.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/Key Sounds/193954__soundslikewillem__i.wav -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193954__soundslikewillem__i.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f76d62a9ca384523b7a8bb747bdf3d8 3 | timeCreated: 1458060598 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193955__soundslikewillem__w.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/Key Sounds/193955__soundslikewillem__w.wav -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193955__soundslikewillem__w.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d632f93a76785400b81ffd7690571a8e 3 | timeCreated: 1458060614 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193956__soundslikewillem__x.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/Key Sounds/193956__soundslikewillem__x.wav -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193956__soundslikewillem__x.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf55229c4541c4eb99fdffa97a326fad 3 | timeCreated: 1458060613 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193957__soundslikewillem__u.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/Key Sounds/193957__soundslikewillem__u.wav -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193957__soundslikewillem__u.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f143638fcff314503b76143eb4372bf2 3 | timeCreated: 1458060616 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193958__soundslikewillem__v.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/Key Sounds/193958__soundslikewillem__v.wav -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193958__soundslikewillem__v.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c8bfcf0f9f064249875bd2f3115b6a6 3 | timeCreated: 1458060603 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193959__soundslikewillem__y.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/Key Sounds/193959__soundslikewillem__y.wav -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/193959__soundslikewillem__y.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a9d3baba42c334d01a04fe21110a0916 3 | timeCreated: 1458060608 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/_readme_and_license.txt: -------------------------------------------------------------------------------- 1 | Sound pack downloaded from Freesound.org 2 | ---------------------------------------- 3 | 4 | This pack of sounds contains sounds by soundslikewillem ( http://www.freesound.org/people/soundslikewillem/ ) 5 | You can find this pack online at: http://www.freesound.org/people/soundslikewillem/packs/12297/ 6 | 7 | 8 | License details 9 | --------------- 10 | 11 | Sampling+: http://creativecommons.org/licenses/sampling+/1.0/ 12 | Creative Commons 0: http://creativecommons.org/publicdomain/zero/1.0/ 13 | Attribution: http://creativecommons.org/licenses/by/3.0/ 14 | Attribution Noncommercial: http://creativecommons.org/licenses/by-nc/3.0/ 15 | 16 | 17 | Sounds in this pack 18 | ------------------- 19 | 20 | * 193974__soundslikewillem__fixing-paper-in-typewriter-fast.wav 21 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193974/ 22 | * license: Attribution Noncommercial 23 | * 193973__soundslikewillem__fixing-paper-in-typewriter-slow.wav 24 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193973/ 25 | * license: Attribution Noncommercial 26 | * 193972__soundslikewillem__single-typewriter-hits.wav 27 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193972/ 28 | * license: Attribution Noncommercial 29 | * 193971__soundslikewillem__typing-5-lines.wav 30 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193971/ 31 | * license: Attribution Noncommercial 32 | * 193970__soundslikewillem__s.wav 33 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193970/ 34 | * license: Attribution Noncommercial 35 | * 193969__soundslikewillem__t.wav 36 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193969/ 37 | * license: Attribution Noncommercial 38 | * 193968__soundslikewillem__o.wav 39 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193968/ 40 | * license: Attribution Noncommercial 41 | * 193967__soundslikewillem__p.wav 42 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193967/ 43 | * license: Attribution Noncommercial 44 | * 193966__soundslikewillem__q.wav 45 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193966/ 46 | * license: Attribution Noncommercial 47 | * 193965__soundslikewillem__r.wav 48 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193965/ 49 | * license: Attribution Noncommercial 50 | * 193964__soundslikewillem__k.wav 51 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193964/ 52 | * license: Attribution Noncommercial 53 | * 193963__soundslikewillem__l.wav 54 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193963/ 55 | * license: Attribution Noncommercial 56 | * 193962__soundslikewillem__m.wav 57 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193962/ 58 | * license: Attribution Noncommercial 59 | * 193961__soundslikewillem__n.wav 60 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193961/ 61 | * license: Attribution Noncommercial 62 | * 193960__soundslikewillem__z.wav 63 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193960/ 64 | * license: Attribution Noncommercial 65 | * 193959__soundslikewillem__y.wav 66 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193959/ 67 | * license: Attribution Noncommercial 68 | * 193958__soundslikewillem__v.wav 69 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193958/ 70 | * license: Attribution Noncommercial 71 | * 193957__soundslikewillem__u.wav 72 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193957/ 73 | * license: Attribution Noncommercial 74 | * 193956__soundslikewillem__x.wav 75 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193956/ 76 | * license: Attribution Noncommercial 77 | * 193955__soundslikewillem__w.wav 78 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193955/ 79 | * license: Attribution Noncommercial 80 | * 193954__soundslikewillem__i.wav 81 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193954/ 82 | * license: Attribution Noncommercial 83 | * 193953__soundslikewillem__j.wav 84 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193953/ 85 | * license: Attribution Noncommercial 86 | * 193952__soundslikewillem__e.wav 87 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193952/ 88 | * license: Attribution Noncommercial 89 | * 193951__soundslikewillem__f.wav 90 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193951/ 91 | * license: Attribution Noncommercial 92 | * 193950__soundslikewillem__g.wav 93 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193950/ 94 | * license: Attribution Noncommercial 95 | * 193949__soundslikewillem__h.wav 96 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193949/ 97 | * license: Attribution Noncommercial 98 | * 193948__soundslikewillem__a.wav 99 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193948/ 100 | * license: Attribution Noncommercial 101 | * 193947__soundslikewillem__b.wav 102 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193947/ 103 | * license: Attribution Noncommercial 104 | * 193946__soundslikewillem__c.wav 105 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193946/ 106 | * license: Attribution Noncommercial 107 | * 193945__soundslikewillem__d.wav 108 | * url: http://www.freesound.org/people/soundslikewillem/sounds/193945/ 109 | * license: Attribution Noncommercial 110 | 111 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/_readme_and_license.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 983fbd90a6823482c9d2410b6442974e 3 | timeCreated: 1458060607 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/attachingPaper.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/Key Sounds/attachingPaper.mp3 -------------------------------------------------------------------------------- /Assets/SFX/Key Sounds/attachingPaper.mp3.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5da4d52db5d764cb68de1d404346ca2e 3 | timeCreated: 1459501517 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/SFX/looping-dark-ambience.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/SFX/looping-dark-ambience.mp3 -------------------------------------------------------------------------------- /Assets/SFX/looping-dark-ambience.mp3.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 047afe3aad0f94d4799a847928383ce3 3 | timeCreated: 1459515924 4 | licenseType: Pro 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bad937f39dfce435fa77ff817a4009f6 3 | folderAsset: yes 4 | timeCreated: 1457765530 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/Demo.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkle/the-intercept/2a816b56e61ce4bf02bec1c638074645bdd871e3/Assets/Scenes/Demo.unity -------------------------------------------------------------------------------- /Assets/Scenes/Demo.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6372090b808f944d2b6ea2411db96314 3 | timeCreated: 1457766091 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10cb2de67dabc4085a15b7ab5dece59d 3 | folderAsset: yes 4 | timeCreated: 1457765530 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Audio.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51825df4bbc9e448080d485239e2be4f 3 | folderAsset: yes 4 | timeCreated: 1459435022 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Audio/AudioClipDatabase.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | public class AudioClipDatabase : MonoSingleton { 6 | public List keySounds; 7 | public AudioClip attachingPaperSound; 8 | public AudioClip horrorSting; 9 | 10 | public void PlayKeySound () { 11 | PlaySound(keySounds[Random.Range(0, keySounds.Count)]); 12 | } 13 | 14 | public void PlayAttachingPaperSound () { 15 | PlaySound(attachingPaperSound); 16 | } 17 | 18 | public void PlayHorrorSting () { 19 | PlaySound(horrorSting); 20 | } 21 | 22 | private void PlaySound (AudioClip audioClip, float volume = 1) { 23 | GameObject tempGO = new GameObject("Audio: "+audioClip.name); // create the temp object 24 | tempGO.transform.SetParent(transform); 25 | AudioSource audioSource = tempGO.AddComponent(); // add an audio source 26 | audioSource.clip = audioClip; // define the clip 27 | audioSource.spatialBlend = 0; 28 | audioSource.Play(); // start the sound 29 | Destroy(tempGO, audioClip.length); // destroy object after clip duration 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Assets/Scripts/Audio/AudioClipDatabase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57f5e4ebc399f40dca22d59b53b1b174 3 | timeCreated: 1459515908 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Audio/BackgroundAmbienceController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | [RequireComponent(typeof(AudioSource))] 5 | public class BackgroundAmbienceController : MonoBehaviour { 6 | 7 | private AudioSource audioSource { 8 | get { 9 | return GetComponent(); 10 | } 11 | } 12 | 13 | public FloatTween volumeTween = new FloatTween(); 14 | 15 | public float quietVolume = 0.1f; 16 | public float normalVolume = 0.2f; 17 | 18 | public void QuietMode () { 19 | StopAllCoroutines(); 20 | volumeTween.Tween(audioSource.volume, quietVolume, 1, AnimationCurve.EaseInOut(0,0,1,1)); 21 | } 22 | 23 | public void NormalMode () { 24 | StopAllCoroutines(); 25 | volumeTween.Tween(audioSource.volume, normalVolume, 1, AnimationCurve.EaseInOut(0,0,1,1)); 26 | } 27 | 28 | private void Awake () { 29 | audioSource.volume = 0; 30 | volumeTween.OnChange += OnChangeVolumeTween; 31 | } 32 | 33 | private void Start () { 34 | StartCoroutine(DelayedStart()); 35 | } 36 | 37 | private IEnumerator DelayedStart () { 38 | audioSource.volume = 0; 39 | yield return new WaitForSeconds(4); 40 | volumeTween.Tween(audioSource.volume, normalVolume, 12, AnimationCurve.EaseInOut(0,0,1,1)); 41 | } 42 | 43 | private void Update () { 44 | volumeTween.Loop(Time.unscaledDeltaTime); 45 | } 46 | 47 | private void OnChangeVolumeTween (float currentValue) { 48 | audioSource.volume = currentValue; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Assets/Scripts/Audio/BackgroundAmbienceController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db7e041607c3142509fd6239564485f2 3 | timeCreated: 1459516743 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/ContentManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections; 4 | using UnityEngine.EventSystems; 5 | 6 | public class ContentManager : UIMonoBehaviour, IBeginDragHandler { 7 | 8 | public RectTransform canvasRectTransform { 9 | get { 10 | return (RectTransform)GetComponentInParent().transform; 11 | } 12 | } 13 | 14 | public VerticalLayoutGroup layoutGroup; 15 | public ScrollRect scrollRect; 16 | 17 | public float minY; 18 | public float maxY; 19 | 20 | public Vector2Tween tween = new Vector2Tween(); 21 | public Vector2 tweenRemaining { 22 | get { 23 | if(!tween.tweening) return Vector2.zero; 24 | return tween.targetValue - tween.currentValue; 25 | } 26 | } 27 | 28 | public Image paperImage; 29 | 30 | public float paperTopSpacingCanvasHeightFraction = 0.2f; 31 | public float paperBottomSpacingCanvasHeightFraction = 0.25f; 32 | public int paperBottomOffset = 100; 33 | 34 | private float targetY; 35 | private float lastLayoutGroupSize; 36 | 37 | bool contentLargerThanArea { 38 | get { 39 | return scrollRect.content.sizeDelta.y > canvasRectTransform.sizeDelta.y + paperBottomOffset; 40 | } 41 | } 42 | 43 | bool showChoices; 44 | public float scrollDistanceUntilHidingChoices = 100; 45 | 46 | private void Awake () { 47 | tween.OnChange += OnChange; 48 | ResetContent(); 49 | } 50 | 51 | void OnChange (Vector2 currentValue) { 52 | scrollRect.content.anchoredPosition = currentValue; 53 | } 54 | 55 | private void OnEnable () { 56 | ResetContent(); 57 | } 58 | 59 | private void OnDisable () { 60 | ResetContent(); 61 | } 62 | 63 | private void ResetContent () { 64 | rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, 0); 65 | rectTransform.anchoredPosition = new Vector2(0, 0); 66 | lastLayoutGroupSize = ((RectTransform)layoutGroup.transform).sizeDelta.y; 67 | paperImage.rectTransform.anchoredPosition = new Vector2(paperImage.rectTransform.anchoredPosition.x, 0); 68 | } 69 | 70 | public void ScrollToBottom (float time = 2f) { 71 | Vector2 targetScroll = new Vector2(scrollRect.content.anchoredPosition.x, scrollRect.content.sizeDelta.y - paperBottomOffset); 72 | tween.Tween(scrollRect.content.anchoredPosition, targetScroll, time, AnimationCurve.EaseInOut(0,0,1,1)); 73 | } 74 | 75 | void Update () { 76 | if (tween.tweening) { 77 | tween.Loop(); 78 | } 79 | } 80 | 81 | 82 | void LateUpdate () { 83 | UpdateAutoScroll(); 84 | UpdatePaperSize (); 85 | ClampScrollRect(); 86 | 87 | bool newShowChoices = maxY - scrollDistanceUntilHidingChoices < scrollRect.content.anchoredPosition.y || tween.tweening || !contentLargerThanArea; 88 | if(showChoices != newShowChoices) { 89 | showChoices = newShowChoices; 90 | if(showChoices) { 91 | Main.Instance.gameState.choiceContainerView.FadeIn(); 92 | Main.Instance.gameState.scrollToBottomButton.FadeOut(); 93 | } else { 94 | Main.Instance.gameState.choiceContainerView.FadeOut(); 95 | Main.Instance.gameState.scrollToBottomButton.FadeIn(); 96 | } 97 | } 98 | } 99 | 100 | void UpdateAutoScroll () { 101 | float newLayoutGroupSize = ((RectTransform)layoutGroup.transform).sizeDelta.y; 102 | if(newLayoutGroupSize > lastLayoutGroupSize) { 103 | rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, newLayoutGroupSize); 104 | lastLayoutGroupSize = newLayoutGroupSize; 105 | ScrollToBottom(); 106 | } 107 | } 108 | 109 | void UpdatePaperSize () { 110 | float canvasHeight = canvasRectTransform.sizeDelta.y; 111 | layoutGroup.padding = new RectOffset(layoutGroup.padding.left, layoutGroup.padding.right, Mathf.RoundToInt(canvasHeight * paperTopSpacingCanvasHeightFraction), Mathf.RoundToInt(canvasHeight * paperBottomSpacingCanvasHeightFraction) + paperBottomOffset); 112 | paperImage.rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, Mathf.Max(rectTransform.sizeDelta.y, paperImage.sprite.texture.height)); 113 | paperImage.rectTransform.anchoredPosition = new Vector2(paperImage.rectTransform.anchoredPosition.x, paperImage.rectTransform.sizeDelta.y * 0.5f); 114 | // A hack to prevent the paper appearing on the first frame when we enter game mode 115 | paperImage.enabled = paperImage.rectTransform.sizeDelta.y != paperImage.sprite.texture.height; 116 | } 117 | 118 | void ClampScrollRect () { 119 | scrollRect.vertical = contentLargerThanArea; 120 | if(contentLargerThanArea) { 121 | minY = canvasRectTransform.sizeDelta.y * 0.75f; 122 | maxY = scrollRect.content.sizeDelta.y - paperBottomOffset; 123 | } else { 124 | minY = 0; 125 | maxY = scrollRect.content.sizeDelta.y; 126 | } 127 | 128 | float newY = Mathf.Clamp(scrollRect.content.anchoredPosition.y, minY, maxY); 129 | scrollRect.content.anchoredPosition = new Vector2(scrollRect.content.anchoredPosition.x, newY); 130 | if (scrollRect.content.anchoredPosition.y >= maxY && scrollRect.velocity.y > 0) 131 | scrollRect.velocity = new Vector2(scrollRect.velocity.x, 0); 132 | else if (scrollRect.content.anchoredPosition.y <= minY && scrollRect.velocity.y < 0) 133 | scrollRect.velocity = new Vector2(scrollRect.velocity.x, 0); 134 | } 135 | 136 | public void OnBeginDrag (PointerEventData eventData) { 137 | if(contentLargerThanArea) 138 | tween.Stop(); 139 | } 140 | 141 | public void OnDrag (PointerEventData eventData) { 142 | if(!contentLargerThanArea) 143 | return; 144 | if (scrollRect.content.anchoredPosition.y >= maxY && eventData.delta.y > 0) 145 | return; 146 | else if (scrollRect.content.anchoredPosition.y <= minY && eventData.delta.y < 0) 147 | return; 148 | } 149 | } -------------------------------------------------------------------------------- /Assets/Scripts/ContentManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 38a3104349a9f42dfbad178106393e62 3 | timeCreated: 1459417916 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/DeviceScaler.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections; 4 | 5 | public class DeviceScaler : MonoBehaviour { 6 | 7 | public DeviceScaleSettings handheldScaleSettings; 8 | public DeviceScaleSettings desktopScaleSettings; 9 | 10 | public CanvasScaler[] canvasScalers; 11 | 12 | void Update () { 13 | DeviceScaleSettings currentSettings = SystemInfo.deviceType == DeviceType.Handheld ? handheldScaleSettings : desktopScaleSettings; 14 | foreach(CanvasScaler canvasScaler in canvasScalers) { 15 | canvasScaler.uiScaleMode = currentSettings.uiScaleMode; 16 | canvasScaler.scaleFactor = currentSettings.scaleFactor; 17 | canvasScaler.referenceResolution = currentSettings.referenceResolution; 18 | canvasScaler.matchWidthOrHeight = currentSettings.matchWidthOrHeight; 19 | } 20 | } 21 | 22 | [System.Serializable] 23 | public class DeviceScaleSettings { 24 | public CanvasScaler.ScaleMode uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize; 25 | public Vector2 referenceResolution = new Vector2(800, 600); 26 | public float matchWidthOrHeight = 0.5f; 27 | public float scaleFactor = 1f; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Assets/Scripts/DeviceScaler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94a2c38eb826748c5a292639453eb3e0 3 | timeCreated: 1459629284 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Main.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ec9b0e460a4a44889eef90e94a9740a 3 | folderAsset: yes 4 | timeCreated: 1459427340 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Main/Main.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Main : MonoSingleton
{ 5 | [Header("Skips the intro (editor only)")] 6 | public bool skipIntro = false; 7 | public bool fastIntro = false; 8 | 9 | [HideInInspector] 10 | public MainState currentState; 11 | public IntroState introState; 12 | public GameState gameState; 13 | public EndState endState; 14 | 15 | private bool _paused = false; 16 | public bool paused { 17 | get { 18 | return _paused; 19 | } 20 | set { 21 | if(_paused == value) 22 | return; 23 | _paused = value; 24 | Time.timeScale = _paused ? 0 : 1; 25 | if(paused) { 26 | gameState.settingsView.Show(); 27 | backgroundAmbienceController.QuietMode(); 28 | } else { 29 | gameState.settingsView.Hide(); 30 | backgroundAmbienceController.NormalMode(); 31 | } 32 | } 33 | } 34 | 35 | public BackgroundAmbienceController backgroundAmbienceController; 36 | public CreditsView creditsView; 37 | 38 | void Awake () { 39 | introState.OnComplete += OnCompleteIntro; 40 | gameState.OnComplete += OnCompleteGame; 41 | endState.OnComplete += OnCompleteEndState; 42 | 43 | creditsView.Hide(); 44 | } 45 | 46 | void Start () { 47 | if(skipIntro && Application.isEditor) { 48 | OnCompleteIntro(); 49 | } else { 50 | ChangeState(introState); 51 | if(fastIntro && Application.isEditor) 52 | introState.PlayShortIntro(); 53 | else 54 | introState.PlayLongIntro(); 55 | } 56 | } 57 | 58 | void OnCompleteIntro () { 59 | ChangeState(gameState); 60 | } 61 | 62 | void OnCompleteGame () { 63 | ChangeState(endState); 64 | } 65 | 66 | void OnCompleteEndState () { 67 | Restart(); 68 | } 69 | 70 | void ChangeState (MainState state) { 71 | if(currentState != null) { 72 | currentState.Exit(); 73 | } 74 | currentState = state; 75 | currentState.Enter(); 76 | } 77 | 78 | public void Restart () { 79 | introState.StopAllCoroutines(); 80 | gameState.Clear(); 81 | paused = false; 82 | ChangeState(introState); 83 | introState.PlayLongIntro(); 84 | } 85 | 86 | public void Quit () { 87 | Application.Quit(); 88 | } 89 | } -------------------------------------------------------------------------------- /Assets/Scripts/Main/Main.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3b96599e2657435f92b4a63b2996703 3 | timeCreated: 1459427306 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Main/States.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15c43783c0bf0414c969bf0bccebc0c0 3 | folderAsset: yes 4 | timeCreated: 1459502927 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Main/States/End.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba6a96f8e13a149788ff532b8fe76f51 3 | folderAsset: yes 4 | timeCreated: 1459502921 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Main/States/End/EndState.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class EndState : MainState { 5 | public EndView endView; 6 | 7 | private void Awake () { 8 | endView.Init(); 9 | } 10 | 11 | public override void Enter () { 12 | base.Enter (); 13 | AudioClipDatabase.Instance.PlayHorrorSting(); 14 | endView.Show(); 15 | Main.Instance.backgroundAmbienceController.QuietMode(); 16 | } 17 | 18 | public override void Exit () { 19 | base.Exit (); 20 | endView.Hide(); 21 | Main.Instance.backgroundAmbienceController.NormalMode(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Assets/Scripts/Main/States/End/EndState.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13aad83772f2645078c9cf9262faba2a 3 | timeCreated: 1459498231 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Main/States/End/View.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58880261d75d342918303af8eb1fa8fb 3 | folderAsset: yes 4 | timeCreated: 1459454933 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Main/States/End/View/EndRestartButton.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class EndRestartButton : MonoBehaviour { 5 | 6 | public void OnClickRestartButton () { 7 | Main.Instance.endState.Complete(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Main/States/End/View/EndRestartButton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c95a16174c70540d3a93bcd7b5b1bf22 3 | timeCreated: 1459455029 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Main/States/End/View/EndView.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | using System.Collections; 4 | 5 | [RequireComponent(typeof(CanvasGroup))] 6 | public class EndView : MonoBehaviour { 7 | 8 | private CanvasGroup canvasGroup { 9 | get { 10 | return GetComponent(); 11 | } 12 | } 13 | 14 | public FloatTween alphaTween = new FloatTween(); 15 | 16 | public void Init () { 17 | Hide(); 18 | alphaTween.OnChange += OnChangeAlphaTween; 19 | } 20 | 21 | void OnChangeAlphaTween (float currentValue) { 22 | canvasGroup.alpha = alphaTween.currentValue; 23 | } 24 | 25 | void Update () { 26 | alphaTween.Loop(); 27 | } 28 | 29 | public void Show () { 30 | canvasGroup.alpha = 0; 31 | alphaTween.Tween(canvasGroup.alpha, 1, 2, AnimationCurve.EaseInOut(0,0,1,1)); 32 | gameObject.SetActive(true); 33 | } 34 | 35 | public void Hide () { 36 | canvasGroup.alpha = 0; 37 | gameObject.SetActive(false); 38 | } 39 | } -------------------------------------------------------------------------------- /Assets/Scripts/Main/States/End/View/EndView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 208375e9393e14bf98209e789cde3a52 3 | timeCreated: 1459454939 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Main/States/Game.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8449cfcf5772049df95b27259549ba2b 3 | folderAsset: yes 4 | timeCreated: 1459502920 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Main/States/Game/GameState.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using Ink.Runtime; 6 | using UnityEngine.UI; 7 | 8 | using Debug = UnityEngine.Debug; 9 | 10 | public class GameState : MainState { 11 | 12 | // The json compiled ink story 13 | public TextAsset storyJSON; 14 | // The ink runtime story object 15 | private Story story; 16 | 17 | public ContentManager contentManager; 18 | 19 | public ContentView contentViewPrefab; 20 | public ChoiceGroupView choiceGroupViewPrefab; 21 | public ChevronButtonView chevronViewPrefab; 22 | public EmptyView emptyViewPrefab; 23 | 24 | public Transform contentParent; 25 | public ChoiceGroupContainerView choiceContainerView; 26 | 27 | public ScrollToBottomButtonView scrollToBottomButton; 28 | 29 | public bool hasMadeAChoice = false; 30 | 31 | public SettingsView settingsView; 32 | public SettingsButton settingsButton; 33 | 34 | private void Awake () { 35 | contentManager.enabled = false; 36 | settingsView.Hide(); 37 | settingsButton.Hide(); 38 | } 39 | 40 | public override void Enter () { 41 | base.Enter (); 42 | contentManager.enabled = true; 43 | settingsButton.FadeIn(); 44 | 45 | if(storyJSON == null) { 46 | Debug.LogWarning("Drag a valid story JSON file into the StoryReader component."); 47 | enabled = false; 48 | } 49 | story = new Story(storyJSON.text); 50 | StartCoroutine(OnAdvanceStory()); 51 | } 52 | 53 | public void Clear () { 54 | StopAllCoroutines(); 55 | ClearContent(); 56 | choiceContainerView.Clear(); 57 | contentManager.enabled = false; 58 | settingsButton.Hide(); 59 | settingsView.Hide(); 60 | } 61 | 62 | private void ClearContent () { 63 | for (int i = contentParent.childCount-1; i >= 0; i--) { 64 | Destroy(contentParent.GetChild(i).gameObject); 65 | } 66 | } 67 | 68 | IEnumerator OnAdvanceStory () { 69 | if(story.canContinue) { 70 | ChoiceGroupView choiceView = null; 71 | ChevronButtonView chevronView = null; 72 | while(story.canContinue) { 73 | string content = story.Continue().Trim(); 74 | ContentView contentView = CreateContentView(content); 75 | if(!story.canContinue) { 76 | if(story.currentChoices.Count > 0) { 77 | choiceView = CreateChoiceGroupView(story.currentChoices); 78 | } else { 79 | chevronView = CreateChevronView(); 80 | } 81 | 82 | } 83 | while(contentView.textTyper.typing) 84 | yield return null; 85 | if(story.canContinue) 86 | yield return new WaitForSeconds(Mathf.Min(1.0f, contentView.textTyper.targetText.Length * 0.01f)); 87 | } 88 | if(story.currentChoices.Count > 0) { 89 | yield return new WaitForSeconds(1f); 90 | choiceView.RenderChoices(); 91 | yield return new WaitForSeconds(0.5f); 92 | } else { 93 | chevronView.Render(); 94 | yield return new WaitForSeconds(2); 95 | } 96 | } else { 97 | yield return new WaitForSeconds(2); 98 | CreateChevronView(); 99 | } 100 | } 101 | 102 | public void ChooseChoiceIndex (int choiceIndex) { 103 | DestroyEmpties(); 104 | story.ChooseChoiceIndex(choiceIndex); 105 | hasMadeAChoice = true; 106 | StartCoroutine(OnAdvanceStory()); 107 | } 108 | 109 | private void DestroyEmpties () { 110 | EmptyView[] emptyViews = contentParent.GetComponentsInChildren(); 111 | for (int i = emptyViews.Length-1; i >= 0; i--) { 112 | Destroy(emptyViews[i].gameObject); 113 | } 114 | } 115 | 116 | public void ClickChevronButton () { 117 | Complete(); 118 | } 119 | 120 | ContentView CreateContentView (string content) { 121 | ContentView contentView = Instantiate(contentViewPrefab); 122 | contentView.transform.SetParent(contentParent, false); 123 | contentView.LayoutText(content); 124 | return contentView; 125 | } 126 | 127 | ChoiceGroupView CreateChoiceGroupView (IList choices) { 128 | ChoiceGroupView choiceGroupView = Instantiate(choiceGroupViewPrefab); 129 | choiceGroupView.transform.SetParent(choiceContainerView.transform, false); 130 | choiceGroupView.LayoutChoices(choices); 131 | CreateEmptyView(choiceGroupView.rectTransform.sizeDelta.y); 132 | return choiceGroupView; 133 | } 134 | 135 | ChevronButtonView CreateChevronView () { 136 | ChevronButtonView chevronView = Instantiate(chevronViewPrefab); 137 | chevronView.transform.SetParent(choiceContainerView.transform, false); 138 | CreateEmptyView(chevronView.rectTransform.sizeDelta.y); 139 | return chevronView; 140 | } 141 | 142 | EmptyView CreateEmptyView (float height) { 143 | EmptyView emptyView = Instantiate(emptyViewPrefab); 144 | emptyView.transform.SetParent(contentParent, false); 145 | emptyView.layoutElement.preferredHeight = height; 146 | return emptyView; 147 | } 148 | } -------------------------------------------------------------------------------- /Assets/Scripts/Main/States/Game/GameState.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2892bd9c52b0242848462e561438e4fd 3 | timeCreated: 1459427326 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Main/States/Game/View.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd40b816a44cc484db1dfdf62df7a6f2 3 | folderAsset: yes 4 | timeCreated: 1457767317 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Main/States/Game/View/ChevronButtonView.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.UI; 4 | using Ink.Runtime; 5 | 6 | [RequireComponent(typeof(Button))] 7 | public class ChevronButtonView : StoryElementView { 8 | 9 | public Image image { 10 | get { 11 | return GetComponent(); 12 | } 13 | } 14 | public Button button { 15 | get { 16 | return GetComponent