public override void OnEnable()
        {
            InkCompiler.OnCompileInk += OnCompileInk;
            InkLibrary.Refresh();
            string assetPath = AssetDatabase.GetAssetPath(target);

            inkFile = InkLibrary.GetInkFileWithPath(assetPath);
            if (inkFile == null)
            {
                return;
            }
            InkFile masterInkFile = inkFile;

            if (inkFile.master == null)
            {
                if (inkFile.includes != null)
                {
                    CreateIncludeList();
                }
            }
            else
            {
                masterInkFile = inkFile.master;
            }
//			CreateTODOList();

            if (inkFile.jsonAsset != null)
            {
                // This can be slow. Disable if you find viewing an ink file in the inspector takes too long.
                InkEditorUtils.CheckStoryIsValid(masterInkFile.jsonAsset.text, out exception);
            }
        }
Example #2
0
 void Play(string storyJSON)
 {
     if (!InkEditorUtils.CheckStoryIsValid(storyJSON, out errors))
     {
         return;
     }
     this.storyJSONTextAsset = null;
     this.storyJSON          = storyJSON;
     PlayInternal();
 }
Example #3
0
 void Play(TextAsset storyJSONTextAsset)
 {
     if (!InkEditorUtils.CheckStoryIsValid(storyJSONTextAsset.text, out errors))
     {
         return;
     }
     this.storyJSONTextAsset = storyJSONTextAsset;
     storyJSON = this.storyJSONTextAsset.text;
     PlayInternal();
 }
 void Play(string storyJSON)
 {
     if (!InkEditorUtils.CheckStoryIsValid(storyJSON, out errors))
     {
         return;
     }
     this.storyJSONTextAsset = null;
     this.storyJSON          = storyJSON;
     InitStory();
     TryContinue();
 }
 void Play(TextAsset storyJSONTextAsset)
 {
     if (!InkEditorUtils.CheckStoryIsValid(storyJSONTextAsset.text, out errors))
     {
         return;
     }
     this.storyJSONTextAsset = storyJSONTextAsset;
     storyJSON = this.storyJSONTextAsset.text;
     InitStory();
     TryContinue();
 }