Compare commits
14 Commits
0.7.1
...
a284edd130
Author | SHA1 | Date | |
---|---|---|---|
a284edd130 | |||
b57959b4bf | |||
724cb10bc1 | |||
97e759f57d | |||
3ce8ad72ed | |||
c23d79e3f5 | |||
71294db3c1 | |||
825818679c | |||
84acb2c12d | |||
9c034c0f7b | |||
aa7452aead | |||
f86562b2f2 | |||
8fa2bd1e81 | |||
1f58390298 |
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
|
#pragma warning disable IDE0049
|
||||||
namespace Cryville.Common.Font {
|
namespace Cryville.Common.Font {
|
||||||
public abstract class FontTable<T> {
|
public abstract class FontTable<T> {
|
||||||
protected UInt32 Offset { get; private set; }
|
protected UInt32 Offset { get; private set; }
|
||||||
@@ -25,14 +26,17 @@ namespace Cryville.Common.Font {
|
|||||||
readonly UInt16 minorVersion;
|
readonly UInt16 minorVersion;
|
||||||
readonly UInt32 numFonts;
|
readonly UInt32 numFonts;
|
||||||
readonly List<UInt32> tableDirectoryOffsets = new List<UInt32>();
|
readonly List<UInt32> tableDirectoryOffsets = new List<UInt32>();
|
||||||
|
#pragma warning disable IDE0052 // Reserved
|
||||||
readonly String dsigTag;
|
readonly String dsigTag;
|
||||||
readonly UInt32 dsigLength;
|
readonly UInt32 dsigLength;
|
||||||
readonly UInt32 dsigOffset;
|
readonly UInt32 dsigOffset;
|
||||||
|
#pragma warning restore IDE0052 // Reserved
|
||||||
public TTCHeader(BinaryReader reader, UInt32 offset) : base(reader, offset) {
|
public TTCHeader(BinaryReader reader, UInt32 offset) : base(reader, offset) {
|
||||||
ttcTag = reader.ReadTag();
|
ttcTag = reader.ReadTag();
|
||||||
if (ttcTag != "ttcf") throw new NotImplementedException();
|
if (ttcTag != "ttcf") throw new NotSupportedException();
|
||||||
majorVersion = reader.ReadUInt16();
|
majorVersion = reader.ReadUInt16();
|
||||||
minorVersion = reader.ReadUInt16();
|
minorVersion = reader.ReadUInt16();
|
||||||
|
if (minorVersion != 0) throw new NotSupportedException();
|
||||||
numFonts = reader.ReadUInt32();
|
numFonts = reader.ReadUInt32();
|
||||||
for (UInt32 i = 0; i < numFonts; i++) tableDirectoryOffsets.Add(reader.ReadUInt32());
|
for (UInt32 i = 0; i < numFonts; i++) tableDirectoryOffsets.Add(reader.ReadUInt32());
|
||||||
if (majorVersion == 2) {
|
if (majorVersion == 2) {
|
||||||
@@ -52,12 +56,16 @@ namespace Cryville.Common.Font {
|
|||||||
public sealed class TableDirectory : FontTable<TableRecord, object> {
|
public sealed class TableDirectory : FontTable<TableRecord, object> {
|
||||||
readonly UInt32 sfntVersion;
|
readonly UInt32 sfntVersion;
|
||||||
readonly UInt16 numTables;
|
readonly UInt16 numTables;
|
||||||
|
#pragma warning disable IDE0052 // Reserved
|
||||||
readonly UInt16 searchRange;
|
readonly UInt16 searchRange;
|
||||||
readonly UInt16 entrySelector;
|
readonly UInt16 entrySelector;
|
||||||
readonly UInt16 rangeShift;
|
readonly UInt16 rangeShift;
|
||||||
|
#pragma warning restore IDE0052 // Reserved
|
||||||
readonly List<TableRecord> tableRecords = new List<TableRecord>();
|
readonly List<TableRecord> tableRecords = new List<TableRecord>();
|
||||||
public TableDirectory(BinaryReader reader, UInt32 offset) : base(reader, offset) {
|
public TableDirectory(BinaryReader reader, UInt32 offset) : base(reader, offset) {
|
||||||
sfntVersion = reader.ReadUInt32();
|
sfntVersion = reader.ReadUInt32();
|
||||||
|
if (sfntVersion != 0x00010000 && sfntVersion != 0x4F54544F &&
|
||||||
|
sfntVersion != 0x74727565 && sfntVersion != 0x74797031) throw new NotSupportedException();
|
||||||
numTables = reader.ReadUInt16();
|
numTables = reader.ReadUInt16();
|
||||||
searchRange = reader.ReadUInt16();
|
searchRange = reader.ReadUInt16();
|
||||||
entrySelector = reader.ReadUInt16();
|
entrySelector = reader.ReadUInt16();
|
||||||
@@ -99,48 +107,63 @@ namespace Cryville.Common.Font {
|
|||||||
count = reader.ReadUInt16();
|
count = reader.ReadUInt16();
|
||||||
storageOffset = reader.ReadUInt16();
|
storageOffset = reader.ReadUInt16();
|
||||||
for (UInt16 i = 0; i < count; i++)
|
for (UInt16 i = 0; i < count; i++)
|
||||||
nameRecord.Add(new NameRecord {
|
nameRecord.Add(new NameRecord(
|
||||||
platformID = reader.ReadUInt16(),
|
reader.ReadUInt16(),
|
||||||
encodingID = reader.ReadUInt16(),
|
reader.ReadUInt16(),
|
||||||
languageID = reader.ReadUInt16(),
|
reader.ReadUInt16(),
|
||||||
nameID = (NameID)reader.ReadUInt16(),
|
(NameID)reader.ReadUInt16(),
|
||||||
length = reader.ReadUInt16(),
|
reader.ReadUInt16(),
|
||||||
stringOffset = reader.ReadUInt16(),
|
reader.ReadUInt16()
|
||||||
});
|
));
|
||||||
if (version == 1) {
|
if (version == 1) {
|
||||||
langTagCount = reader.ReadUInt16();
|
langTagCount = reader.ReadUInt16();
|
||||||
for (UInt16 i = 0; i < langTagCount; i++)
|
for (UInt16 i = 0; i < langTagCount; i++)
|
||||||
langTagRecord.Add(new LangTagRecord {
|
langTagRecord.Add(new LangTagRecord(
|
||||||
length = reader.ReadUInt16(),
|
reader.ReadUInt16(),
|
||||||
langTagOffset = reader.ReadUInt16(),
|
reader.ReadUInt16()
|
||||||
});
|
));
|
||||||
|
}
|
||||||
|
foreach (var i in nameRecord)
|
||||||
|
i.Load(reader, offset + storageOffset);
|
||||||
|
if (version == 1) {
|
||||||
|
foreach (var i in langTagRecord)
|
||||||
|
i.Load(reader, offset + storageOffset);
|
||||||
}
|
}
|
||||||
UInt32 origin = (UInt32)reader.BaseStream.Position;
|
|
||||||
for (int i = 0; i < nameRecord.Count; i++) nameRecord[i] = nameRecord[i].Load(reader, origin);
|
|
||||||
for (int i = 0; i < langTagRecord.Count; i++) langTagRecord[i] = langTagRecord[i].Load(reader, origin);
|
|
||||||
}
|
}
|
||||||
public sealed override IReadOnlyList<NameRecord> GetItems() {
|
public sealed override IReadOnlyList<NameRecord> GetItems() {
|
||||||
return nameRecord;
|
return nameRecord;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public struct NameRecord {
|
public class NameRecord {
|
||||||
public UInt16 platformID;
|
public UInt16 PlatformID { get; private set; }
|
||||||
public UInt16 encodingID;
|
public UInt16 EncodingID { get; private set; }
|
||||||
public UInt16 languageID;
|
public UInt16 LanguageID { get; private set; }
|
||||||
public NameID nameID;
|
public NameID NameID { get; private set; }
|
||||||
public UInt16 length;
|
public UInt16 Length { get; private set; }
|
||||||
public UInt16 stringOffset;
|
public UInt16 StringOffset { get; private set; }
|
||||||
public String value { get; private set; }
|
public String Value { get; private set; }
|
||||||
public NameRecord Load(BinaryReader reader, UInt32 origin) {
|
public NameRecord(UInt16 platformID, UInt16 encodingID, UInt16 languageID, NameID nameID, UInt16 length, UInt16 stringOffset) {
|
||||||
reader.BaseStream.Position = origin + stringOffset;
|
PlatformID = platformID;
|
||||||
|
EncodingID = encodingID;
|
||||||
|
LanguageID = languageID;
|
||||||
|
NameID = nameID;
|
||||||
|
Length = length;
|
||||||
|
StringOffset = stringOffset;
|
||||||
|
}
|
||||||
|
public void Load(BinaryReader reader, UInt32 origin) {
|
||||||
|
reader.BaseStream.Position = origin + StringOffset;
|
||||||
Encoding encoding;
|
Encoding encoding;
|
||||||
switch (platformID) {
|
try {
|
||||||
case 0: encoding = Encoding.BigEndianUnicode; break;
|
switch (PlatformID) {
|
||||||
case 3: encoding = Encoding.BigEndianUnicode; break;
|
case 0: encoding = Encoding.BigEndianUnicode; break;
|
||||||
default: return this;
|
case 1: encoding = Encoding.GetEncoding(10000 + EncodingID); break;
|
||||||
|
case 3: encoding = Encoding.BigEndianUnicode; break;
|
||||||
|
default: return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
value = encoding.GetString(reader.ReadBytes(length));
|
catch (NotSupportedException) { return; }
|
||||||
return this;
|
catch (ArgumentException) { return; }
|
||||||
|
Value = encoding.GetString(reader.ReadBytes(Length));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public enum NameID : UInt16 {
|
public enum NameID : UInt16 {
|
||||||
@@ -171,47 +194,58 @@ namespace Cryville.Common.Font {
|
|||||||
DarkBackgroundPalette = 24,
|
DarkBackgroundPalette = 24,
|
||||||
VariationsPostScriptNamePrefix = 25,
|
VariationsPostScriptNamePrefix = 25,
|
||||||
}
|
}
|
||||||
public struct LangTagRecord {
|
public class LangTagRecord {
|
||||||
public UInt16 length;
|
public UInt16 Length { get; private set; }
|
||||||
public UInt16 langTagOffset;
|
public UInt16 LangTagOffset { get; private set; }
|
||||||
public String value { get; private set; }
|
public String Value { get; private set; }
|
||||||
public LangTagRecord Load(BinaryReader reader, UInt32 origin) {
|
public LangTagRecord(UInt16 length, UInt16 langTagOffset) {
|
||||||
reader.BaseStream.Position = origin + langTagOffset;
|
Length = length;
|
||||||
value = Encoding.BigEndianUnicode.GetString(reader.ReadBytes(length));
|
LangTagOffset = langTagOffset;
|
||||||
return this;
|
}
|
||||||
|
public void Load(BinaryReader reader, UInt32 origin) {
|
||||||
|
reader.BaseStream.Position = origin + LangTagOffset;
|
||||||
|
Value = Encoding.BigEndianUnicode.GetString(reader.ReadBytes(Length));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public sealed class MetaTable : FontTable<DataMap> {
|
public sealed class MetaTable : FontTable<DataMap> {
|
||||||
readonly UInt32 version;
|
readonly UInt32 version;
|
||||||
|
#pragma warning disable IDE0052 // Reserved
|
||||||
readonly UInt32 flags;
|
readonly UInt32 flags;
|
||||||
|
#pragma warning restore IDE0052 // Reserved
|
||||||
readonly UInt32 dataMapCount;
|
readonly UInt32 dataMapCount;
|
||||||
readonly List<DataMap> dataMaps = new List<DataMap>();
|
readonly List<DataMap> dataMaps = new List<DataMap>();
|
||||||
public MetaTable(BinaryReader reader, UInt32 offset) : base(reader, offset) {
|
public MetaTable(BinaryReader reader, UInt32 offset) : base(reader, offset) {
|
||||||
version = reader.ReadUInt32();
|
version = reader.ReadUInt32();
|
||||||
|
if (version != 1) throw new NotSupportedException();
|
||||||
flags = reader.ReadUInt32();
|
flags = reader.ReadUInt32();
|
||||||
reader.ReadUInt32();
|
reader.ReadUInt32();
|
||||||
dataMapCount = reader.ReadUInt32();
|
dataMapCount = reader.ReadUInt32();
|
||||||
for (UInt32 i = 0; i < dataMapCount; i++)
|
for (UInt32 i = 0; i < dataMapCount; i++)
|
||||||
dataMaps.Add(new DataMap {
|
dataMaps.Add(new DataMap (
|
||||||
tag = reader.ReadTag(),
|
reader.ReadTag(),
|
||||||
dataOffset = reader.ReadUInt32(),
|
reader.ReadUInt32(),
|
||||||
dataLength = reader.ReadUInt32(),
|
reader.ReadUInt32()
|
||||||
});
|
));
|
||||||
for (int i = 0; i < dataMaps.Count; i++) dataMaps[i] = dataMaps[i].Load(reader, offset);
|
foreach (var i in dataMaps)
|
||||||
|
i.Load(reader, offset);
|
||||||
}
|
}
|
||||||
public sealed override IReadOnlyList<DataMap> GetItems() {
|
public sealed override IReadOnlyList<DataMap> GetItems() {
|
||||||
return dataMaps;
|
return dataMaps;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public struct DataMap {
|
public class DataMap {
|
||||||
public String tag;
|
public String Tag { get; private set; }
|
||||||
public UInt32 dataOffset;
|
public UInt32 DataOffset { get; private set; }
|
||||||
public UInt32 dataLength;
|
public UInt32 DataLength { get; private set; }
|
||||||
public String value { get; private set; }
|
public String Value { get; private set; }
|
||||||
public DataMap Load(BinaryReader reader, UInt32 origin) {
|
public DataMap(String tag, UInt32 dataOffset, UInt32 dataLength) {
|
||||||
reader.BaseStream.Position = origin + dataOffset;
|
Tag = tag;
|
||||||
value = Encoding.ASCII.GetString(reader.ReadBytes((int)dataLength));
|
DataOffset = dataOffset;
|
||||||
return this;
|
DataLength = dataLength;
|
||||||
|
}
|
||||||
|
public void Load(BinaryReader reader, UInt32 origin) {
|
||||||
|
reader.BaseStream.Position = origin + DataOffset;
|
||||||
|
Value = Encoding.ASCII.GetString(reader.ReadBytes((int)DataLength));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static class BinaryReaderExtensions {
|
public static class BinaryReaderExtensions {
|
||||||
|
@@ -23,9 +23,9 @@ namespace Cryville.Common.Font {
|
|||||||
protected override void GetName(BinaryReader reader) {
|
protected override void GetName(BinaryReader reader) {
|
||||||
var dir = new TableDirectory(reader, (uint)reader.BaseStream.Position);
|
var dir = new TableDirectory(reader, (uint)reader.BaseStream.Position);
|
||||||
var nameTable = (NameTable)dir.GetSubTable((from i in dir.GetItems() where i.tableTag == "name" select i).Single());
|
var nameTable = (NameTable)dir.GetSubTable((from i in dir.GetItems() where i.tableTag == "name" select i).Single());
|
||||||
FamilyName = (from i in nameTable.GetItems() where i.nameID == NameID.FontFamilyName && i.value != null select i.value).First();
|
FamilyName = (from i in nameTable.GetItems() where i.NameID == NameID.FontFamilyName && i.Value != null select i.Value).First();
|
||||||
SubfamilyName = (from i in nameTable.GetItems() where i.nameID == NameID.FontSubfamilyName && i.value != null select i.value).First();
|
SubfamilyName = (from i in nameTable.GetItems() where i.NameID == NameID.FontSubfamilyName && i.Value != null select i.Value).First();
|
||||||
FullName = (from i in nameTable.GetItems() where i.nameID == NameID.FullFontName && i.value != null select i.value).First();
|
FullName = (from i in nameTable.GetItems() where i.NameID == NameID.FullFontName && i.Value != null select i.Value).First();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
50
Assets/Cryville/Common/Unity/ScopedThreadAttacherInjector.cs
Normal file
50
Assets/Cryville/Common/Unity/ScopedThreadAttacherInjector.cs
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
#if UNITY_EDITOR
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using UnityEditor;
|
||||||
|
|
||||||
|
namespace Cryville.Common.Unity {
|
||||||
|
[InitializeOnLoad]
|
||||||
|
public class ScopedThreadAttacherInjector {
|
||||||
|
static readonly Encoding _encoding = new UTF8Encoding(false, true);
|
||||||
|
static string _filePath;
|
||||||
|
static string _oldSrc;
|
||||||
|
|
||||||
|
static ScopedThreadAttacherInjector() {
|
||||||
|
BuildPlayerWindow.RegisterBuildPlayerHandler(opt => HandlePlayerBuild(opt));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void HandlePlayerBuild(BuildPlayerOptions opt) {
|
||||||
|
try {
|
||||||
|
OnPreprocessBuild();
|
||||||
|
BuildPlayerWindow.DefaultBuildMethods.BuildPlayer(opt);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
OnPostprocessBuild();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void OnPreprocessBuild() {
|
||||||
|
var il2cppRoot = Environment.GetEnvironmentVariable("UNITY_IL2CPP_PATH");
|
||||||
|
if (string.IsNullOrEmpty(il2cppRoot)) {
|
||||||
|
_filePath = string.Empty;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_filePath = Path.Combine(il2cppRoot, "libil2cpp", "vm", "ScopedThreadAttacher.cpp");
|
||||||
|
if (!File.Exists(_filePath)) {
|
||||||
|
_filePath = string.Empty;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_oldSrc = File.ReadAllText(_filePath, _encoding);
|
||||||
|
File.WriteAllText(_filePath, Regex.Replace(_oldSrc, @"~\s*?ScopedThreadAttacher\s*?\(\s*?\)\s*?\{.*\}", "~ScopedThreadAttacher(){}", RegexOptions.Singleline), _encoding);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void OnPostprocessBuild() {
|
||||||
|
if (string.IsNullOrEmpty(_filePath)) return;
|
||||||
|
File.WriteAllText(_filePath, _oldSrc, _encoding);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2322d8e9250e9e6469826361223dfdda
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -6,6 +6,7 @@ using TMPro;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.TextCore.LowLevel;
|
using UnityEngine.TextCore.LowLevel;
|
||||||
using UnityEngine.TextCore.Text;
|
using UnityEngine.TextCore.Text;
|
||||||
|
using Logger = Cryville.Common.Logging.Logger;
|
||||||
|
|
||||||
namespace Cryville.Common.Unity.UI {
|
namespace Cryville.Common.Unity.UI {
|
||||||
[RequireComponent(typeof(TextMeshProUGUI))]
|
[RequireComponent(typeof(TextMeshProUGUI))]
|
||||||
@@ -29,12 +30,14 @@ namespace Cryville.Common.Unity.UI {
|
|||||||
else if (DefaultShader) ifont.material.shader = DefaultShader;
|
else if (DefaultShader) ifont.material.shader = DefaultShader;
|
||||||
if (_font == null) {
|
if (_font == null) {
|
||||||
_font = ifont;
|
_font = ifont;
|
||||||
|
Logger.Log("main", 1, "UI", "Using main font: {0}", typeface.FullName);
|
||||||
if (MaxFallbackCount <= 0) break;
|
if (MaxFallbackCount <= 0) break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (_font.fallbackFontAssetTable == null)
|
if (_font.fallbackFontAssetTable == null)
|
||||||
_font.fallbackFontAssetTable = new List<FontAsset>();
|
_font.fallbackFontAssetTable = new List<FontAsset>();
|
||||||
_font.fallbackFontAssetTable.Add(ifont);
|
_font.fallbackFontAssetTable.Add(ifont);
|
||||||
|
Logger.Log("main", 1, "UI", "Using fallback font #{0}: {1}", _font.fallbackFontAssetTable.Count, typeface.FullName);
|
||||||
if (_font.fallbackFontAssetTable.Count >= MaxFallbackCount) break;
|
if (_font.fallbackFontAssetTable.Count >= MaxFallbackCount) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
using Cryville.Common.Collections.Specialized;
|
using Cryville.Common.Collections.Specialized;
|
||||||
|
using Cryville.Crtr.Skin;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr {
|
||||||
|
@@ -1,12 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: cfa7de3f6f944914d9999fcfda245f97
|
|
||||||
timeCreated: 1637552994
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@@ -1,12 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: b38d66b3e6e5d94438c72f855c4efff9
|
|
||||||
timeCreated: 1637554149
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
10
Assets/Cryville/Crtr/Browsing/ChartDetail.cs
Normal file
10
Assets/Cryville/Crtr/Browsing/ChartDetail.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using Cryville.Common;
|
||||||
|
using Cryville.Crtr.Extension;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Cryville.Crtr.Browsing {
|
||||||
|
public struct ChartDetail {
|
||||||
|
public AsyncDelivery<Texture2D> Cover { get; set; }
|
||||||
|
public ChartMeta Meta { get; set; }
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Cryville/Crtr/Browsing/ChartDetail.cs.meta
Normal file
11
Assets/Cryville/Crtr/Browsing/ChartDetail.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5f9870328bccefa4d8d4f6d5e3cef591
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -1,12 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 477e04b1ed5b60e48886fb76081245c5
|
|
||||||
timeCreated: 1637722157
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@@ -3,6 +3,7 @@ using Cryville.Common.Unity;
|
|||||||
using Cryville.Crtr.Extension;
|
using Cryville.Crtr.Extension;
|
||||||
using Cryville.Crtr.Extensions;
|
using Cryville.Crtr.Extensions;
|
||||||
using Cryville.Crtr.Extensions.Umg;
|
using Cryville.Crtr.Extensions.Umg;
|
||||||
|
using Cryville.Crtr.UI;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@@ -1,12 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 5d443a346e9a19d4eabbb0fa9ec7016f
|
|
||||||
timeCreated: 1637566071
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@@ -1,12 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: c6b4df13dea0e4a469d7e54e7e8fb428
|
|
||||||
timeCreated: 1637234060
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@@ -1,12 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 256d7d3efda1f9b4c882eb42e608cc8e
|
|
||||||
timeCreated: 1638414803
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@@ -1,12 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: a69c80e5f3e7bd04485bc3afc5826584
|
|
||||||
timeCreated: 1638415083
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@@ -2,15 +2,6 @@ using Cryville.Common;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Browsing {
|
namespace Cryville.Crtr.Browsing {
|
||||||
internal abstract class BrowserItem : MonoBehaviour {
|
|
||||||
public int? Id { get; private set; }
|
|
||||||
protected ResourceItemMeta meta;
|
|
||||||
internal virtual void Load(int id, ResourceItemMeta item) {
|
|
||||||
Id = id;
|
|
||||||
meta = item;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public struct ResourceItemMeta {
|
public struct ResourceItemMeta {
|
||||||
public bool IsDirectory { get; set; }
|
public bool IsDirectory { get; set; }
|
||||||
public AsyncDelivery<Texture2D> Icon { get; set; }
|
public AsyncDelivery<Texture2D> Icon { get; set; }
|
11
Assets/Cryville/Crtr/Browsing/ResourceItemMeta.cs.meta
Normal file
11
Assets/Cryville/Crtr/Browsing/ResourceItemMeta.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f535064222dd08c4f8e52d6e9144079a
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/Cryville/Crtr/Browsing/UI.meta
Normal file
8
Assets/Cryville/Crtr/Browsing/UI.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ba8a8b6df16a9714f9785aba6adc0427
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
12
Assets/Cryville/Crtr/Browsing/UI/BrowserItem.cs
Normal file
12
Assets/Cryville/Crtr/Browsing/UI/BrowserItem.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Cryville.Crtr.Browsing.UI {
|
||||||
|
internal abstract class BrowserItem : MonoBehaviour {
|
||||||
|
public int? Id { get; private set; }
|
||||||
|
protected ResourceItemMeta meta;
|
||||||
|
internal virtual void Load(int id, ResourceItemMeta item) {
|
||||||
|
Id = id;
|
||||||
|
meta = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Cryville/Crtr/Browsing/UI/BrowserItem.cs.meta
Normal file
11
Assets/Cryville/Crtr/Browsing/UI/BrowserItem.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c3cee963751f1ee4c9792c8c8983f51d
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -2,7 +2,7 @@ using TMPro;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Browsing {
|
namespace Cryville.Crtr.Browsing.UI {
|
||||||
internal class BrowserItemTile : BrowserItem {
|
internal class BrowserItemTile : BrowserItem {
|
||||||
#pragma warning disable IDE0044
|
#pragma warning disable IDE0044
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
@@ -45,7 +45,7 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
}
|
}
|
||||||
public void OnClick() {
|
public void OnClick() {
|
||||||
if (Id == null) return;
|
if (Id == null) return;
|
||||||
ResourceBrowser resourceBrowser = GetComponentInParent<ResourceBrowser>();
|
var resourceBrowser = GetComponentInParent<ResourceBrowser>();
|
||||||
if (_dir) resourceBrowser.OnDirectoryItemClicked(Id.Value);
|
if (_dir) resourceBrowser.OnDirectoryItemClicked(Id.Value);
|
||||||
else resourceBrowser.OnObjectItemClicked(Id.Value);
|
else resourceBrowser.OnObjectItemClicked(Id.Value);
|
||||||
}
|
}
|
11
Assets/Cryville/Crtr/Browsing/UI/BrowserItemTile.cs.meta
Normal file
11
Assets/Cryville/Crtr/Browsing/UI/BrowserItemTile.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 18dcb7d928c649f46bda005527fb6a17
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -4,7 +4,7 @@ using TMPro;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Browsing {
|
namespace Cryville.Crtr.Browsing.UI {
|
||||||
public class DetailPanel : ResourceBrowserUnit {
|
public class DetailPanel : ResourceBrowserUnit {
|
||||||
#pragma warning disable IDE0044
|
#pragma warning disable IDE0044
|
||||||
[SerializeField]
|
[SerializeField]
|
11
Assets/Cryville/Crtr/Browsing/UI/DetailPanel.cs.meta
Normal file
11
Assets/Cryville/Crtr/Browsing/UI/DetailPanel.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9bdcc04cb1961dd4e9483dbf6c6d6f8b
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -1,7 +1,7 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Browsing {
|
namespace Cryville.Crtr.Browsing.UI {
|
||||||
internal class PathPart : MonoBehaviour {
|
internal class PathPart : MonoBehaviour {
|
||||||
private int _id;
|
private int _id;
|
||||||
private Text _exp;
|
private Text _exp;
|
11
Assets/Cryville/Crtr/Browsing/UI/PathPart.cs.meta
Normal file
11
Assets/Cryville/Crtr/Browsing/UI/PathPart.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 961fa71cc64cc2a4b88adfc5a1aad216
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -1,10 +1,11 @@
|
|||||||
using Cryville.Common.Unity;
|
using Cryville.Common.Unity;
|
||||||
using Cryville.Common.Unity.UI;
|
using Cryville.Common.Unity.UI;
|
||||||
|
using Cryville.Crtr.UI;
|
||||||
using System;
|
using System;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Browsing {
|
namespace Cryville.Crtr.Browsing.UI {
|
||||||
public class ResourceBrowser : ResourceBrowserUnit {
|
public class ResourceBrowser : ResourceBrowserUnit {
|
||||||
public IResourceManager<ChartDetail> ResourceManager;
|
public IResourceManager<ChartDetail> ResourceManager;
|
||||||
public ScrollableItemGrid PathContainer;
|
public ScrollableItemGrid PathContainer;
|
11
Assets/Cryville/Crtr/Browsing/UI/ResourceBrowser.cs.meta
Normal file
11
Assets/Cryville/Crtr/Browsing/UI/ResourceBrowser.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8d8141a90dc49f741b382e7abbf0a9c8
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -1,13 +1,12 @@
|
|||||||
using Cryville.Common;
|
|
||||||
using Cryville.Common.Unity.UI;
|
using Cryville.Common.Unity.UI;
|
||||||
using Cryville.Crtr.Config;
|
using Cryville.Crtr.Config.UI;
|
||||||
using Cryville.Crtr.Extension;
|
using Cryville.Crtr.UI;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Browsing {
|
namespace Cryville.Crtr.Browsing.UI {
|
||||||
public class ResourceBrowserMaster : MonoBehaviour {
|
public class ResourceBrowserMaster : MonoBehaviour {
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private Button m_playButton;
|
private Button m_playButton;
|
||||||
@@ -89,9 +88,4 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
Settings.Default.LoadChart = MainBrowser.ResourceManager.GetItemPath(id);
|
Settings.Default.LoadChart = MainBrowser.ResourceManager.GetItemPath(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ChartDetail {
|
|
||||||
public AsyncDelivery<Texture2D> Cover { get; set; }
|
|
||||||
public ChartMeta Meta { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1c6c8bc301408004a904079721302722
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -1,6 +1,6 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Browsing {
|
namespace Cryville.Crtr.Browsing.UI {
|
||||||
public abstract class ResourceBrowserUnit : MonoBehaviour {
|
public abstract class ResourceBrowserUnit : MonoBehaviour {
|
||||||
protected ResourceBrowserMaster Master { get; private set; }
|
protected ResourceBrowserMaster Master { get; private set; }
|
||||||
protected virtual void Awake() {
|
protected virtual void Awake() {
|
11
Assets/Cryville/Crtr/Browsing/UI/ResourceBrowserUnit.cs.meta
Normal file
11
Assets/Cryville/Crtr/Browsing/UI/ResourceBrowserUnit.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e8d98fa73d49ab94cb1a16c5ef09db6c
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -1,10 +1,10 @@
|
|||||||
using Cryville.Crtr.Components;
|
using Cryville.Crtr.Skin.Components;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr {
|
||||||
public static class GenericResources {
|
public static class BuiltinResources {
|
||||||
public static Dictionary<string, Type> Components
|
public static Dictionary<string, Type> Components
|
||||||
= new Dictionary<string, Type>();
|
= new Dictionary<string, Type>();
|
||||||
public static Dictionary<string, Shader> Shaders
|
public static Dictionary<string, Shader> Shaders
|
@@ -1,6 +1,7 @@
|
|||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
using Cryville.Common.Collections.Specialized;
|
using Cryville.Common.Collections.Specialized;
|
||||||
using Cryville.Common.Pdt;
|
using Cryville.Common.Pdt;
|
||||||
|
using Cryville.Crtr.Ruleset;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@@ -2,6 +2,9 @@ using Cryville.Common;
|
|||||||
using Cryville.Common.Buffers;
|
using Cryville.Common.Buffers;
|
||||||
using Cryville.Crtr.Config;
|
using Cryville.Crtr.Config;
|
||||||
using Cryville.Crtr.Event;
|
using Cryville.Crtr.Event;
|
||||||
|
using Cryville.Crtr.Ruleset;
|
||||||
|
using Cryville.Crtr.Skin;
|
||||||
|
using Cryville.Crtr.UI;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -22,9 +25,9 @@ namespace Cryville.Crtr {
|
|||||||
public class ChartPlayer : MonoBehaviour {
|
public class ChartPlayer : MonoBehaviour {
|
||||||
#region Fields
|
#region Fields
|
||||||
Chart chart;
|
Chart chart;
|
||||||
Skin skin;
|
SkinDefinition skin;
|
||||||
public static PdtSkin pskin;
|
public static PdtSkin pskin;
|
||||||
Ruleset ruleset;
|
RulesetDefinition ruleset;
|
||||||
PdtRuleset pruleset;
|
PdtRuleset pruleset;
|
||||||
Dictionary<string, Texture2D> texs;
|
Dictionary<string, Texture2D> texs;
|
||||||
public static Dictionary<string, SpriteFrame> frames;
|
public static Dictionary<string, SpriteFrame> frames;
|
||||||
@@ -71,7 +74,7 @@ namespace Cryville.Crtr {
|
|||||||
logs = logobj.GetComponent<TextMeshProUGUI>();
|
logs = logobj.GetComponent<TextMeshProUGUI>();
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
Game.Init();
|
Game.Init();
|
||||||
GenericResources.LoadDefault();
|
BuiltinResources.LoadDefault();
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
OnSettingsUpdate();
|
OnSettingsUpdate();
|
||||||
@@ -265,12 +268,12 @@ namespace Cryville.Crtr {
|
|||||||
"\nStates: c{0} / b{1}",
|
"\nStates: c{0} / b{1}",
|
||||||
cbus.ActiveStateCount, bbus.ActiveStateCount
|
cbus.ActiveStateCount, bbus.ActiveStateCount
|
||||||
);
|
);
|
||||||
var aTime = Game.AudioClient.Position;
|
var aTime = Game.AudioClient.Position - atime0;
|
||||||
var iTime = inputProxy.GetTimestampAverage();
|
var iTime = inputProxy.GetTimestampAverage();
|
||||||
statusbuf.AppendFormat(
|
statusbuf.AppendFormat(
|
||||||
"\nSTime: {0:G9}s {5} {6}\nATime: {1:G9}s ({3:+0.0ms;-0.0ms;0}) {5} {6}\nITime: {2:G9}s ({4:+0.0ms;-0.0ms;0}) {5} {7}",
|
"\nSTime: {0:G9}s {5} {6}\nATime: {1:G9}s ({3:+0.0ms;-0.0ms;0}) {5} {6}\nITime: {2:G9}s ({4:+0.0ms;-0.0ms;0}) {5} {7}",
|
||||||
cbus.Time, aTime, iTime,
|
cbus.Time, aTime, iTime,
|
||||||
(aTime - atime0 - cbus.Time) * 1e3,
|
(aTime - cbus.Time) * 1e3,
|
||||||
(iTime - cbus.Time) * 1e3,
|
(iTime - cbus.Time) * 1e3,
|
||||||
forceSyncFrames != 0 ? "(force sync)" : "",
|
forceSyncFrames != 0 ? "(force sync)" : "",
|
||||||
paused ? "(paused)" : "",
|
paused ? "(paused)" : "",
|
||||||
@@ -417,10 +420,10 @@ namespace Cryville.Crtr {
|
|||||||
);
|
);
|
||||||
if (!skinFile.Exists) throw new FileNotFoundException("Skin not found\nPlease specify an available skin in the config");
|
if (!skinFile.Exists) throw new FileNotFoundException("Skin not found\nPlease specify an available skin in the config");
|
||||||
using (StreamReader reader = new StreamReader(skinFile.FullName, Encoding.UTF8)) {
|
using (StreamReader reader = new StreamReader(skinFile.FullName, Encoding.UTF8)) {
|
||||||
skin = JsonConvert.DeserializeObject<Skin>(reader.ReadToEnd(), new JsonSerializerSettings() {
|
skin = JsonConvert.DeserializeObject<SkinDefinition>(reader.ReadToEnd(), new JsonSerializerSettings() {
|
||||||
MissingMemberHandling = MissingMemberHandling.Error
|
MissingMemberHandling = MissingMemberHandling.Error
|
||||||
});
|
});
|
||||||
if (skin.format != Skin.CURRENT_FORMAT) throw new FormatException("Invalid skin file version");
|
if (skin.format != SkinDefinition.CURRENT_FORMAT) throw new FormatException("Invalid skin file version");
|
||||||
}
|
}
|
||||||
|
|
||||||
loadThread = new Thread(new ParameterizedThreadStart(Load));
|
loadThread = new Thread(new ParameterizedThreadStart(Load));
|
||||||
@@ -497,22 +500,22 @@ namespace Cryville.Crtr {
|
|||||||
IEnumerator<float> Prehandle() {
|
IEnumerator<float> Prehandle() {
|
||||||
Stopwatch timer = new Stopwatch();
|
Stopwatch timer = new Stopwatch();
|
||||||
timer.Reset(); timer.Start();
|
timer.Reset(); timer.Start();
|
||||||
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 2)"); yield return .00f;
|
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 2)"); yield return 0;
|
||||||
cbus.BroadcastPreInit();
|
cbus.BroadcastPreInit();
|
||||||
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 3)"); yield return .05f;
|
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 3)"); yield return 0;
|
||||||
using (var pbus = cbus.Clone(17)) {
|
using (var pbus = cbus.Clone(17)) {
|
||||||
while (pbus.Time != double.PositiveInfinity) {
|
while (pbus.Time != double.PositiveInfinity) {
|
||||||
pbus.ForwardOnce();
|
pbus.ForwardOnce();
|
||||||
yield return (float)pbus.EventId / pbus.EventCount * .80f + .05f;
|
yield return (float)pbus.EventId / pbus.EventCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 4)"); yield return .85f;
|
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 4)"); yield return 1;
|
||||||
cbus.BroadcastPostInit();
|
cbus.BroadcastPostInit();
|
||||||
Logger.Log("main", 0, "Load/Prehandle", "Seeking to start offset"); yield return .90f;
|
Logger.Log("main", 0, "Load/Prehandle", "Seeking to start offset"); yield return 1;
|
||||||
cbus.ForwardByTime(startOffset);
|
cbus.ForwardByTime(startOffset);
|
||||||
bbus.ForwardByTime(startOffset);
|
bbus.ForwardByTime(startOffset);
|
||||||
Game.AudioSequencer.SeekTime(startOffset, SeekOrigin.Current);
|
Game.AudioSequencer.SeekTime(startOffset, SeekOrigin.Current);
|
||||||
Logger.Log("main", 0, "Load/Prehandle", "Cleaning up"); yield return .95f;
|
Logger.Log("main", 0, "Load/Prehandle", "Cleaning up"); yield return 1;
|
||||||
if (logEnabled && Settings.Default.HideLogOnPlay) ToggleLogs();
|
if (logEnabled && Settings.Default.HideLogOnPlay) ToggleLogs();
|
||||||
Camera.main.cullingMask |= 1;
|
Camera.main.cullingMask |= 1;
|
||||||
GC.Collect();
|
GC.Collect();
|
||||||
@@ -526,7 +529,7 @@ namespace Cryville.Crtr {
|
|||||||
logs.text = "";
|
logs.text = "";
|
||||||
}
|
}
|
||||||
Game.AudioSequencer.Playing = true;
|
Game.AudioSequencer.Playing = true;
|
||||||
atime0 = Game.AudioClient.Position - startOffset;
|
atime0 = Game.AudioClient.BufferPosition - startOffset;
|
||||||
inputProxy.SyncTime(cbus.Time);
|
inputProxy.SyncTime(cbus.Time);
|
||||||
inputProxy.Activate();
|
inputProxy.Activate();
|
||||||
}
|
}
|
||||||
@@ -682,10 +685,10 @@ namespace Cryville.Crtr {
|
|||||||
DirectoryInfo dir = file.Directory;
|
DirectoryInfo dir = file.Directory;
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Loading ruleset: {0}", file);
|
Logger.Log("main", 0, "Load/WorkerThread", "Loading ruleset: {0}", file);
|
||||||
using (StreamReader reader = new StreamReader(file.FullName, Encoding.UTF8)) {
|
using (StreamReader reader = new StreamReader(file.FullName, Encoding.UTF8)) {
|
||||||
ruleset = JsonConvert.DeserializeObject<Ruleset>(reader.ReadToEnd(), new JsonSerializerSettings() {
|
ruleset = JsonConvert.DeserializeObject<RulesetDefinition>(reader.ReadToEnd(), new JsonSerializerSettings() {
|
||||||
MissingMemberHandling = MissingMemberHandling.Error
|
MissingMemberHandling = MissingMemberHandling.Error
|
||||||
});
|
});
|
||||||
if (ruleset.format != Ruleset.CURRENT_FORMAT) throw new FormatException("Invalid ruleset file version");
|
if (ruleset.format != RulesetDefinition.CURRENT_FORMAT) throw new FormatException("Invalid ruleset file version");
|
||||||
ruleset.LoadPdt(dir);
|
ruleset.LoadPdt(dir);
|
||||||
pruleset = ruleset.Root;
|
pruleset = ruleset.Root;
|
||||||
pruleset.Optimize(PdtEvaluator.Instance);
|
pruleset.Optimize(PdtEvaluator.Instance);
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
using Cryville.Common.Pdt;
|
using Cryville.Common.Pdt;
|
||||||
|
using Cryville.Crtr.Ruleset;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
using Cryville.Common.Collections.Specialized;
|
using Cryville.Common.Collections.Specialized;
|
||||||
|
using Cryville.Crtr.Ruleset;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
8
Assets/Cryville/Crtr/Config/UI.meta
Normal file
8
Assets/Cryville/Crtr/Config/UI.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 26842cf5cfcceb14a9dbb07adbdf4da0
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -1,3 +1,5 @@
|
|||||||
|
using Cryville.Crtr.Ruleset;
|
||||||
|
using Cryville.Crtr.UI;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@@ -5,7 +7,7 @@ using System.Text;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Logger = Cryville.Common.Logging.Logger;
|
using Logger = Cryville.Common.Logging.Logger;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Config {
|
namespace Cryville.Crtr.Config.UI {
|
||||||
public class ConfigPanelMaster : MonoBehaviour {
|
public class ConfigPanelMaster : MonoBehaviour {
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
Menu m_menu;
|
Menu m_menu;
|
||||||
@@ -22,7 +24,7 @@ namespace Cryville.Crtr.Config {
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
InputConfigPanel m_inputConfigPanel;
|
InputConfigPanel m_inputConfigPanel;
|
||||||
|
|
||||||
public Ruleset ruleset;
|
public RulesetDefinition ruleset;
|
||||||
RulesetConfig _rscfg;
|
RulesetConfig _rscfg;
|
||||||
|
|
||||||
bool _loaded;
|
bool _loaded;
|
||||||
@@ -38,10 +40,10 @@ namespace Cryville.Crtr.Config {
|
|||||||
}
|
}
|
||||||
DirectoryInfo dir = file.Directory;
|
DirectoryInfo dir = file.Directory;
|
||||||
using (StreamReader reader = new StreamReader(file.FullName, Encoding.UTF8)) {
|
using (StreamReader reader = new StreamReader(file.FullName, Encoding.UTF8)) {
|
||||||
ruleset = JsonConvert.DeserializeObject<Ruleset>(reader.ReadToEnd(), new JsonSerializerSettings() {
|
ruleset = JsonConvert.DeserializeObject<RulesetDefinition>(reader.ReadToEnd(), new JsonSerializerSettings() {
|
||||||
MissingMemberHandling = MissingMemberHandling.Error
|
MissingMemberHandling = MissingMemberHandling.Error
|
||||||
});
|
});
|
||||||
if (ruleset.format != Ruleset.CURRENT_FORMAT) throw new FormatException("Invalid ruleset file version");
|
if (ruleset.format != RulesetDefinition.CURRENT_FORMAT) throw new FormatException("Invalid ruleset file version");
|
||||||
ruleset.LoadPdt(dir);
|
ruleset.LoadPdt(dir);
|
||||||
}
|
}
|
||||||
FileInfo cfgfile = new FileInfo(
|
FileInfo cfgfile = new FileInfo(
|
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 54c06a15adfb41548acca0d73f391fe7
|
guid: bad1f43573d4f1143a94fddddd30fb81
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
@@ -1,12 +1,13 @@
|
|||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
using Cryville.Common.Unity;
|
using Cryville.Common.Unity;
|
||||||
|
using Cryville.Crtr.Ruleset;
|
||||||
using Cryville.Input;
|
using Cryville.Input;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Config {
|
namespace Cryville.Crtr.Config.UI {
|
||||||
public class InputConfigPanel : MonoBehaviour {
|
public class InputConfigPanel : MonoBehaviour {
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
ConfigPanelMaster m_configScene;
|
ConfigPanelMaster m_configScene;
|
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: d27589834da67984d98c6147c8b6b5bb
|
guid: 279d2404a312e5543813d8aca02800b8
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
@@ -1,9 +1,10 @@
|
|||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
|
using Cryville.Crtr.Ruleset;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Config {
|
namespace Cryville.Crtr.Config.UI {
|
||||||
public class InputConfigPanelEntry : MonoBehaviour {
|
public class InputConfigPanelEntry : MonoBehaviour {
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
Text m_key;
|
Text m_key;
|
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 8661f4d4934e11040a0c65729d4ba47a
|
guid: 9741a0ed8c1c5e0468ea89f2cf33f36c
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
@@ -1,7 +1,7 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Config {
|
namespace Cryville.Crtr.Config.UI {
|
||||||
public class PVPBool : PropertyValuePanel, IPointerClickHandler {
|
public class PVPBool : PropertyValuePanel, IPointerClickHandler {
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
RectTransform m_on;
|
RectTransform m_on;
|
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 362a7cfafb57b9f46bbca9ed88d18c53
|
guid: 9cb1bc40304ff174f891239c8f450c1c
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Config {
|
namespace Cryville.Crtr.Config.UI {
|
||||||
public class PVPNumber : PVPNumberBase {
|
public class PVPNumber : PVPNumberBase {
|
||||||
protected override void OnValueUpdated() {
|
protected override void OnValueUpdated() {
|
||||||
base.OnValueUpdated();
|
base.OnValueUpdated();
|
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 5b5d86b95e0bf894b86c63127d5ac06c
|
guid: 94cb9dad5ac3eb04ca16d58a7bae0cb5
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
@@ -2,7 +2,7 @@ using UnityEngine;
|
|||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Config {
|
namespace Cryville.Crtr.Config.UI {
|
||||||
public abstract class PVPNumberBase : PropertyValuePanel {
|
public abstract class PVPNumberBase : PropertyValuePanel {
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
EventTrigger m_ctn;
|
EventTrigger m_ctn;
|
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 32fb9b8479cd8294296453d1aa651ff4
|
guid: c928ece9c4b30f04cb33f66eb9f050b3
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Config {
|
namespace Cryville.Crtr.Config.UI {
|
||||||
public class PVPNumberStepped : PVPNumberBase {
|
public class PVPNumberStepped : PVPNumberBase {
|
||||||
protected override void OnIdle() {
|
protected override void OnIdle() {
|
||||||
SetRatio(0.5f);
|
SetRatio(0.5f);
|
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: f754d98e38098654a878fc9121db536d
|
guid: c309650ed758ea34ba64e765f59bb043
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
@@ -1,6 +1,6 @@
|
|||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Config {
|
namespace Cryville.Crtr.Config.UI {
|
||||||
public class PVPString : PropertyValuePanel {
|
public class PVPString : PropertyValuePanel {
|
||||||
protected override void OnValueUpdated() { _inputField.text = (string)MappedValue; }
|
protected override void OnValueUpdated() { _inputField.text = (string)MappedValue; }
|
||||||
|
|
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 1b9a6e3b503784e4aa78215e9b004a8f
|
guid: f81596a59a59fce48854b6753fe8cfc6
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Config {
|
namespace Cryville.Crtr.Config.UI {
|
||||||
public class PropertyCategoryPanel : MonoBehaviour {
|
public class PropertyCategoryPanel : MonoBehaviour {
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private GameObject m_propertyPrefab;
|
private GameObject m_propertyPrefab;
|
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 71da54f24b65d2f41a00c5a4bd0ff1bf
|
guid: 11c5451aac09cbd4a8e94c82d5c568e8
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
@@ -1,7 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Config {
|
namespace Cryville.Crtr.Config.UI {
|
||||||
public class PropertyMasterPanel : MonoBehaviour {
|
public class PropertyMasterPanel : MonoBehaviour {
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
GameObject m_categoryPrefab;
|
GameObject m_categoryPrefab;
|
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 4e6129746af547242bfa4e7404185936
|
guid: f8d04667a373e4648a83440b496c8127
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
@@ -1,7 +1,7 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Config {
|
namespace Cryville.Crtr.Config.UI {
|
||||||
public class PropertyPanel : MonoBehaviour {
|
public class PropertyPanel : MonoBehaviour {
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
GameObject m_bool;
|
GameObject m_bool;
|
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: e47c05cfd69aa3f4d9886293e66877e9
|
guid: 0a812a9e54dd057459b501c0881b0f68
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
@@ -1,6 +1,6 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Config {
|
namespace Cryville.Crtr.Config.UI {
|
||||||
public abstract class PropertyValuePanel : MonoBehaviour {
|
public abstract class PropertyValuePanel : MonoBehaviour {
|
||||||
IPropertyAdapter _property;
|
IPropertyAdapter _property;
|
||||||
public void Init(IPropertyAdapter property) {
|
public void Init(IPropertyAdapter property) {
|
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: c71cc11a0b1429c4fac91296bf8c5a63
|
guid: aa6b204c7a1fd1d4c95d912196fc7566
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
@@ -1,9 +1,8 @@
|
|||||||
using Cryville.Audio.Source;
|
using Cryville.Audio.Source.Libav;
|
||||||
using Cryville.Crtr.Event;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr.Event {
|
||||||
public class ChartHandler : TransformHandler {
|
public class ChartHandler : TransformHandler {
|
||||||
protected override TransformHandler Parent { get { return null; } }
|
protected override TransformHandler Parent { get { return null; } }
|
||||||
|
|
@@ -1,8 +1,7 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: d8339b62359a4eb428e5d7939a0e8fe4
|
guid: 59e25dacd9b4d1f45b1da3a381187560
|
||||||
timeCreated: 1593870951
|
|
||||||
licenseType: Pro
|
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
defaultReferences: []
|
defaultReferences: []
|
||||||
executionOrder: 0
|
executionOrder: 0
|
@@ -1,7 +1,8 @@
|
|||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
using Cryville.Common.Buffers;
|
using Cryville.Common.Buffers;
|
||||||
using Cryville.Common.Collections.Specialized;
|
using Cryville.Common.Collections.Specialized;
|
||||||
using Cryville.Crtr.Components;
|
using Cryville.Crtr.Ruleset;
|
||||||
|
using Cryville.Crtr.Skin;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
@@ -2,6 +2,8 @@ using Cryville.Common;
|
|||||||
using Cryville.Common.Buffers;
|
using Cryville.Common.Buffers;
|
||||||
using Cryville.Common.Collections.Specialized;
|
using Cryville.Common.Collections.Specialized;
|
||||||
using Cryville.Common.Pdt;
|
using Cryville.Common.Pdt;
|
||||||
|
using Cryville.Crtr.Ruleset;
|
||||||
|
using Cryville.Crtr.Skin;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
using Cryville.Crtr.Ruleset;
|
||||||
|
using Cryville.Crtr.Skin;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
using Cryville.Common.Math;
|
using Cryville.Common.Math;
|
||||||
using Cryville.Crtr.Event;
|
|
||||||
using System;
|
using System;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr.Event {
|
||||||
public class GroupHandler : TransformHandler {
|
public class GroupHandler : TransformHandler {
|
||||||
protected override TransformHandler Parent { get { return _ch; } }
|
protected override TransformHandler Parent { get { return _ch; } }
|
||||||
public ChartHandler _ch;
|
public ChartHandler _ch;
|
@@ -1,8 +1,7 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 1d6ad7170a6c76248a8ec305e98a75b2
|
guid: a254d6c958ea6c5409991bde44e67635
|
||||||
timeCreated: 1599459182
|
|
||||||
licenseType: Pro
|
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
defaultReferences: []
|
defaultReferences: []
|
||||||
executionOrder: 0
|
executionOrder: 0
|
@@ -1,16 +1,16 @@
|
|||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
using Cryville.Crtr.Components;
|
using Cryville.Crtr.Ruleset;
|
||||||
using Cryville.Crtr.Event;
|
using Cryville.Crtr.Skin.Components;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr.Event {
|
||||||
public class NoteHandler : ContainerHandler {
|
public class NoteHandler : ContainerHandler {
|
||||||
readonly GroupHandler gh;
|
readonly GroupHandler gh;
|
||||||
public readonly Chart.Note Event;
|
readonly Chart.Note _note;
|
||||||
public NoteHandler(Chart.Note ev, GroupHandler gh) : base() {
|
public NoteHandler(Chart.Note ev, GroupHandler gh) : base() {
|
||||||
Event = ev;
|
_note = ev;
|
||||||
this.gh = gh;
|
this.gh = gh;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ namespace Cryville.Crtr {
|
|||||||
|
|
||||||
public override void PreInit() {
|
public override void PreInit() {
|
||||||
base.PreInit();
|
base.PreInit();
|
||||||
foreach (var j in Event.judges) {
|
foreach (var j in _note.judges) {
|
||||||
judges.Add(j, new JudgeState(this, j.Id.Key));
|
judges.Add(j, new JudgeState(this, j.Id.Key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ namespace Cryville.Crtr {
|
|||||||
base.StartGraphicalUpdate(s);
|
base.StartGraphicalUpdate(s);
|
||||||
TransformAwake(s);
|
TransformAwake(s);
|
||||||
if (RootTransform) {
|
if (RootTransform) {
|
||||||
if (Event.IsLong) {
|
if (_note.IsLong) {
|
||||||
foreach (var i in sgos) {
|
foreach (var i in sgos) {
|
||||||
i.Reset();
|
i.Reset();
|
||||||
i.AppendPoint(Position, Rotation);
|
i.AppendPoint(Position, Rotation);
|
||||||
@@ -88,7 +88,7 @@ namespace Cryville.Crtr {
|
|||||||
if (s.CloneType <= 2) {
|
if (s.CloneType <= 2) {
|
||||||
Position = GetFramePoint(s.Parent, s.Track);
|
Position = GetFramePoint(s.Parent, s.Track);
|
||||||
Rotation = GetFrameRotation(s.Parent, s.Track);
|
Rotation = GetFrameRotation(s.Parent, s.Track);
|
||||||
if (s.CloneType == 2 && RootTransform && Event.IsLong) {
|
if (s.CloneType == 2 && RootTransform && _note.IsLong) {
|
||||||
foreach (var i in sgos)
|
foreach (var i in sgos)
|
||||||
i.AppendPoint(Position, Rotation);
|
i.AppendPoint(Position, Rotation);
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,7 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Quaternion GetFrameRotation(ContainerState state, float track) {
|
Quaternion GetFrameRotation(ContainerState state, float track) {
|
||||||
var r = GetFrame(state, track, th => Quaternion.Euler(th.Direction) * Vector3.forward);
|
var r = GetFrame(state, track, th => th.Handler.Rotation * Vector3.forward);
|
||||||
return Quaternion.LookRotation(r, state.Normal);
|
return Quaternion.LookRotation(r, state.Normal);
|
||||||
}
|
}
|
||||||
|
|
11
Assets/Cryville/Crtr/Event/NoteHandler.cs.meta
Normal file
11
Assets/Cryville/Crtr/Event/NoteHandler.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ffea8276b5ce64d4392c75332b223f87
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
78
Assets/Cryville/Crtr/Event/RealtimeMotionValue.cs
Normal file
78
Assets/Cryville/Crtr/Event/RealtimeMotionValue.cs
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
using Cryville.Common.Collections.Specialized;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Cryville.Crtr.Event {
|
||||||
|
public class RealtimeMotionValue {
|
||||||
|
Type _type;
|
||||||
|
public Vector AbsoluteValue;
|
||||||
|
public Vector RelativeValue;
|
||||||
|
public IntKeyedDictionary<MotionNode> RelativeNodes;
|
||||||
|
internal byte CloneTypeFlag;
|
||||||
|
|
||||||
|
public RealtimeMotionValue Init(Vector init) {
|
||||||
|
_type = init.GetType();
|
||||||
|
RelativeNodes = new IntKeyedDictionary<MotionNode>();
|
||||||
|
AbsoluteValue = init;
|
||||||
|
RelativeValue = (Vector)Activator.CreateInstance(_type);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RealtimeMotionValue Clone() {
|
||||||
|
return new RealtimeMotionValue() {
|
||||||
|
_type = _type,
|
||||||
|
AbsoluteValue = AbsoluteValue.Clone(),
|
||||||
|
RelativeValue = RelativeValue.Clone(),
|
||||||
|
RelativeNodes = RelativeNodes,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CopyTo(RealtimeMotionValue dest, bool cloneNodes) {
|
||||||
|
AbsoluteValue.CopyTo(dest.AbsoluteValue);
|
||||||
|
RelativeValue.CopyTo(dest.RelativeValue);
|
||||||
|
if (cloneNodes) {
|
||||||
|
dest.ReturnAllRelativeNodes();
|
||||||
|
foreach (var node in RelativeNodes) {
|
||||||
|
var dnode = MotionNodePool.Shared.Rent(_type);
|
||||||
|
node.Value.CopyTo(dnode);
|
||||||
|
dest.RelativeNodes.Add(node.Key, dnode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else dest.RelativeNodes = RelativeNodes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReturnAllRelativeNodes() {
|
||||||
|
foreach (var node in RelativeNodes) {
|
||||||
|
MotionNodePool.Shared.Return(_type, node.Value);
|
||||||
|
}
|
||||||
|
RelativeNodes.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MotionNode GetRelativeNode(short id) {
|
||||||
|
MotionNode result;
|
||||||
|
RelativeNodes.TryGetValue(id, out result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetRelativeNode(MotionNode node) {
|
||||||
|
MotionNode cnode;
|
||||||
|
if (!RelativeNodes.TryGetValue(node.Id, out cnode)) {
|
||||||
|
cnode = MotionNodePool.Shared.Rent(_type);
|
||||||
|
cnode.Id = node.Id;
|
||||||
|
RelativeNodes.Add(node.Id, cnode);
|
||||||
|
}
|
||||||
|
if (node.Time != null) node.Time.CopyTo(cnode.Time);
|
||||||
|
if (node.EndTime != null) node.EndTime.CopyTo(cnode.EndTime);
|
||||||
|
if (node.Value != null) node.Value.CopyTo(cnode.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Computes the motion value.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">The vector type of the value.</typeparam>
|
||||||
|
/// <param name="result">The result.</param>
|
||||||
|
public void Compute<T>(ref T result) where T : Vector {
|
||||||
|
AbsoluteValue.CopyTo(result);
|
||||||
|
result.ApplyFrom(RelativeValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Cryville/Crtr/Event/RealtimeMotionValue.cs.meta
Normal file
11
Assets/Cryville/Crtr/Event/RealtimeMotionValue.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f86bb688b0e51b84cbea3253abbe73e5
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -2,7 +2,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using CAnchor = Cryville.Crtr.Anchor;
|
using CAnchor = Cryville.Crtr.Anchor;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr.Event {
|
||||||
public class StampedEvent : IComparable<StampedEvent> {
|
public class StampedEvent : IComparable<StampedEvent> {
|
||||||
public double Time;
|
public double Time;
|
||||||
public ChartEvent Unstamped;
|
public ChartEvent Unstamped;
|
11
Assets/Cryville/Crtr/Event/StampedEvent.cs.meta
Normal file
11
Assets/Cryville/Crtr/Event/StampedEvent.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 767c16f09c4593940aa934d0ca6de4ac
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr.Event {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A time-forward handler of a sequence of events.
|
/// A time-forward handler of a sequence of events.
|
||||||
/// </summary>
|
/// </summary>
|
@@ -1,8 +1,7 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 116c345bd51b98740aa99a3e08442e5f
|
guid: 5ea84a1810568034e96c8d3837b3ca2f
|
||||||
timeCreated: 1594732377
|
|
||||||
licenseType: Pro
|
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
defaultReferences: []
|
defaultReferences: []
|
||||||
executionOrder: 0
|
executionOrder: 0
|
@@ -1,4 +1,4 @@
|
|||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr.Event {
|
||||||
public class TrackHandler : TransformHandler {
|
public class TrackHandler : TransformHandler {
|
||||||
protected override TransformHandler Parent { get { return _gh; } }
|
protected override TransformHandler Parent { get { return _gh; } }
|
||||||
readonly GroupHandler _gh;
|
readonly GroupHandler _gh;
|
@@ -1,8 +1,7 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: e1e306e8a7b15c7458de2e0b03551c86
|
guid: f9a4d5fe2d0dc5d4d869d91670cc1aab
|
||||||
timeCreated: 1593349834
|
|
||||||
licenseType: Pro
|
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
defaultReferences: []
|
defaultReferences: []
|
||||||
executionOrder: 0
|
executionOrder: 0
|
@@ -1,9 +1,8 @@
|
|||||||
using Cryville.Crtr.Components;
|
using Cryville.Crtr.Skin.Components;
|
||||||
using Cryville.Crtr.Event;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr.Event {
|
||||||
public abstract class TransformHandler : ContainerHandler {
|
public abstract class TransformHandler : ContainerHandler {
|
||||||
protected abstract TransformHandler Parent { get; }
|
protected abstract TransformHandler Parent { get; }
|
||||||
public override void Init() {
|
public override void Init() {
|
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: cd92dc120682e174cb42752bd304e12a
|
guid: b6f66c022b25fe344908a0e34ef40615
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
@@ -1,4 +1,5 @@
|
|||||||
using Cryville.Crtr.Extension;
|
using Cryville.Crtr.Extension;
|
||||||
|
using Cryville.Crtr.Ruleset;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -12,7 +13,7 @@ namespace Cryville.Crtr.Extensions.Umg {
|
|||||||
|
|
||||||
public override void Convert(FileInfo file, ConversionSession ses) {
|
public override void Convert(FileInfo file, ConversionSession ses) {
|
||||||
using (StreamReader reader = new StreamReader(file.FullName, Encoding.UTF8)) {
|
using (StreamReader reader = new StreamReader(file.FullName, Encoding.UTF8)) {
|
||||||
var data = JsonConvert.DeserializeObject<Ruleset>(reader.ReadToEnd());
|
var data = JsonConvert.DeserializeObject<RulesetDefinition>(reader.ReadToEnd());
|
||||||
ses.AddResource(new RulesetResource(data.name, file));
|
ses.AddResource(new RulesetResource(data.name, file));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,7 +21,7 @@ namespace Cryville.Crtr.Extensions.Umg {
|
|||||||
public class RulesetResource : FileResource {
|
public class RulesetResource : FileResource {
|
||||||
public RulesetResource(string name, FileInfo master) : base(name, master) {
|
public RulesetResource(string name, FileInfo master) : base(name, master) {
|
||||||
using (var reader = new StreamReader(master.FullName)) {
|
using (var reader = new StreamReader(master.FullName)) {
|
||||||
var meta = JsonConvert.DeserializeObject<Ruleset>(reader.ReadToEnd());
|
var meta = JsonConvert.DeserializeObject<RulesetDefinition>(reader.ReadToEnd());
|
||||||
Attachments.Add(new FileInfo(Path.Combine(master.Directory.FullName, meta.data + ".pdt")));
|
Attachments.Add(new FileInfo(Path.Combine(master.Directory.FullName, meta.data + ".pdt")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
using Cryville.Crtr.Extension;
|
using Cryville.Crtr.Extension;
|
||||||
|
using Cryville.Crtr.Skin;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -12,7 +13,7 @@ namespace Cryville.Crtr.Extensions.Umg {
|
|||||||
|
|
||||||
public override void Convert(FileInfo file, ConversionSession ses) {
|
public override void Convert(FileInfo file, ConversionSession ses) {
|
||||||
using (StreamReader reader = new StreamReader(file.FullName, Encoding.UTF8)) {
|
using (StreamReader reader = new StreamReader(file.FullName, Encoding.UTF8)) {
|
||||||
var data = JsonConvert.DeserializeObject<Skin>(reader.ReadToEnd());
|
var data = JsonConvert.DeserializeObject<SkinDefinition>(reader.ReadToEnd());
|
||||||
ses.AddResource(new SkinResource(data.name, file));
|
ses.AddResource(new SkinResource(data.name, file));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,7 +22,7 @@ namespace Cryville.Crtr.Extensions.Umg {
|
|||||||
public string RulesetName { get; private set; }
|
public string RulesetName { get; private set; }
|
||||||
public SkinResource(string name, FileInfo master) : base(name, master) {
|
public SkinResource(string name, FileInfo master) : base(name, master) {
|
||||||
using (var reader = new StreamReader(master.FullName)) {
|
using (var reader = new StreamReader(master.FullName)) {
|
||||||
var meta = JsonConvert.DeserializeObject<Skin>(reader.ReadToEnd());
|
var meta = JsonConvert.DeserializeObject<SkinDefinition>(reader.ReadToEnd());
|
||||||
RulesetName = meta.ruleset;
|
RulesetName = meta.ruleset;
|
||||||
Attachments.Add(new FileInfo(Path.Combine(master.Directory.FullName, meta.data + ".pdt")));
|
Attachments.Add(new FileInfo(Path.Combine(master.Directory.FullName, meta.data + ".pdt")));
|
||||||
foreach (var frame in meta.frames) {
|
foreach (var frame in meta.frames) {
|
||||||
|
@@ -4,15 +4,19 @@ using Cryville.Common.Font;
|
|||||||
using Cryville.Common.Logging;
|
using Cryville.Common.Logging;
|
||||||
using Cryville.Common.Unity;
|
using Cryville.Common.Unity;
|
||||||
using Cryville.Common.Unity.UI;
|
using Cryville.Common.Unity.UI;
|
||||||
|
using Cryville.Crtr.UI;
|
||||||
using Cryville.Input;
|
using Cryville.Input;
|
||||||
using Cryville.Input.Unity;
|
using Cryville.Input.Unity;
|
||||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||||
using Cryville.Input.Unity.Android;
|
using Cryville.Input.Unity.Android;
|
||||||
|
using Cryville.Interop.Java;
|
||||||
|
using Cryville.Interop.Java.Unity;
|
||||||
#endif
|
#endif
|
||||||
using FFmpeg.AutoGen;
|
using FFmpeg.AutoGen;
|
||||||
using Ionic.Zip;
|
using Ionic.Zip;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Logger = Cryville.Common.Logging.Logger;
|
using Logger = Cryville.Common.Logging.Logger;
|
||||||
@@ -23,6 +27,7 @@ namespace Cryville.Crtr {
|
|||||||
public static string GameDataPath { get; private set; }
|
public static string GameDataPath { get; private set; }
|
||||||
public static string UnityDataPath { get; private set; }
|
public static string UnityDataPath { get; private set; }
|
||||||
public static IAudioDeviceManager AudioManager;
|
public static IAudioDeviceManager AudioManager;
|
||||||
|
public static IAudioDevice AudioDevice;
|
||||||
public static AudioClient AudioClient;
|
public static AudioClient AudioClient;
|
||||||
public static SimpleSequencerSource AudioSequencer;
|
public static SimpleSequencerSource AudioSequencer;
|
||||||
public static SimpleSequencerSession AudioSession;
|
public static SimpleSequencerSession AudioSession;
|
||||||
@@ -49,11 +54,21 @@ namespace Cryville.Crtr {
|
|||||||
Application.logMessageReceivedThreaded += OnLog;
|
Application.logMessageReceivedThreaded += OnLog;
|
||||||
Logger.Create("main", MainLogger);
|
Logger.Create("main", MainLogger);
|
||||||
|
|
||||||
|
Logger.Log("main", 1, "Game", "Game Version: {0}", Application.version);
|
||||||
|
Logger.Log("main", 1, "Game", "Unity Version: {0}", Application.unityVersion);
|
||||||
|
Logger.Log("main", 1, "Game", "Operating System: {0}", Environment.OSVersion);
|
||||||
|
Logger.Log("main", 1, "Game", "Platform: Build = {0}, Unity = {1}", PlatformConfig.Name, Application.platform);
|
||||||
|
Logger.Log("main", 1, "Game", "Culture: {0}, UI = {1}, System = {2}, Unity = {3}", CultureInfo.CurrentCulture, CultureInfo.CurrentUICulture, CultureInfo.InstalledUICulture, Application.systemLanguage);
|
||||||
|
|
||||||
if (_bcflag) Logger.Log("main", 2, "Game", "Reset all settings");
|
if (_bcflag) Logger.Log("main", 2, "Game", "Reset all settings");
|
||||||
|
|
||||||
GameDataPath = Settings.Default.GameDataPath;
|
GameDataPath = Settings.Default.GameDataPath;
|
||||||
UnityDataPath = Application.dataPath;
|
UnityDataPath = Application.dataPath;
|
||||||
|
|
||||||
|
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||||
|
JavaVMManager.Register(JniInvoke.Instance);
|
||||||
|
#endif
|
||||||
|
|
||||||
unity::Input.simulateMouseWithTouches = false;
|
unity::Input.simulateMouseWithTouches = false;
|
||||||
var emptyObjectArray = new object[0];
|
var emptyObjectArray = new object[0];
|
||||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||||
@@ -82,18 +97,33 @@ namespace Cryville.Crtr {
|
|||||||
ffmpeg.RootPath = "";
|
ffmpeg.RootPath = "";
|
||||||
#else
|
#else
|
||||||
#error No FFmpeg search path.
|
#error No FFmpeg search path.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
|
||||||
|
EngineBuilder.Engines.Add(typeof(Audio.Wasapi.MMDeviceEnumeratorWrapper));
|
||||||
|
EngineBuilder.Engines.Add(typeof(Audio.WaveformAudio.WaveDeviceManager));
|
||||||
|
#elif UNITY_ANDROID
|
||||||
|
EngineBuilder.Engines.Add(typeof(Audio.AAudio.AAudioManager));
|
||||||
|
EngineBuilder.Engines.Add(typeof(Audio.OpenSLES.Engine));
|
||||||
|
#else
|
||||||
|
#error No audio engine defined.
|
||||||
#endif
|
#endif
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
AudioManager = EngineBuilder.Create();
|
AudioManager = EngineBuilder.Create();
|
||||||
if (AudioManager == null) {
|
if (AudioManager == null) {
|
||||||
Popup.Create("Cannot initialize audio engine");
|
Dialog.Show(null, "Fatal error: Cannot initialize audio engine");
|
||||||
Logger.Log("main", 5, "Audio", "Cannot initialize audio engine");
|
Logger.Log("main", 5, "Audio", "Cannot initialize audio engine");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Logger.Log("main", 1, "Audio", "Using audio API: {0}", AudioManager.GetType().Namespace);
|
Logger.Log("main", 1, "Audio", "Using audio API: {0}", AudioManager.GetType().Namespace);
|
||||||
AudioClient = AudioManager.GetDefaultDevice(DataFlow.Out).Connect();
|
AudioDevice = AudioManager.GetDefaultDevice(DataFlow.Out);
|
||||||
AudioClient.Init(AudioClient.DefaultFormat);
|
AudioClient = AudioDevice.Connect(AudioDevice.DefaultFormat, AudioDevice.MinimumBufferSize + AudioDevice.BurstSize);
|
||||||
|
Logger.Log(
|
||||||
|
"main", 1, "Audio",
|
||||||
|
"Audio Output = {{ Name = \"{0}\", BurstSize = {1}, Format = {2}, BufferSize = {3} }}",
|
||||||
|
AudioDevice.Name, AudioDevice.BurstSize, AudioClient.Format, AudioClient.BufferSize
|
||||||
|
);
|
||||||
AudioClient.Source = AudioSequencer = new SimpleSequencerSource();
|
AudioClient.Source = AudioSequencer = new SimpleSequencerSource();
|
||||||
AudioSession = AudioSequencer.NewSession();
|
AudioSession = AudioSequencer.NewSession();
|
||||||
AudioSequencer.Playing = true;
|
AudioSequencer.Playing = true;
|
||||||
@@ -102,6 +132,7 @@ namespace Cryville.Crtr {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
|
Dialog.Show(null, "An error occurred while trying to initialize the recommended audio engine\nTrying to use fallback audio engines");
|
||||||
Logger.Log("main", 4, "Audio", "An error occurred when initializing the audio engine: {0}", ex);
|
Logger.Log("main", 4, "Audio", "An error occurred when initializing the audio engine: {0}", ex);
|
||||||
Logger.Log("main", 2, "Audio", "Trying to use fallback audio engines");
|
Logger.Log("main", 2, "Audio", "Trying to use fallback audio engines");
|
||||||
EngineBuilder.Engines.Remove(AudioManager.GetType());
|
EngineBuilder.Engines.Remove(AudioManager.GetType());
|
||||||
@@ -139,6 +170,7 @@ namespace Cryville.Crtr {
|
|||||||
try {
|
try {
|
||||||
AudioClient.Dispose();
|
AudioClient.Dispose();
|
||||||
AudioSequencer.Dispose();
|
AudioSequencer.Dispose();
|
||||||
|
AudioDevice.Dispose();
|
||||||
AudioManager.Dispose();
|
AudioManager.Dispose();
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
|
@@ -1,12 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 1207cc17aa0c9ea469cfcf1508a3d5bb
|
|
||||||
timeCreated: 1618822453
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@@ -1,5 +1,4 @@
|
|||||||
using Cryville.Common.Buffers;
|
using Cryville.Common.Buffers;
|
||||||
using Cryville.Common.Collections.Specialized;
|
|
||||||
using Cryville.Common.Pdt;
|
using Cryville.Common.Pdt;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -35,80 +34,6 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class RealtimeMotionValue {
|
|
||||||
Type _type;
|
|
||||||
public Vector AbsoluteValue;
|
|
||||||
public Vector RelativeValue;
|
|
||||||
public IntKeyedDictionary<MotionNode> RelativeNodes;
|
|
||||||
internal byte CloneTypeFlag;
|
|
||||||
|
|
||||||
public RealtimeMotionValue Init(Vector init) {
|
|
||||||
_type = init.GetType();
|
|
||||||
RelativeNodes = new IntKeyedDictionary<MotionNode>();
|
|
||||||
AbsoluteValue = init;
|
|
||||||
RelativeValue = (Vector)Activator.CreateInstance(_type);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public RealtimeMotionValue Clone() {
|
|
||||||
return new RealtimeMotionValue() {
|
|
||||||
_type = _type,
|
|
||||||
AbsoluteValue = AbsoluteValue.Clone(),
|
|
||||||
RelativeValue = RelativeValue.Clone(),
|
|
||||||
RelativeNodes = RelativeNodes,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public void CopyTo(RealtimeMotionValue dest, bool cloneNodes) {
|
|
||||||
AbsoluteValue.CopyTo(dest.AbsoluteValue);
|
|
||||||
RelativeValue.CopyTo(dest.RelativeValue);
|
|
||||||
if (cloneNodes) {
|
|
||||||
dest.ReturnAllRelativeNodes();
|
|
||||||
foreach (var node in RelativeNodes) {
|
|
||||||
var dnode = MotionNodePool.Shared.Rent(_type);
|
|
||||||
node.Value.CopyTo(dnode);
|
|
||||||
dest.RelativeNodes.Add(node.Key, dnode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else dest.RelativeNodes = RelativeNodes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ReturnAllRelativeNodes() {
|
|
||||||
foreach (var node in RelativeNodes) {
|
|
||||||
MotionNodePool.Shared.Return(_type, node.Value);
|
|
||||||
}
|
|
||||||
RelativeNodes.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
public MotionNode GetRelativeNode(short id) {
|
|
||||||
MotionNode result;
|
|
||||||
RelativeNodes.TryGetValue(id, out result);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetRelativeNode(MotionNode node) {
|
|
||||||
MotionNode cnode;
|
|
||||||
if (!RelativeNodes.TryGetValue(node.Id, out cnode)) {
|
|
||||||
cnode = MotionNodePool.Shared.Rent(_type);
|
|
||||||
cnode.Id = node.Id;
|
|
||||||
RelativeNodes.Add(node.Id, cnode);
|
|
||||||
}
|
|
||||||
if (node.Time != null) node.Time.CopyTo(cnode.Time);
|
|
||||||
if (node.EndTime != null) node.EndTime.CopyTo(cnode.EndTime);
|
|
||||||
if (node.Value != null) node.Value.CopyTo(cnode.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Computes the motion value.
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="T">The vector type of the value.</typeparam>
|
|
||||||
/// <param name="result">The result.</param>
|
|
||||||
public void Compute<T>(ref T result) where T : Vector {
|
|
||||||
AbsoluteValue.CopyTo(result);
|
|
||||||
result.ApplyFrom(RelativeValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class MotionNode {
|
public class MotionNode {
|
||||||
public short Id = -1;
|
public short Id = -1;
|
||||||
public bool Reset;
|
public bool Reset;
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
using Cryville.Common.Network.Http11;
|
using Cryville.Common.Network.Http11;
|
||||||
using Cryville.Common.Unity;
|
using Cryville.Common.Unity;
|
||||||
|
using Cryville.Crtr.UI;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@@ -1,12 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 08f912088c111c54f9f93c0e2909cb08
|
|
||||||
timeCreated: 1603439909
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@@ -1,5 +1,6 @@
|
|||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
using Cryville.Common.Pdt;
|
using Cryville.Common.Pdt;
|
||||||
|
using Cryville.Crtr.Ruleset;
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using SIdentifier = Cryville.Common.Identifier;
|
using SIdentifier = Cryville.Common.Identifier;
|
||||||
|
@@ -4,6 +4,8 @@ using Cryville.Common.Math;
|
|||||||
using Cryville.Common.Pdt;
|
using Cryville.Common.Pdt;
|
||||||
using Cryville.Crtr.Config;
|
using Cryville.Crtr.Config;
|
||||||
using Cryville.Crtr.Event;
|
using Cryville.Crtr.Event;
|
||||||
|
using Cryville.Crtr.Ruleset;
|
||||||
|
using Cryville.Crtr.Skin;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
@@ -1,12 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 944c0595781268243b3c9b005ecbed91
|
|
||||||
timeCreated: 1611884196
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
8
Assets/Cryville/Crtr/Ruleset.meta
Normal file
8
Assets/Cryville/Crtr/Ruleset.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 67b93c294681b73409a52a4d03a36d52
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -11,7 +11,7 @@ using UnityEngine.Profiling;
|
|||||||
using Logger = Cryville.Common.Logging.Logger;
|
using Logger = Cryville.Common.Logging.Logger;
|
||||||
using RVector4 = UnityEngine.Vector4;
|
using RVector4 = UnityEngine.Vector4;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr.Ruleset {
|
||||||
public class InputProxy : IDisposable {
|
public class InputProxy : IDisposable {
|
||||||
readonly PdtEvaluator _etor;
|
readonly PdtEvaluator _etor;
|
||||||
readonly PdtRuleset _ruleset;
|
readonly PdtRuleset _ruleset;
|
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 745ed7d8ca6e4ac458c7e008b966aad1
|
guid: af16092e83ce23d46b46254e2d9798f9
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
@@ -3,6 +3,7 @@ using Cryville.Common.Buffers;
|
|||||||
using Cryville.Common.Collections.Generic;
|
using Cryville.Common.Collections.Generic;
|
||||||
using Cryville.Common.Collections.Specialized;
|
using Cryville.Common.Collections.Specialized;
|
||||||
using Cryville.Common.Pdt;
|
using Cryville.Common.Pdt;
|
||||||
|
using Cryville.Crtr.Event;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
@@ -11,7 +12,7 @@ using System.Text.Formatting;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnsafeIL;
|
using UnsafeIL;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr.Ruleset {
|
||||||
internal struct JudgeResult {
|
internal struct JudgeResult {
|
||||||
public float? Time { get; set; }
|
public float? Time { get; set; }
|
||||||
public Vector4 Vector { get; set; }
|
public Vector4 Vector { get; set; }
|
11
Assets/Cryville/Crtr/Ruleset/Judge.cs.meta
Normal file
11
Assets/Cryville/Crtr/Ruleset/Judge.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c3063149610959f4e853ced6341a9d36
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -4,7 +4,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr.Ruleset {
|
||||||
internal struct JudgeActionResult {
|
internal struct JudgeActionResult {
|
||||||
public bool BreakExecution;
|
public bool BreakExecution;
|
||||||
public bool PreventRecycle;
|
public bool PreventRecycle;
|
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: f7e5a4fc83d8c4a4db15856783b8a145
|
guid: 52c6416297266354999ce5ff46a568dc
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user