refactor: Update Unity to 2022.3.62
This commit is contained in:
@@ -36,10 +36,10 @@ namespace Cryville.Crtr {
|
||||
public static SimpleSequencerSource AudioSequencer;
|
||||
public static SimpleSequencerSession AudioSession;
|
||||
public static InputManager InputManager;
|
||||
public static readonly NetworkTaskWorker NetworkTaskWorker = new NetworkTaskWorker();
|
||||
public static readonly NetworkTaskWorker NetworkTaskWorker = new();
|
||||
|
||||
public static readonly JsonSerializerSettings GlobalJsonSerializerSettings
|
||||
= new JsonSerializerSettings() {
|
||||
= new() {
|
||||
DefaultValueHandling = DefaultValueHandling.Ignore,
|
||||
};
|
||||
|
||||
@@ -168,10 +168,9 @@ namespace Cryville.Crtr {
|
||||
if (!dir.Exists || Settings.Default.LastRunVersion != Application.version) {
|
||||
Directory.CreateDirectory(dir.FullName);
|
||||
var defaultData = Resources.Load<TextAsset>("default");
|
||||
using (var zip = ZipFile.Read(defaultData.bytes)) {
|
||||
zip.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently;
|
||||
zip.ExtractAll(Settings.Default.GameDataPath);
|
||||
}
|
||||
using var zip = ZipFile.Read(defaultData.bytes);
|
||||
zip.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently;
|
||||
zip.ExtractAll(Settings.Default.GameDataPath);
|
||||
}
|
||||
|
||||
Settings.Default.LastRunVersion = Application.version;
|
||||
@@ -193,18 +192,16 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
|
||||
static readonly Encoding _encoding = new UTF8Encoding(false, true);
|
||||
static readonly XmlReaderSettings _xmlSettings = new XmlReaderSettings {
|
||||
static readonly XmlReaderSettings _xmlSettings = new() {
|
||||
DtdProcessing = DtdProcessing.Ignore,
|
||||
};
|
||||
static XDocument LoadXmlDocument(string path) {
|
||||
return LoadXmlDocument(Resources.Load<TextAsset>(path));
|
||||
}
|
||||
static XDocument LoadXmlDocument(TextAsset asset) {
|
||||
using (var stream = new MemoryStream(_encoding.GetBytes(asset.text))) {
|
||||
using (var reader = XmlReader.Create(stream, _xmlSettings)) {
|
||||
return XDocument.Load(reader);
|
||||
}
|
||||
}
|
||||
using var stream = new MemoryStream(_encoding.GetBytes(asset.text));
|
||||
using var reader = XmlReader.Create(stream, _xmlSettings);
|
||||
return XDocument.Load(reader);
|
||||
}
|
||||
|
||||
static bool _shutdown;
|
||||
@@ -233,15 +230,13 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
|
||||
static void OnInternalLog(string condition, string stackTrace, LogType type) {
|
||||
int l;
|
||||
switch (type) {
|
||||
case LogType.Log: l = 1; break;
|
||||
case LogType.Assert: l = 2; break;
|
||||
case LogType.Warning: l = 3; break;
|
||||
case LogType.Error:
|
||||
case LogType.Exception: l = 4; break;
|
||||
default: l = 1; break;
|
||||
}
|
||||
var l = type switch {
|
||||
LogType.Log => 1,
|
||||
LogType.Assert => 2,
|
||||
LogType.Warning => 3,
|
||||
LogType.Error or LogType.Exception => 4,
|
||||
_ => 1,
|
||||
};
|
||||
MainLogger.Log(l, "Internal", "{0}\n{1}", condition, stackTrace);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user