Committed everything

This commit is contained in:
2021-06-30 21:39:19 +10:00
commit fcfa8e7213
525 changed files with 49440 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
using UnityEngine;
using UnityEditor;
using UnityEditor.Build;
using System.Text;
using Ink.UnityIntegration;
using System.Linq;
#if UNITY_2018_1_OR_NEWER
using UnityEditor.Build.Reporting;
#endif
class InkPreBuildValidationCheck :
#if UNITY_2018_1_OR_NEWER
IPreprocessBuildWithReport
#else
IPreprocessBuild
#endif
{
public int callbackOrder { get { return 0; } }
#if UNITY_2018_1_OR_NEWER
public void OnPreprocessBuild(BuildReport report) {
PreprocessValidationStep();
}
#else
public void OnPreprocessBuild(BuildTarget target, string path) {
PreprocessValidationStep();
}
#endif
static void PreprocessValidationStep () {
AssertNotCompiling();
CheckForInvalidFiles();
}
static void AssertNotCompiling () {
if(InkCompiler.compiling) {
StringBuilder sb = new StringBuilder("Ink is currently compiling!");
var errorString = sb.ToString();
InkCompiler.buildBlocked = true;
if(UnityEditor.EditorUtility.DisplayDialog("Ink Build Error!", errorString, "Ok")) {
Debug.LogError(errorString);
}
}
}
// When syncronous compilation is allowed we should try to replace this error with a compile.
static void CheckForInvalidFiles () {
var filesToRecompile = InkLibrary.GetFilesRequiringRecompile();
if(filesToRecompile.Any()) {
StringBuilder sb = new StringBuilder();
sb.AppendLine("There are Ink files which should be compiled, but appear not to be. You can resolve this by either:");
sb.AppendLine(" - Compiling your files via 'Assets/Recompile Ink'");
var resolveStep = " - Disabling 'Compile Automatically' "+(InkSettings.instance.compileAutomatically ? "in your Ink Settings file" : "for each of the files listed below");
sb.AppendLine(resolveStep);
sb.AppendLine();
sb.AppendLine("Files:");
var filesAsString = string.Join(", ", filesToRecompile.Select(x => x.filePath).ToArray());
sb.AppendLine(filesAsString);
var errorString = sb.ToString();
if(!UnityEditor.EditorUtility.DisplayDialog("Ink Build Error!", errorString, "Build anyway", "Cancel build")) {
Debug.LogError(errorString);
} else {
Debug.LogWarning(errorString);
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 260430d96c5f0aa46a31363984dc9088
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: