Compare commits
78 Commits
15e66d29c4
...
0.5.0
Author | SHA1 | Date | |
---|---|---|---|
69e4ecd0a9 | |||
35d2e06625 | |||
358e654f51 | |||
d16548e570 | |||
c7201dd62c | |||
e43a0e62b7 | |||
4bcf76819c | |||
31155c909c | |||
ab2670358a | |||
3da70bdccc | |||
e370e1937c | |||
d9f6dd33d4 | |||
e5d6e549bd | |||
145c0ce6c8 | |||
a0174b94c6 | |||
109b489104 | |||
784c3fc338 | |||
77d6ac2caf | |||
321af22775 | |||
39ef9815e8 | |||
bb3afba11f | |||
e4fa160a90 | |||
34df9e2257 | |||
cfdb5f021e | |||
d08eea5c1e | |||
ce30b5427b | |||
e38fed89e9 | |||
d4b12bf3f7 | |||
40d75a91c6 | |||
388a41cb55 | |||
3b23f78960 | |||
4fce8369f0 | |||
373554912a | |||
46039f6a12 | |||
9b872654d5 | |||
2c4ac3191c | |||
20632d9b54 | |||
28cad97bbb | |||
75652ecff1 | |||
1734cf9b72 | |||
5eb9786a7c | |||
16be67dc75 | |||
a7dfaa4558 | |||
3b65dbea5b | |||
3ed7e566dd | |||
f3549353f3 | |||
78bb820f9e | |||
b954dda676 | |||
1be5cc77ca | |||
bf942cbe45 | |||
79bfd6764c | |||
dcc92bb024 | |||
15e9217f93 | |||
79240fdfe8 | |||
678e145271 | |||
5cdf10874e | |||
777b7d9c34 | |||
34b17f3111 | |||
fd9e2ce409 | |||
cd8aa0e65c | |||
5240408f00 | |||
a7e6522a57 | |||
d89e5a2e68 | |||
05124ac406 | |||
a4fdb97424 | |||
735a85b914 | |||
be0c71702b | |||
535959a6ed | |||
ae37b27dc0 | |||
80cc5fdbda | |||
87e406e903 | |||
f04d0ec299 | |||
a19057f869 | |||
d0d981b790 | |||
c95ae92ba8 | |||
31e9f1352b | |||
9974b25377 | |||
852c93c6d0 |
1
.gitignore
vendored
@@ -61,6 +61,7 @@ crashlytics-build.properties
|
|||||||
#
|
#
|
||||||
/Docs
|
/Docs
|
||||||
/Issues
|
/Issues
|
||||||
|
/Local
|
||||||
/Obsolete
|
/Obsolete
|
||||||
/Snapshots
|
/Snapshots
|
||||||
/UI
|
/UI
|
||||||
|
120
Assets/Cryville/Common/Buffers/TargetString.cs
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Cryville.Common.Buffers {
|
||||||
|
/// <summary>
|
||||||
|
/// An auto-resized <see cref="char" /> array as a variable-length string used as a target that is modified frequently.
|
||||||
|
/// </summary>
|
||||||
|
public class TargetString : IEnumerable<char> {
|
||||||
|
public event Action OnUpdate;
|
||||||
|
char[] _arr;
|
||||||
|
bool _invalidated;
|
||||||
|
/// <summary>
|
||||||
|
/// Creates an instance of the <see cref="TargetString" /> class with a capacity of 16.
|
||||||
|
/// </summary>
|
||||||
|
public TargetString() : this(16) { }
|
||||||
|
/// <summary>
|
||||||
|
/// Creates an instance of the <see cref="TargetString" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="capacity">The initial capacity of the string.</param>
|
||||||
|
public TargetString(int capacity) {
|
||||||
|
_arr = new char[capacity];
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets one of the characters in the string.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="index">The zero-based index of the character.</param>
|
||||||
|
/// <returns>The character at the given index.</returns>
|
||||||
|
/// <exception cref="ArgumentOutOfRangeException"><paramref name="index" /> is less than 0 or not less than <see cref="Length" />.</exception>
|
||||||
|
/// <remarks>
|
||||||
|
/// <para>Set <see cref="Length" /> to a desired value before updating the characters.</para>
|
||||||
|
/// <para>Call <see cref=" Validate" /> after all the characters are updated.</para>
|
||||||
|
/// </remarks>
|
||||||
|
public char this[int index] {
|
||||||
|
get {
|
||||||
|
if (index < 0 || index >= m_length)
|
||||||
|
throw new ArgumentOutOfRangeException("index");
|
||||||
|
return _arr[index];
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if (index < 0 || index >= m_length)
|
||||||
|
throw new ArgumentOutOfRangeException("index");
|
||||||
|
if (_arr[index] == value) return;
|
||||||
|
_arr[index] = value;
|
||||||
|
_invalidated = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int m_length;
|
||||||
|
/// <summary>
|
||||||
|
/// The length of the string.
|
||||||
|
/// </summary>
|
||||||
|
public int Length {
|
||||||
|
get {
|
||||||
|
return m_length;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if (m_length == value) return;
|
||||||
|
if (_arr.Length < value) {
|
||||||
|
var len = m_length;
|
||||||
|
while (len < value) len *= 2;
|
||||||
|
var arr2 = new char[len];
|
||||||
|
Array.Copy(_arr, arr2, m_length);
|
||||||
|
_arr = arr2;
|
||||||
|
}
|
||||||
|
m_length = value;
|
||||||
|
_invalidated = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Validates the string.
|
||||||
|
/// </summary>
|
||||||
|
public void Validate() {
|
||||||
|
if (!_invalidated) return;
|
||||||
|
_invalidated = false;
|
||||||
|
var ev = OnUpdate;
|
||||||
|
if (ev != null) OnUpdate.Invoke();
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerator IEnumerable.GetEnumerator() {
|
||||||
|
return GetEnumerator();
|
||||||
|
}
|
||||||
|
public IEnumerator<char> GetEnumerator() {
|
||||||
|
return new Enumerator(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
class Enumerator : IEnumerator<char> {
|
||||||
|
readonly TargetString _self;
|
||||||
|
int _index = -1;
|
||||||
|
public Enumerator(TargetString self) { _self = self; }
|
||||||
|
|
||||||
|
public char Current {
|
||||||
|
get {
|
||||||
|
if (_index < 0)
|
||||||
|
throw new InvalidOperationException(_index == -1 ? "Enum not started" : "Enum ended");
|
||||||
|
return _self[_index];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
object IEnumerator.Current { get { return Current; } }
|
||||||
|
|
||||||
|
public void Dispose() {
|
||||||
|
_index = -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool MoveNext() {
|
||||||
|
if (_index == -2) return false;
|
||||||
|
_index++;
|
||||||
|
if (_index >= _self.Length) {
|
||||||
|
_index = -2;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Reset() {
|
||||||
|
_index = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,8 +1,7 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: da665e46f8c2b5b46ad8e3bf5cd34007
|
guid: f0fc34ac257793d4883a9cfcdb6941b9
|
||||||
timeCreated: 1605077404
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
defaultReferences: []
|
defaultReferences: []
|
||||||
executionOrder: 0
|
executionOrder: 0
|
@@ -10,10 +10,10 @@ namespace Cryville.Common {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static IdentifierManager SharedInstance = new IdentifierManager();
|
public static IdentifierManager SharedInstance = new IdentifierManager();
|
||||||
|
|
||||||
Dictionary<object, int> _idents = new Dictionary<object, int>();
|
readonly Dictionary<object, int> _idents = new Dictionary<object, int>();
|
||||||
List<object> _ids = new List<object>();
|
readonly List<object> _ids = new List<object>();
|
||||||
|
|
||||||
object _syncRoot = new object();
|
readonly object _syncRoot = new object();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance of the <see cref="IdentifierManager" /> class.
|
/// Creates an instance of the <see cref="IdentifierManager" /> class.
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace Cryville.Common {
|
namespace Cryville.Common {
|
||||||
@@ -40,7 +41,7 @@ namespace Cryville.Common {
|
|||||||
public static void Create(string key, Logger logger) {
|
public static void Create(string key, Logger logger) {
|
||||||
Instances[key] = logger;
|
Instances[key] = logger;
|
||||||
if (logPath != null) {
|
if (logPath != null) {
|
||||||
Files[key] = new StreamWriter(logPath + "/" + ((int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds).ToString() + "-" + key + ".log") {
|
Files[key] = new StreamWriter(logPath + "/" + ((int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds).ToString(CultureInfo.InvariantCulture) + "-" + key + ".log") {
|
||||||
AutoFlush = true
|
AutoFlush = true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
52
Assets/Cryville/Common/Math/FractionUtils.cs
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Cryville.Common.Math {
|
||||||
|
/// <summary>
|
||||||
|
/// Provides a set of <see langword="static" /> methods related to fractions.
|
||||||
|
/// </summary>
|
||||||
|
public static class FractionUtils {
|
||||||
|
/// <summary>
|
||||||
|
/// Converts a <see cref="double" /> decimal to a fraction.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">The decimal.</param>
|
||||||
|
/// <param name="error">The error.</param>
|
||||||
|
/// <param name="n">The numerator.</param>
|
||||||
|
/// <param name="d">The denominator.</param>
|
||||||
|
/// <exception cref="ArgumentOutOfRangeException"><paramref name="value" /> is less than 0 or <paramref name="error" /> is not greater than 0 or not less than 1.</exception>
|
||||||
|
public static void ToFraction(double value, double error, out int n, out int d) {
|
||||||
|
if (value < 0.0)
|
||||||
|
throw new ArgumentOutOfRangeException("value", "Must be >= 0.");
|
||||||
|
if (error <= 0.0 || error >= 1.0)
|
||||||
|
throw new ArgumentOutOfRangeException("accuracy", "Must be > 0 and < 1.");
|
||||||
|
|
||||||
|
int num = (int)System.Math.Floor(value);
|
||||||
|
value -= num;
|
||||||
|
|
||||||
|
if (value < error) { n = num; d = 1; return; }
|
||||||
|
if (1 - error < value) { n = num + 1; d = 1; return; }
|
||||||
|
|
||||||
|
int lower_n = 0;
|
||||||
|
int lower_d = 1;
|
||||||
|
int upper_n = 1;
|
||||||
|
int upper_d = 1;
|
||||||
|
while (true) {
|
||||||
|
int middle_n = lower_n + upper_n;
|
||||||
|
int middle_d = lower_d + upper_d;
|
||||||
|
|
||||||
|
if (middle_d * (value + error) < middle_n) {
|
||||||
|
upper_n = middle_n;
|
||||||
|
upper_d = middle_d;
|
||||||
|
}
|
||||||
|
else if (middle_n < (value - error) * middle_d) {
|
||||||
|
lower_n = middle_n;
|
||||||
|
lower_d = middle_d;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
n = num * middle_d + middle_n;
|
||||||
|
d = middle_d;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,8 +1,7 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 3bc71e8b62d4022409aa5518bbf3a7d8
|
guid: 6829ada596979a545a935785eeea2972
|
||||||
timeCreated: 1608801352
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
defaultReferences: []
|
defaultReferences: []
|
||||||
executionOrder: 0
|
executionOrder: 0
|
@@ -77,7 +77,7 @@ namespace Cryville.Common.Network {
|
|||||||
encoding = Encoding.UTF8;
|
encoding = Encoding.UTF8;
|
||||||
payload = encoding.GetBytes(body);
|
payload = encoding.GetBytes(body);
|
||||||
headers.Add("Content-Encoding", encoding.EncodingName);
|
headers.Add("Content-Encoding", encoding.EncodingName);
|
||||||
headers.Add("Content-Length", payload.Length.ToString());
|
headers.Add("Content-Length", payload.Length.ToString(CultureInfo.InvariantCulture));
|
||||||
}
|
}
|
||||||
string request_line = string.Format(
|
string request_line = string.Format(
|
||||||
"{0} {1} {2}\r\n", method, uri, Version
|
"{0} {1} {2}\r\n", method, uri, Version
|
||||||
|
@@ -19,9 +19,7 @@ namespace Cryville.Common.Network {
|
|||||||
set { throw new NotSupportedException(); }
|
set { throw new NotSupportedException(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Flush() {
|
public override void Flush() { }
|
||||||
// Do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract byte[] ReadToEnd();
|
public abstract byte[] ReadToEnd();
|
||||||
|
|
||||||
|
@@ -28,7 +28,7 @@ namespace Cryville.Common.Network {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class InternalTlsClient : DefaultTlsClient {
|
private class InternalTlsClient : DefaultTlsClient {
|
||||||
string _host;
|
readonly string _host;
|
||||||
|
|
||||||
public InternalTlsClient(string host, TlsCrypto crypto) : base(crypto) {
|
public InternalTlsClient(string host, TlsCrypto crypto) : base(crypto) {
|
||||||
_host = host;
|
_host = host;
|
||||||
@@ -92,9 +92,7 @@ namespace Cryville.Common.Network {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void NotifyServerCertificate(TlsServerCertificate serverCertificate) {
|
public void NotifyServerCertificate(TlsServerCertificate serverCertificate) { }
|
||||||
// Do nothing
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,49 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
namespace Cryville.Common.Plist {
|
|
||||||
public class PlistConvert {
|
|
||||||
public static T Deserialize<T>(string file) {
|
|
||||||
return (T)Deserialize(typeof(T), PlistCS.Plist.readPlist(file));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static object Deserialize(Type type, object obj, Binder binder = null) {
|
|
||||||
if (binder == null)
|
|
||||||
binder = BinderAttribute.CreateBinderOfType(type);
|
|
||||||
if (obj is IList) {
|
|
||||||
var lobj = (List<object>)obj;
|
|
||||||
foreach (var i in lobj) {
|
|
||||||
throw new NotImplementedException(); // TODO
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (obj is IDictionary) {
|
|
||||||
var dobj = (Dictionary<string, object>)obj;
|
|
||||||
if (typeof(IDictionary).IsAssignableFrom(type)) {
|
|
||||||
var result = (IDictionary)ReflectionHelper.InvokeEmptyConstructor(type);
|
|
||||||
var it = type.GetGenericArguments()[1];
|
|
||||||
foreach (var i in dobj) {
|
|
||||||
var value = Deserialize(it, i.Value, binder);
|
|
||||||
result.Add(i.Key, value);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var result = ReflectionHelper.InvokeEmptyConstructor(type);
|
|
||||||
foreach (var i in dobj) {
|
|
||||||
var imis = type.GetMember(i.Key);
|
|
||||||
if (imis.Length == 0) continue;
|
|
||||||
var imi = imis[0];
|
|
||||||
var it = ReflectionHelper.GetMemberType(imi);
|
|
||||||
var value = Deserialize(it, i.Value, binder);
|
|
||||||
ReflectionHelper.SetValue(imi, result, value, binder);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else return obj;
|
|
||||||
throw new Exception(); // TODO
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -40,7 +40,9 @@ namespace Cryville.Common {
|
|||||||
/// <param name="name">The file name excluding the extension.</param>
|
/// <param name="name">The file name excluding the extension.</param>
|
||||||
/// <returns>The escaped file name.</returns>
|
/// <returns>The escaped file name.</returns>
|
||||||
public static string EscapeFileName(string name) {
|
public static string EscapeFileName(string name) {
|
||||||
return Regex.Replace(name, @"[\/\\\<\>\:\x22\|\?\*\p{Cc}\.\s]", "_");
|
var result = Regex.Replace(name, @"[\/\\\<\>\:\x22\|\?\*\p{Cc}]", "_").TrimEnd(' ', '.');
|
||||||
|
if (result.Length == 0) return "_";
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,8 +11,7 @@ namespace Cryville.Common.Unity.Input {
|
|||||||
typeof(UnityMouseHandler),
|
typeof(UnityMouseHandler),
|
||||||
typeof(UnityTouchHandler),
|
typeof(UnityTouchHandler),
|
||||||
};
|
};
|
||||||
// TODO set private
|
readonly List<InputHandler> _handlers = new List<InputHandler>();
|
||||||
public readonly List<InputHandler> _handlers = new List<InputHandler>();
|
|
||||||
readonly Dictionary<Type, InputHandler> _typemap = new Dictionary<Type, InputHandler>();
|
readonly Dictionary<Type, InputHandler> _typemap = new Dictionary<Type, InputHandler>();
|
||||||
readonly Dictionary<InputHandler, double> _timeOrigins = new Dictionary<InputHandler, double>();
|
readonly Dictionary<InputHandler, double> _timeOrigins = new Dictionary<InputHandler, double>();
|
||||||
readonly object _lock = new object();
|
readonly object _lock = new object();
|
||||||
|
@@ -49,6 +49,9 @@ namespace Cryville.Common.Unity.Input {
|
|||||||
Callback = h;
|
Callback = h;
|
||||||
}
|
}
|
||||||
public abstract string GetKeyName(int type);
|
public abstract string GetKeyName(int type);
|
||||||
|
void Awake() {
|
||||||
|
useGUILayout = false;
|
||||||
|
}
|
||||||
void Update() {
|
void Update() {
|
||||||
double time = Time.realtimeSinceStartupAsDouble;
|
double time = Time.realtimeSinceStartupAsDouble;
|
||||||
foreach (var k in Keys) {
|
foreach (var k in Keys) {
|
||||||
|
@@ -126,8 +126,8 @@ namespace Cryville.Common.Unity.UI {
|
|||||||
void Update() {
|
void Update() {
|
||||||
Vector2 cprectsize = ((RectTransform)transform.parent).rect.size;
|
Vector2 cprectsize = ((RectTransform)transform.parent).rect.size;
|
||||||
if (cprectsize != pprectsize) {
|
if (cprectsize != pprectsize) {
|
||||||
OnFrameUpdate();
|
|
||||||
pprectsize = cprectsize;
|
pprectsize = cprectsize;
|
||||||
|
OnFrameUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#pragma warning restore IDE0051
|
#pragma warning restore IDE0051
|
||||||
|
22
Assets/Cryville/Crtr/Browsing/ChartResourceImporter.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Cryville.Crtr.Browsing {
|
||||||
|
public class ChartResourceImporter : ResourceConverter {
|
||||||
|
static readonly string[] SUPPORTED_FORMATS = { ".umgc" };
|
||||||
|
public override string[] GetSupportedFormats() {
|
||||||
|
return SUPPORTED_FORMATS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override IEnumerable<Resource> ConvertFrom(FileInfo file) {
|
||||||
|
var meta = Path.Combine(file.Directory.FullName, "meta.json");
|
||||||
|
if (!File.Exists(meta)) throw new FileNotFoundException("Meta file for the chart not found");
|
||||||
|
using (StreamReader reader = new StreamReader(meta, Encoding.UTF8)) {
|
||||||
|
var data = JsonConvert.DeserializeObject<ChartMeta>(reader.ReadToEnd());
|
||||||
|
return new Resource[] { new ChartResource(data.name, file) };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Cryville/Crtr/Browsing/ChartResourceImporter.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 168366bb891392b42a1d0a6bfa068ff3
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -47,11 +47,11 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
_cover.sprite = m_coverPlaceholder;
|
_cover.sprite = m_coverPlaceholder;
|
||||||
if (data.Cover != null) data.Cover.Destination = DisplayCover;
|
if (data.Cover != null) data.Cover.Destination = DisplayCover;
|
||||||
var meta = data.Meta;
|
var meta = data.Meta;
|
||||||
_title.text = string.Format("{0}\n{1}", meta.song.name, meta.chart.name);
|
_title.text = string.Format("{0}\n{1}", meta.song.name, meta.name);
|
||||||
_desc.text = string.Format(
|
_desc.text = string.Format(
|
||||||
"Music artist: {0}\nCharter: {1}\nLength: {2}\nNote Count: {3}",
|
"Music artist: {0}\nCharter: {1}\nLength: {2}\nNote Count: {3}",
|
||||||
meta.song.author, meta.chart.author,
|
meta.song.author, meta.author,
|
||||||
TimeSpan.FromSeconds(meta.chart.length).ToString(3), meta.note_count
|
TimeSpan.FromSeconds(meta.length).ToString(3), meta.note_count
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
private void DisplayCover(bool succeeded, Texture2D tex) {
|
private void DisplayCover(bool succeeded, Texture2D tex) {
|
||||||
|
@@ -59,23 +59,26 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
|
|
||||||
public ResourceItemMeta GetItemMeta(int id) {
|
public ResourceItemMeta GetItemMeta(int id) {
|
||||||
var item = items[id];
|
var item = items[id];
|
||||||
|
var meta = new ChartMeta();
|
||||||
|
string name = item.Name;
|
||||||
|
string desc = "(Unknown)";
|
||||||
|
var metaFile = new FileInfo(item.FullName + "/.umgc");
|
||||||
|
if (metaFile.Exists) {
|
||||||
|
using (var reader = new StreamReader(metaFile.FullName)) {
|
||||||
|
meta = JsonConvert.DeserializeObject<ChartMeta>(reader.ReadToEnd());
|
||||||
|
name = meta.song.name;
|
||||||
|
desc = meta.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
AsyncDelivery<Texture2D> cover = null;
|
AsyncDelivery<Texture2D> cover = null;
|
||||||
var coverFile = item.GetFiles("cover.*");
|
if (meta.cover != null && meta.cover != "") {
|
||||||
|
var coverFile = item.GetFiles(meta.cover);
|
||||||
if (coverFile.Length > 0) {
|
if (coverFile.Length > 0) {
|
||||||
cover = new AsyncDelivery<Texture2D>();
|
cover = new AsyncDelivery<Texture2D>();
|
||||||
var task = new LoadTextureTask(Game.FileProtocolPrefix + coverFile[0].FullName, cover.Deliver);
|
var task = new LoadTextureTask(Game.FileProtocolPrefix + coverFile[0].FullName, cover.Deliver);
|
||||||
cover.CancelSource = task.Cancel;
|
cover.CancelSource = task.Cancel;
|
||||||
Game.NetworkTaskWorker.SubmitNetworkTask(task);
|
Game.NetworkTaskWorker.SubmitNetworkTask(task);
|
||||||
}
|
}
|
||||||
string name = item.Name;
|
|
||||||
string desc = "(Unknown)";
|
|
||||||
var metaFile = new FileInfo(item.FullName + "/meta.json");
|
|
||||||
if (metaFile.Exists) {
|
|
||||||
using (var reader = new StreamReader(metaFile.FullName)) {
|
|
||||||
var meta = JsonConvert.DeserializeObject<ChartMeta>(reader.ReadToEnd());
|
|
||||||
name = meta.song.name;
|
|
||||||
desc = meta.chart.name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return new ResourceItemMeta {
|
return new ResourceItemMeta {
|
||||||
IsDirectory = false,
|
IsDirectory = false,
|
||||||
@@ -87,20 +90,22 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
|
|
||||||
public ChartDetail GetItemDetail(int id) {
|
public ChartDetail GetItemDetail(int id) {
|
||||||
var item = items[id];
|
var item = items[id];
|
||||||
|
var meta = new ChartMeta();
|
||||||
|
var metaFile = new FileInfo(item.FullName + "/.umgc");
|
||||||
|
if (metaFile.Exists) {
|
||||||
|
using (var reader = new StreamReader(metaFile.FullName)) {
|
||||||
|
meta = JsonConvert.DeserializeObject<ChartMeta>(reader.ReadToEnd());
|
||||||
|
}
|
||||||
|
}
|
||||||
AsyncDelivery<Texture2D> cover = null;
|
AsyncDelivery<Texture2D> cover = null;
|
||||||
var coverFile = item.GetFiles("cover.*");
|
if (meta.cover != null && meta.cover != "") {
|
||||||
|
var coverFile = item.GetFiles(meta.cover);
|
||||||
if (coverFile.Length > 0) {
|
if (coverFile.Length > 0) {
|
||||||
cover = new AsyncDelivery<Texture2D>();
|
cover = new AsyncDelivery<Texture2D>();
|
||||||
var task = new LoadTextureTask(Game.FileProtocolPrefix + coverFile[0].FullName, cover.Deliver);
|
var task = new LoadTextureTask(Game.FileProtocolPrefix + coverFile[0].FullName, cover.Deliver);
|
||||||
cover.CancelSource = task.Cancel;
|
cover.CancelSource = task.Cancel;
|
||||||
Game.NetworkTaskWorker.SubmitNetworkTask(task);
|
Game.NetworkTaskWorker.SubmitNetworkTask(task);
|
||||||
}
|
}
|
||||||
ChartMeta meta = new ChartMeta();
|
|
||||||
var metaFile = new FileInfo(item.FullName + "/meta.json");
|
|
||||||
if (metaFile.Exists) {
|
|
||||||
using (var reader = new StreamReader(metaFile.FullName)) {
|
|
||||||
meta = JsonConvert.DeserializeObject<ChartMeta>(reader.ReadToEnd());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return new ChartDetail {
|
return new ChartDetail {
|
||||||
Cover = cover,
|
Cover = cover,
|
||||||
@@ -109,7 +114,13 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public string GetItemPath(int id) {
|
public string GetItemPath(int id) {
|
||||||
return items[id].Name + "/.umgc";
|
var item = items[id];
|
||||||
|
var meta = new ChartMeta();
|
||||||
|
var metaFile = new FileInfo(item.FullName + "/.umgc");
|
||||||
|
using (var reader = new StreamReader(metaFile.FullName)) {
|
||||||
|
meta = JsonConvert.DeserializeObject<ChartMeta>(reader.ReadToEnd());
|
||||||
|
}
|
||||||
|
return string.Format("{0}/{1}.json", items[id].Name, meta.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ImportItemFrom(string path) {
|
public bool ImportItemFrom(string path) {
|
||||||
@@ -121,38 +132,56 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
resources = converter.ConvertFrom(file);
|
resources = converter.ConvertFrom(file);
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
Popup.Create(ex.Message);
|
LogAndPopup(4, ex.Message);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
foreach (var res in resources) {
|
foreach (var res in resources) {
|
||||||
if (!res.Valid) {
|
if (!res.Valid) {
|
||||||
Logger.Log("main", 3, "Resource", "Attempt to import invalid resource {0}", res);
|
LogAndPopup(3, "Attempt to import invalid resource: {0}", res);
|
||||||
}
|
}
|
||||||
else if (res is ChartResource) {
|
else if (res is RawChartResource) {
|
||||||
var tres = (ChartResource)res;
|
var tres = (RawChartResource)res;
|
||||||
var dir = new DirectoryInfo(_rootPath + "/charts/" + res.Name);
|
var dir = new DirectoryInfo(_rootPath + "/charts/" + res.Name);
|
||||||
if (!dir.Exists) dir.Create();
|
if (!dir.Exists) dir.Create();
|
||||||
using (var writer = new StreamWriter(dir.FullName + "/.umgc")) {
|
using (var writer = new StreamWriter(dir.FullName + "/.json")) {
|
||||||
writer.Write(JsonConvert.SerializeObject(tres.Main, Game.GlobalJsonSerializerSettings));
|
writer.Write(JsonConvert.SerializeObject(tres.Main, Game.GlobalJsonSerializerSettings));
|
||||||
}
|
}
|
||||||
using (var writer = new StreamWriter(dir.FullName + "/meta.json")) {
|
using (var writer = new StreamWriter(dir.FullName + "/.umgc")) {
|
||||||
|
tres.Meta.data = "";
|
||||||
writer.Write(JsonConvert.SerializeObject(tres.Meta, Game.GlobalJsonSerializerSettings));
|
writer.Write(JsonConvert.SerializeObject(tres.Meta, Game.GlobalJsonSerializerSettings));
|
||||||
}
|
}
|
||||||
|
if (tres.Meta.cover != null) {
|
||||||
|
var coverFile = new FileInfo(Path.Combine(file.Directory.FullName, tres.Meta.cover));
|
||||||
|
if (coverFile.Exists)
|
||||||
|
coverFile.CopyTo(Path.Combine(dir.FullName, tres.Meta.cover), true);
|
||||||
}
|
}
|
||||||
else if (res is CoverResource) {
|
|
||||||
var tres = (CoverResource)res;
|
|
||||||
var dir = new DirectoryInfo(_rootPath + "/charts/" + res.Name);
|
|
||||||
if (!dir.Exists) dir.Create();
|
|
||||||
var dest = new FileInfo(_rootPath + "/charts/" + res.Name + "/cover" + tres.Source.Extension);
|
|
||||||
if (!dest.Exists) tres.Source.CopyTo(dest.FullName);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (res is SongResource) {
|
else if (res is FileResource) {
|
||||||
var tres = (SongResource)res;
|
var tres = (FileResource)res;
|
||||||
var dir = new DirectoryInfo(_rootPath + "/songs/" + res.Name);
|
DirectoryInfo dest;
|
||||||
if (!dir.Exists) dir.Create();
|
if (res is ChartResource)
|
||||||
var dest = new FileInfo(_rootPath + "/songs/" + res.Name + "/.ogg");
|
dest = new DirectoryInfo(_rootPath + "/charts/" + res.Name);
|
||||||
if (!dest.Exists) tres.Source.CopyTo(dest.FullName);
|
else if (res is RulesetResource)
|
||||||
|
dest = new DirectoryInfo(_rootPath + "/rulesets/" + res.Name);
|
||||||
|
else if (res is SkinResource)
|
||||||
|
dest = new DirectoryInfo(_rootPath + "/skins/" + (res as SkinResource).RulesetName + "/" + res.Name);
|
||||||
|
else if (res is SongResource)
|
||||||
|
dest = new DirectoryInfo(_rootPath + "/songs/" + res.Name);
|
||||||
|
else {
|
||||||
|
LogAndPopup(3, "Attempt to import unsupported file resource: {0}", res);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!dest.Exists) {
|
||||||
|
dest.Create();
|
||||||
|
tres.Master.CopyTo(Path.Combine(dest.FullName, tres.Master.Extension));
|
||||||
|
foreach (var attachment in tres.Attachments) {
|
||||||
|
attachment.CopyTo(Path.Combine(dest.FullName, attachment.Name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else LogAndPopup(1, "Resource already exists: {0}", res);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LogAndPopup(3, "Attempt to import unsupported resource: {0}", res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -160,6 +189,12 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LogAndPopup(int level, string format, params object[] args) {
|
||||||
|
var msg = string.Format(format, args);
|
||||||
|
Logger.Log("main", level, "Resource", msg);
|
||||||
|
Popup.Create(msg);
|
||||||
|
}
|
||||||
|
|
||||||
public string[] GetSupportedFormats() {
|
public string[] GetSupportedFormats() {
|
||||||
return converters.Keys.ToArray();
|
return converters.Keys.ToArray();
|
||||||
}
|
}
|
||||||
|
28
Assets/Cryville/Crtr/Browsing/PVPString.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace Cryville.Crtr.Browsing {
|
||||||
|
public class PVPString : PropertyValuePanel {
|
||||||
|
string m_value;
|
||||||
|
public override object Value {
|
||||||
|
get {
|
||||||
|
return m_value;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
m_value = (string)value;
|
||||||
|
_inputField.text = m_value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
InputField _inputField;
|
||||||
|
|
||||||
|
void Awake() {
|
||||||
|
_inputField = GetComponent<InputField>();
|
||||||
|
_inputField.onValueChanged.AddListener(OnValueChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnValueChanged(string value) {
|
||||||
|
m_value = value;
|
||||||
|
Callback(Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Cryville/Crtr/Browsing/PVPString.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: aadf11739189bc94e9cb4f702eb7ccd3
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -10,6 +10,8 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
GameObject m_bool;
|
GameObject m_bool;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
GameObject m_number;
|
GameObject m_number;
|
||||||
|
[SerializeField]
|
||||||
|
GameObject m_string;
|
||||||
|
|
||||||
PropertyInfo _property;
|
PropertyInfo _property;
|
||||||
object _target;
|
object _target;
|
||||||
@@ -32,6 +34,7 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
GameObject vp;
|
GameObject vp;
|
||||||
if (prop.PropertyType == typeof(bool)) vp = m_bool;
|
if (prop.PropertyType == typeof(bool)) vp = m_bool;
|
||||||
else if (prop.PropertyType == typeof(float) || prop.PropertyType == typeof(int)) vp = m_number;
|
else if (prop.PropertyType == typeof(float) || prop.PropertyType == typeof(int)) vp = m_number;
|
||||||
|
else if (prop.PropertyType == typeof(string)) vp = m_string;
|
||||||
else return;
|
else return;
|
||||||
_value = GameObject.Instantiate(vp, _valueContainer, false).GetComponent<PropertyValuePanel>();
|
_value = GameObject.Instantiate(vp, _valueContainer, false).GetComponent<PropertyValuePanel>();
|
||||||
if (_value is PVPNumber) {
|
if (_value is PVPNumber) {
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
using Cryville.Common.Unity;
|
using Cryville.Common.Unity;
|
||||||
using Cryville.Common.Unity.UI;
|
using Cryville.Common.Unity.UI;
|
||||||
|
using System;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
@@ -29,8 +30,13 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
|
|
||||||
private bool LoadItem(int id, GameObject obj) {
|
private bool LoadItem(int id, GameObject obj) {
|
||||||
var bi = obj.GetComponent<BrowserItem>();
|
var bi = obj.GetComponent<BrowserItem>();
|
||||||
|
try {
|
||||||
var item = ResourceManager.GetItemMeta(id);
|
var item = ResourceManager.GetItemMeta(id);
|
||||||
bi.Load(id, item);
|
bi.Load(id, item);
|
||||||
|
}
|
||||||
|
catch (Exception) {
|
||||||
|
bi.Load(id, new ResourceItemMeta { Name = "<color=#ff0000>Invalid resource</color>" });
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
using Cryville.Common.Unity.UI;
|
using Cryville.Common.Unity.UI;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
@@ -87,7 +88,6 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
void SetDataSettings(int id, ChartDetail detail) {
|
void SetDataSettings(int id, ChartDetail detail) {
|
||||||
Settings.Default.LoadRuleset = detail.Meta.ruleset + "/.umgr";
|
Settings.Default.LoadRuleset = detail.Meta.ruleset + "/.umgr";
|
||||||
Settings.Default.LoadRulesetConfig = detail.Meta.ruleset + ".json";
|
Settings.Default.LoadRulesetConfig = detail.Meta.ruleset + ".json";
|
||||||
Settings.Default.LoadSkin = detail.Meta.ruleset + "/Old KeyUI/.umgs";
|
|
||||||
Settings.Default.LoadChart = MainBrowser.ResourceManager.GetItemPath(id);
|
Settings.Default.LoadChart = MainBrowser.ResourceManager.GetItemPath(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,16 +98,22 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pragma warning disable IDE1006
|
#pragma warning disable IDE1006
|
||||||
public struct ChartMeta {
|
public class MetaInfo {
|
||||||
public MetaInfo song { get; set; }
|
|
||||||
public MetaInfo chart { get; set; }
|
|
||||||
public struct MetaInfo {
|
|
||||||
public string name { get; set; }
|
public string name { get; set; }
|
||||||
public string author { get; set; }
|
public string author { get; set; }
|
||||||
public float length { get; set; }
|
[JsonRequired]
|
||||||
|
public string data { get; set; }
|
||||||
}
|
}
|
||||||
|
public class SongMetaInfo {
|
||||||
|
public string name { get; set; }
|
||||||
|
public string author { get; set; }
|
||||||
|
}
|
||||||
|
public class ChartMeta : MetaInfo {
|
||||||
|
public SongMetaInfo song { get; set; }
|
||||||
|
public float length { get; set; }
|
||||||
public string ruleset { get; set; }
|
public string ruleset { get; set; }
|
||||||
public int note_count { get; set; }
|
public int note_count { get; set; }
|
||||||
|
public string cover { get; set; }
|
||||||
}
|
}
|
||||||
#pragma warning restore IDE1006
|
#pragma warning restore IDE1006
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
@@ -17,26 +18,62 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
return string.Format("{0} ({1})", Name, ReflectionHelper.GetSimpleName(GetType()));
|
return string.Format("{0} ({1})", Name, ReflectionHelper.GetSimpleName(GetType()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class ChartResource : Resource {
|
public class RawChartResource : Resource {
|
||||||
public ChartResource(string name, Chart main, ChartMeta meta) : base(name) {
|
public RawChartResource(string name, Chart main, ChartMeta meta) : base(name) {
|
||||||
Main = main; Meta = meta;
|
Main = main; Meta = meta;
|
||||||
}
|
}
|
||||||
public Chart Main { get; private set; }
|
public Chart Main { get; private set; }
|
||||||
public ChartMeta Meta { get; private set; }
|
public ChartMeta Meta { get; private set; }
|
||||||
public override bool Valid { get { return true; } }
|
public override bool Valid { get { return true; } }
|
||||||
}
|
}
|
||||||
public class CoverResource : Resource {
|
public abstract class FileResource : Resource {
|
||||||
public CoverResource(string name, FileInfo src) : base(name) {
|
public FileResource(string name, FileInfo master) : base(name) {
|
||||||
Source = src;
|
Master = master;
|
||||||
|
Attachments = new List<FileInfo>();
|
||||||
|
}
|
||||||
|
public FileInfo Master { get; private set; }
|
||||||
|
public List<FileInfo> Attachments { get; private set; }
|
||||||
|
public override bool Valid {
|
||||||
|
get {
|
||||||
|
if (!Master.Exists) return false;
|
||||||
|
foreach (var file in Attachments) {
|
||||||
|
if (!file.Exists) return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class ChartResource : FileResource {
|
||||||
|
public ChartResource(string name, FileInfo master) : base(name, master) {
|
||||||
|
using (var reader = new StreamReader(master.FullName)) {
|
||||||
|
var meta = JsonConvert.DeserializeObject<ChartMeta>(reader.ReadToEnd());
|
||||||
|
Attachments.Add(new FileInfo(Path.Combine(master.Directory.FullName, meta.data + ".json")));
|
||||||
|
if (meta.cover != null) Attachments.Add(new FileInfo(Path.Combine(master.Directory.FullName, meta.cover)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class SongResource : FileResource {
|
||||||
|
public SongResource(string name, FileInfo master) : base(name, master) { }
|
||||||
|
}
|
||||||
|
public class RulesetResource : FileResource {
|
||||||
|
public RulesetResource(string name, FileInfo master) : base(name, master) {
|
||||||
|
using (var reader = new StreamReader(master.FullName)) {
|
||||||
|
var meta = JsonConvert.DeserializeObject<Ruleset>(reader.ReadToEnd());
|
||||||
|
Attachments.Add(new FileInfo(Path.Combine(master.Directory.FullName, meta.data + ".pdt")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class SkinResource : FileResource {
|
||||||
|
public string RulesetName { get; private set; }
|
||||||
|
public SkinResource(string name, FileInfo master) : base(name, master) {
|
||||||
|
using (var reader = new StreamReader(master.FullName)) {
|
||||||
|
var meta = JsonConvert.DeserializeObject<Skin>(reader.ReadToEnd());
|
||||||
|
RulesetName = meta.ruleset;
|
||||||
|
Attachments.Add(new FileInfo(Path.Combine(master.Directory.FullName, meta.data + ".pdt")));
|
||||||
|
foreach (var frame in meta.frames) {
|
||||||
|
Attachments.Add(new FileInfo(Path.Combine(master.Directory.FullName, frame)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public FileInfo Source { get; private set; }
|
|
||||||
public override bool Valid { get { return Source.Exists; } }
|
|
||||||
}
|
}
|
||||||
public class SongResource : Resource {
|
|
||||||
public SongResource(string name, FileInfo src) : base(name) {
|
|
||||||
Source = src;
|
|
||||||
}
|
|
||||||
public FileInfo Source { get; private set; }
|
|
||||||
public override bool Valid { get { return Source.Exists; } }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
20
Assets/Cryville/Crtr/Browsing/RulesetResourceImporter.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Cryville.Crtr.Browsing {
|
||||||
|
public class RulesetResourceImporter : ResourceConverter {
|
||||||
|
static readonly string[] SUPPORTED_FORMATS = { ".umgr" };
|
||||||
|
public override string[] GetSupportedFormats() {
|
||||||
|
return SUPPORTED_FORMATS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override IEnumerable<Resource> ConvertFrom(FileInfo file) {
|
||||||
|
using (StreamReader reader = new StreamReader(file.FullName, Encoding.UTF8)) {
|
||||||
|
var data = JsonConvert.DeserializeObject<Ruleset>(reader.ReadToEnd());
|
||||||
|
return new Resource[] { new RulesetResource(data.name, file) };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f2c1531e76f19a647865f7ec335561cd
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
20
Assets/Cryville/Crtr/Browsing/SkinResourceImporter.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Cryville.Crtr.Browsing {
|
||||||
|
public class SkinResourceImporter : ResourceConverter {
|
||||||
|
static readonly string[] SUPPORTED_FORMATS = { ".umgs" };
|
||||||
|
public override string[] GetSupportedFormats() {
|
||||||
|
return SUPPORTED_FORMATS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override IEnumerable<Resource> ConvertFrom(FileInfo file) {
|
||||||
|
using (StreamReader reader = new StreamReader(file.FullName, Encoding.UTF8)) {
|
||||||
|
var data = JsonConvert.DeserializeObject<Skin>(reader.ReadToEnd());
|
||||||
|
return new Resource[] { new SkinResource(data.name, file) };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Cryville/Crtr/Browsing/SkinResourceImporter.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9904b4c21758c5046afc341fe2fa8845
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
@@ -275,7 +276,7 @@ namespace Cryville.Crtr {
|
|||||||
|
|
||||||
private void LoadFromString(string s) {
|
private void LoadFromString(string s) {
|
||||||
Match m = Regex.Match(s, @"^(.+?)(#(\d+))?(@(.+?))?(\^(.+?))?(\*(.+?))?(:(.+))?$");
|
Match m = Regex.Match(s, @"^(.+?)(#(\d+))?(@(.+?))?(\^(.+?))?(\*(.+?))?(:(.+))?$");
|
||||||
if (!m.Success) throw new ArgumentException(); // TODO
|
if (!m.Success) throw new ArgumentException("Invalid motion string format");
|
||||||
name = new Identifier(m.Groups[1].Value);
|
name = new Identifier(m.Groups[1].Value);
|
||||||
var registry = ChartPlayer.motionRegistry[name];
|
var registry = ChartPlayer.motionRegistry[name];
|
||||||
if (m.Groups[3].Success) {
|
if (m.Groups[3].Success) {
|
||||||
@@ -303,7 +304,7 @@ namespace Cryville.Crtr {
|
|||||||
var node = RelativeNode;
|
var node = RelativeNode;
|
||||||
result += "#" + node.Id;
|
result += "#" + node.Id;
|
||||||
if (node.Time != null) result += "@" + node.Time.ToString();
|
if (node.Time != null) result += "@" + node.Time.ToString();
|
||||||
if (node.Transition != null) result = "^" + node.Transition.ToString();
|
if (node.Transition != null) result = "^" + ((byte)node.Transition).ToString(CultureInfo.InvariantCulture);
|
||||||
if (node.Rate != null) result += "*" + node.Rate.ToString();
|
if (node.Rate != null) result += "*" + node.Rate.ToString();
|
||||||
if (node.Value != null) result += ":" + node.Value.ToString();
|
if (node.Value != null) result += ":" + node.Value.ToString();
|
||||||
}
|
}
|
||||||
@@ -377,14 +378,6 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Note() {
|
|
||||||
SubmitPropSrc("track", new PropSrc.Float(() => {
|
|
||||||
var i = motions.FirstOrDefault(m => m.RelativeNode == null && m.Name == "track");
|
|
||||||
if (i == null) return ((Vec1)ChartPlayer.motionRegistry["track"].InitValue).Value;
|
|
||||||
else return ((Vec1)i.AbsoluteValue).Value;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
public override EventList GetEventsOfType(string type) {
|
public override EventList GetEventsOfType(string type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "judges": return new EventList<Judge>(judges);
|
case "judges": return new EventList<Judge>(judges);
|
||||||
@@ -399,10 +392,12 @@ namespace Cryville.Crtr {
|
|||||||
public class Judge : ChartEvent {
|
public class Judge : ChartEvent {
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public Identifier Id;
|
public Identifier Id;
|
||||||
|
#pragma warning disable IDE1006
|
||||||
public string name {
|
public string name {
|
||||||
get { return Id.ToString(); }
|
get { return Id.ToString(); }
|
||||||
set { Id = new Identifier(value); }
|
set { Id = new Identifier(value); }
|
||||||
}
|
}
|
||||||
|
#pragma warning restore IDE1006
|
||||||
|
|
||||||
public override int Priority {
|
public override int Priority {
|
||||||
get { return 0; }
|
get { return 0; }
|
||||||
|
@@ -37,9 +37,9 @@ namespace Cryville.Crtr {
|
|||||||
else if (ev.Unstamped == null) { }
|
else if (ev.Unstamped == null) { }
|
||||||
else if (ev.Unstamped is Chart.Sound) {
|
else if (ev.Unstamped is Chart.Sound) {
|
||||||
Chart.Sound tev = (Chart.Sound)ev.Unstamped;
|
Chart.Sound tev = (Chart.Sound)ev.Unstamped;
|
||||||
var source = new LibavFileAudioSource(
|
var dir = new DirectoryInfo(Game.GameDataPath + "/songs/" + tev.id);
|
||||||
Game.GameDataPath + "/songs/" + tev.id + "/.ogg"
|
var files = dir.GetFiles();
|
||||||
);
|
var source = new LibavFileAudioSource(files[0].FullName);
|
||||||
source.SelectStream();
|
source.SelectStream();
|
||||||
sounds.Add(source);
|
sounds.Add(source);
|
||||||
Game.AudioSession.Sequence(
|
Game.AudioSession.Sequence(
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
#define BUILD
|
#define BUILD
|
||||||
|
|
||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
using Cryville.Common.Plist;
|
|
||||||
using Cryville.Crtr.Config;
|
using Cryville.Crtr.Config;
|
||||||
using Cryville.Crtr.Event;
|
using Cryville.Crtr.Event;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@@ -26,8 +25,7 @@ namespace Cryville.Crtr {
|
|||||||
Ruleset ruleset;
|
Ruleset ruleset;
|
||||||
PdtRuleset pruleset;
|
PdtRuleset pruleset;
|
||||||
Dictionary<string, Texture2D> texs;
|
Dictionary<string, Texture2D> texs;
|
||||||
public static Dictionary<string, Cocos2dFrames.Frame> frames;
|
public static Dictionary<string, SpriteFrame> frames;
|
||||||
List<Cocos2dFrames> plists;
|
|
||||||
|
|
||||||
readonly Queue<string> texLoadQueue = new Queue<string>();
|
readonly Queue<string> texLoadQueue = new Queue<string>();
|
||||||
#if UNITY_5_4_OR_NEWER
|
#if UNITY_5_4_OR_NEWER
|
||||||
@@ -52,6 +50,7 @@ namespace Cryville.Crtr {
|
|||||||
public static Rect hitRect;
|
public static Rect hitRect;
|
||||||
public static Plane[] frustumPlanes;
|
public static Plane[] frustumPlanes;
|
||||||
|
|
||||||
|
RulesetConfig _rscfg;
|
||||||
static bool disableGC = true;
|
static bool disableGC = true;
|
||||||
static float clippingDist = 1f;
|
static float clippingDist = 1f;
|
||||||
static float renderDist = 6f;
|
static float renderDist = 6f;
|
||||||
@@ -84,7 +83,14 @@ namespace Cryville.Crtr {
|
|||||||
|
|
||||||
texHandler = new DownloadHandlerTexture();
|
texHandler = new DownloadHandlerTexture();
|
||||||
#if BUILD
|
#if BUILD
|
||||||
|
try {
|
||||||
Play();
|
Play();
|
||||||
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
Game.LogException("Load/WorkerThread", "An error occured while loading the data", ex);
|
||||||
|
Popup.CreateException(ex);
|
||||||
|
ReturnToMenu();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Camera.main.RenderToCubemap();
|
// Camera.main.RenderToCubemap();
|
||||||
@@ -159,25 +165,18 @@ namespace Cryville.Crtr {
|
|||||||
var tex = texHandler.texture;
|
var tex = texHandler.texture;
|
||||||
tex.wrapMode = TextureWrapMode.Clamp;
|
tex.wrapMode = TextureWrapMode.Clamp;
|
||||||
texs.Add(name, tex);
|
texs.Add(name, tex);
|
||||||
Logger.Log("main", 0, "Load/MainThread", "Loaded texture {0} ({1} bytes)", name, texLoader.downloadedBytes);
|
|
||||||
texLoader.Dispose();
|
texLoader.Dispose();
|
||||||
texHandler.Dispose();
|
texHandler.Dispose();
|
||||||
texLoader = null;
|
texLoader = null;
|
||||||
}
|
}
|
||||||
else if (texLoader.downloadProgress != 0) {
|
|
||||||
Logger.Log("main", 0, "Load/MainThread", "Loading texture {0} {1:P0}", name, texLoader.downloadProgress);
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
if (texLoader.isDone) {
|
if (texLoader.isDone) {
|
||||||
var tex = texLoader.texture;
|
var tex = texLoader.texture;
|
||||||
|
tex.wrapMode = TextureWrapMode.Clamp;
|
||||||
texs.Add(name, tex);
|
texs.Add(name, tex);
|
||||||
Logger.Log("main", 0, "Load/MainThread", "Loaded texture {0} ({1} bytes)", name, texLoader.bytesDownloaded);
|
|
||||||
texLoader.Dispose();
|
texLoader.Dispose();
|
||||||
texLoader = null;
|
texLoader = null;
|
||||||
}
|
}
|
||||||
else if (texLoader.progress != 0) {
|
|
||||||
Logger.Log("main", 0, "Load/MainThread", "Loading texture {0} {1:P0}", name, texLoader.progress);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (texLoader == null)
|
if (texLoader == null)
|
||||||
@@ -251,6 +250,7 @@ namespace Cryville.Crtr {
|
|||||||
status.text = sttext;
|
status.text = sttext;
|
||||||
}
|
}
|
||||||
void OnCameraPostRender(Camera cam) {
|
void OnCameraPostRender(Camera cam) {
|
||||||
|
if (!logEnabled) return;
|
||||||
if (started) timetext = string.Format(
|
if (started) timetext = string.Format(
|
||||||
"\nSTime: {0:R}\nATime: {1:R}\nITime: {2:R}",
|
"\nSTime: {0:R}\nATime: {1:R}\nITime: {2:R}",
|
||||||
cbus.Time,
|
cbus.Time,
|
||||||
@@ -308,7 +308,6 @@ namespace Cryville.Crtr {
|
|||||||
autoRenderStep = renderStep == 0;
|
autoRenderStep = renderStep == 0;
|
||||||
soundOffset = Settings.Default.SoundOffset;
|
soundOffset = Settings.Default.SoundOffset;
|
||||||
startOffset = Settings.Default.StartOffset;
|
startOffset = Settings.Default.StartOffset;
|
||||||
sv = Settings.Default.ScrollVelocity;
|
|
||||||
firstFrame = true;
|
firstFrame = true;
|
||||||
texloaddone = false;
|
texloaddone = false;
|
||||||
Game.NetworkTaskWorker.SuspendBackgroundTasks();
|
Game.NetworkTaskWorker.SuspendBackgroundTasks();
|
||||||
@@ -332,30 +331,48 @@ namespace Cryville.Crtr {
|
|||||||
FileInfo chartFile = new FileInfo(
|
FileInfo chartFile = new FileInfo(
|
||||||
Game.GameDataPath + "/charts/" + Settings.Default.LoadChart
|
Game.GameDataPath + "/charts/" + Settings.Default.LoadChart
|
||||||
);
|
);
|
||||||
|
|
||||||
FileInfo rulesetFile = new FileInfo(
|
FileInfo rulesetFile = new FileInfo(
|
||||||
Game.GameDataPath + "/rulesets/" + Settings.Default.LoadRuleset
|
Game.GameDataPath + "/rulesets/" + Settings.Default.LoadRuleset
|
||||||
);
|
);
|
||||||
|
if (!rulesetFile.Exists) throw new FileNotFoundException("Ruleset for the chart not found\nMake sure you have imported the ruleset");
|
||||||
|
|
||||||
FileInfo rulesetConfigFile = new FileInfo(
|
FileInfo rulesetConfigFile = new FileInfo(
|
||||||
Game.GameDataPath + "/config/rulesets/" + Settings.Default.LoadRulesetConfig
|
Game.GameDataPath + "/config/rulesets/" + Settings.Default.LoadRulesetConfig
|
||||||
);
|
);
|
||||||
|
if (!rulesetConfigFile.Exists) throw new FileNotFoundException("Ruleset config not found\nPlease open the config to generate");
|
||||||
|
using (StreamReader cfgreader = new StreamReader(rulesetConfigFile.FullName, Encoding.UTF8)) {
|
||||||
|
_rscfg = JsonConvert.DeserializeObject<RulesetConfig>(cfgreader.ReadToEnd(), new JsonSerializerSettings() {
|
||||||
|
MissingMemberHandling = MissingMemberHandling.Error
|
||||||
|
});
|
||||||
|
}
|
||||||
|
sv = _rscfg.generic.ScrollVelocity;
|
||||||
|
|
||||||
FileInfo skinFile = new FileInfo(
|
FileInfo skinFile = new FileInfo(
|
||||||
Game.GameDataPath + "/skins/" + Settings.Default.LoadSkin
|
string.Format("{0}/skins/{1}/{2}/.umgs", Game.GameDataPath, rulesetFile.Directory.Name, _rscfg.generic.Skin)
|
||||||
);
|
);
|
||||||
|
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)) {
|
||||||
|
skin = JsonConvert.DeserializeObject<Skin>(reader.ReadToEnd(), new JsonSerializerSettings() {
|
||||||
|
MissingMemberHandling = MissingMemberHandling.Error
|
||||||
|
});
|
||||||
|
if (skin.format != Skin.CURRENT_FORMAT) throw new FormatException("Invalid skin file version");
|
||||||
|
}
|
||||||
|
|
||||||
loadThread = new Thread(new ParameterizedThreadStart(Load));
|
loadThread = new Thread(new ParameterizedThreadStart(Load));
|
||||||
loadThread.Start(new LoadInfo() {
|
loadThread.Start(new LoadInfo() {
|
||||||
chartFile = chartFile,
|
chartFile = chartFile,
|
||||||
rulesetFile = rulesetFile,
|
rulesetFile = rulesetFile,
|
||||||
rulesetConfigFile = rulesetConfigFile,
|
|
||||||
skinFile = skinFile,
|
skinFile = skinFile,
|
||||||
});
|
});
|
||||||
|
|
||||||
Logger.Log("main", 0, "Load/MainThread", "Loading textures...");
|
Logger.Log("main", 0, "Load/MainThread", "Loading textures...");
|
||||||
texloadtimer = new diag::Stopwatch();
|
texloadtimer = new diag::Stopwatch();
|
||||||
texloadtimer.Start();
|
texloadtimer.Start();
|
||||||
|
frames = new Dictionary<string, SpriteFrame>();
|
||||||
texs = new Dictionary<string, Texture2D>();
|
texs = new Dictionary<string, Texture2D>();
|
||||||
var flist = skinFile.Directory.GetFiles("*.png");
|
foreach (var f in skin.frames) {
|
||||||
foreach (FileInfo f in flist) {
|
texLoadQueue.Enqueue(Path.Combine(skinFile.Directory.FullName, f));
|
||||||
texLoadQueue.Enqueue(f.FullName);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -363,26 +380,35 @@ namespace Cryville.Crtr {
|
|||||||
try {
|
try {
|
||||||
diag::Stopwatch timer = new diag::Stopwatch();
|
diag::Stopwatch timer = new diag::Stopwatch();
|
||||||
timer.Reset(); timer.Start();
|
timer.Reset(); timer.Start();
|
||||||
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 3)");
|
Logger.Log("main", 0, "Load/Prehandle", "Initializing textures");
|
||||||
foreach (var i in plists) i.Init(texs);
|
|
||||||
foreach (var t in texs) {
|
foreach (var t in texs) {
|
||||||
if (frames.ContainsKey(t.Key)) {
|
if (frames.ContainsKey(t.Key)) {
|
||||||
Logger.Log("main", 3, "Load/Prehandle", "Duplicated texture name: {0}", t.Key);
|
Logger.Log("main", 3, "Load/Prehandle", "Duplicated texture name: {0}", t.Key);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var f = new Cocos2dFrames.Frame(t.Value);
|
var f = new SpriteFrame(t.Value);
|
||||||
f.Init();
|
f.Init();
|
||||||
frames.Add(t.Key, f);
|
frames.Add(t.Key, f);
|
||||||
}
|
}
|
||||||
Logger.Log("main", 0, "Load/Prehandle", "Initializing states");
|
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 2)");
|
||||||
cbus.BroadcastInit();
|
cbus.BroadcastPreInit();
|
||||||
|
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 3)");
|
||||||
|
using (var pbus = cbus.Clone(17)) {
|
||||||
|
pbus.Forward();
|
||||||
|
}
|
||||||
|
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 4)");
|
||||||
|
cbus.BroadcastPostInit();
|
||||||
inputProxy.Activate();
|
inputProxy.Activate();
|
||||||
if (logEnabled) ToggleLogs();
|
if (logEnabled && Settings.Default.HideLogOnPlay) ToggleLogs();
|
||||||
Logger.Log("main", 0, "Load/Prehandle", "Cleaning up");
|
Logger.Log("main", 0, "Load/Prehandle", "Cleaning up");
|
||||||
GC.Collect();
|
GC.Collect();
|
||||||
if (disableGC) GarbageCollector.GCMode = GarbageCollector.Mode.Disabled;
|
if (disableGC) GarbageCollector.GCMode = GarbageCollector.Mode.Disabled;
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
Logger.Log("main", 1, "Load/Prehandle", "Prehandling done ({0}ms)", timer.Elapsed.TotalMilliseconds);
|
Logger.Log("main", 1, "Load/Prehandle", "Prehandling done ({0}ms)", timer.Elapsed.TotalMilliseconds);
|
||||||
|
if (Settings.Default.ClearLogOnPlay) {
|
||||||
|
logs.text = "";
|
||||||
|
Game.MainLogger.Enumerate((level, module, msg) => { });
|
||||||
|
}
|
||||||
Game.AudioSequencer.Playing = true;
|
Game.AudioSequencer.Playing = true;
|
||||||
atime0 = Game.AudioClient.BufferPosition;
|
atime0 = Game.AudioClient.BufferPosition;
|
||||||
Thread.Sleep((int)((atime0 - Game.AudioClient.Position) * 1000));
|
Thread.Sleep((int)((atime0 - Game.AudioClient.Position) * 1000));
|
||||||
@@ -400,6 +426,7 @@ namespace Cryville.Crtr {
|
|||||||
try {
|
try {
|
||||||
Logger.Log("main", 1, "Game", "Stopping");
|
Logger.Log("main", 1, "Game", "Stopping");
|
||||||
Game.AudioSession = Game.AudioSequencer.NewSession();
|
Game.AudioSession = Game.AudioSequencer.NewSession();
|
||||||
|
inputProxy.Deactivate();
|
||||||
if (cbus != null) { cbus.Dispose(); cbus = null; }
|
if (cbus != null) { cbus.Dispose(); cbus = null; }
|
||||||
if (bbus != null) { bbus.Dispose(); bbus = null; }
|
if (bbus != null) { bbus.Dispose(); bbus = null; }
|
||||||
if (tbus != null) { tbus.Dispose(); tbus = null; }
|
if (tbus != null) { tbus.Dispose(); tbus = null; }
|
||||||
@@ -434,7 +461,6 @@ namespace Cryville.Crtr {
|
|||||||
struct LoadInfo {
|
struct LoadInfo {
|
||||||
public FileInfo chartFile;
|
public FileInfo chartFile;
|
||||||
public FileInfo rulesetFile;
|
public FileInfo rulesetFile;
|
||||||
public FileInfo rulesetConfigFile;
|
|
||||||
public FileInfo skinFile;
|
public FileInfo skinFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -472,7 +498,7 @@ namespace Cryville.Crtr {
|
|||||||
|
|
||||||
etor = new PdtEvaluator();
|
etor = new PdtEvaluator();
|
||||||
|
|
||||||
LoadRuleset(info.rulesetFile, info.rulesetConfigFile);
|
LoadRuleset(info.rulesetFile);
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Applying ruleset (iteration 1)");
|
Logger.Log("main", 0, "Load/WorkerThread", "Applying ruleset (iteration 1)");
|
||||||
pruleset.PrePatch(chart);
|
pruleset.PrePatch(chart);
|
||||||
|
|
||||||
@@ -493,7 +519,6 @@ namespace Cryville.Crtr {
|
|||||||
throw new ArgumentException("Input config not completed\nPlease complete the input settings");
|
throw new ArgumentException("Input config not completed\nPlease complete the input settings");
|
||||||
}
|
}
|
||||||
|
|
||||||
cbus.AttachSystems(pskin, judge);
|
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Attaching handlers");
|
Logger.Log("main", 0, "Load/WorkerThread", "Attaching handlers");
|
||||||
var ch = new ChartHandler(chart, dir);
|
var ch = new ChartHandler(chart, dir);
|
||||||
cbus.RootState.AttachHandler(ch);
|
cbus.RootState.AttachHandler(ch);
|
||||||
@@ -511,16 +536,13 @@ namespace Cryville.Crtr {
|
|||||||
ts.Value.AttachHandler(th);
|
ts.Value.AttachHandler(th);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
cbus.AttachSystems(pskin, judge);
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Prehandling (iteration 1)");
|
Logger.Log("main", 0, "Load/WorkerThread", "Prehandling (iteration 1)");
|
||||||
using (var pbus = cbus.Clone(16)) {
|
using (var pbus = cbus.Clone(16)) {
|
||||||
pbus.Forward();
|
pbus.Forward();
|
||||||
}
|
}
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Patching events");
|
Logger.Log("main", 0, "Load/WorkerThread", "Patching events");
|
||||||
cbus.DoPatch();
|
cbus.DoPatch();
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Prehandling (iteration 2)");
|
|
||||||
using (var pbus = cbus.Clone(17)) {
|
|
||||||
pbus.Forward();
|
|
||||||
}
|
|
||||||
|
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Cloning states (type 1)");
|
Logger.Log("main", 0, "Load/WorkerThread", "Cloning states (type 1)");
|
||||||
bbus = cbus.Clone(1, -clippingDist);
|
bbus = cbus.Clone(1, -clippingDist);
|
||||||
@@ -531,23 +553,16 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RulesetConfig _rscfg;
|
void LoadRuleset(FileInfo file) {
|
||||||
void LoadRuleset(FileInfo file, FileInfo cfgfile) {
|
|
||||||
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<Ruleset>(reader.ReadToEnd(), new JsonSerializerSettings() {
|
||||||
MissingMemberHandling = MissingMemberHandling.Error
|
MissingMemberHandling = MissingMemberHandling.Error
|
||||||
});
|
});
|
||||||
if (ruleset.format != 1) throw new FormatException("Invalid ruleset file version");
|
if (ruleset.format != Ruleset.CURRENT_FORMAT) throw new FormatException("Invalid ruleset file version");
|
||||||
ruleset.LoadPdt(dir);
|
ruleset.LoadPdt(dir);
|
||||||
pruleset = ruleset.Root;
|
pruleset = ruleset.Root;
|
||||||
if (!cfgfile.Exists) throw new FileNotFoundException("Ruleset config not found\nPlease open the config to generate");
|
|
||||||
using (StreamReader cfgreader = new StreamReader(cfgfile.FullName, Encoding.UTF8)) {
|
|
||||||
_rscfg = JsonConvert.DeserializeObject<RulesetConfig>(cfgreader.ReadToEnd(), new JsonSerializerSettings() {
|
|
||||||
MissingMemberHandling = MissingMemberHandling.Error
|
|
||||||
});
|
|
||||||
}
|
|
||||||
pruleset.Optimize(etor);
|
pruleset.Optimize(etor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -555,24 +570,10 @@ namespace Cryville.Crtr {
|
|||||||
void LoadSkin(FileInfo file) {
|
void LoadSkin(FileInfo file) {
|
||||||
DirectoryInfo dir = file.Directory;
|
DirectoryInfo dir = file.Directory;
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Loading skin: {0}", file);
|
Logger.Log("main", 0, "Load/WorkerThread", "Loading skin: {0}", file);
|
||||||
using (StreamReader reader = new StreamReader(file.FullName, Encoding.UTF8)) {
|
|
||||||
skin = JsonConvert.DeserializeObject<Skin>(reader.ReadToEnd(), new JsonSerializerSettings() {
|
|
||||||
MissingMemberHandling = MissingMemberHandling.Error
|
|
||||||
});
|
|
||||||
if (skin.format != 1) throw new FormatException("Invalid skin file version");
|
|
||||||
skin.LoadPdt(dir);
|
skin.LoadPdt(dir);
|
||||||
pskin = skin.Root;
|
pskin = skin.Root;
|
||||||
pskin.Optimize(etor);
|
pskin.Optimize(etor);
|
||||||
}
|
}
|
||||||
plists = new List<Cocos2dFrames>();
|
|
||||||
frames = new Dictionary<string, Cocos2dFrames.Frame>();
|
|
||||||
foreach (FileInfo f in file.Directory.GetFiles("*.plist")) {
|
|
||||||
var pobj = PlistConvert.Deserialize<Cocos2dFrames>(f.FullName);
|
|
||||||
plists.Add(pobj);
|
|
||||||
foreach (var i in pobj.frames)
|
|
||||||
frames.Add(StringUtils.TrimExt(i.Key), i.Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,176 +0,0 @@
|
|||||||
using Cryville.Common;
|
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
|
||||||
[BinderAttribute(typeof(Cocos2dFramesBinder))]
|
|
||||||
public class Cocos2dFrames {
|
|
||||||
public Metadata metadata;
|
|
||||||
public class Metadata {
|
|
||||||
public int format;
|
|
||||||
public Vector2 size;
|
|
||||||
public string textureFileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Dictionary<string, Frame> frames;
|
|
||||||
public class Frame {
|
|
||||||
#pragma warning disable IDE1006
|
|
||||||
Rect _frame;
|
|
||||||
public Rect frame {
|
|
||||||
get { return _frame; }
|
|
||||||
set { _frame = value; }
|
|
||||||
}
|
|
||||||
public Rect textureRect {
|
|
||||||
get { return _frame; }
|
|
||||||
set { _frame = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
bool _rotated = false;
|
|
||||||
public bool rotated {
|
|
||||||
get { return _rotated; }
|
|
||||||
set { _rotated = value; }
|
|
||||||
}
|
|
||||||
public bool textureRotated {
|
|
||||||
get { return _rotated; }
|
|
||||||
set { _rotated = value; }
|
|
||||||
}
|
|
||||||
#pragma warning restore IDE1006
|
|
||||||
|
|
||||||
public Vector2 offset;
|
|
||||||
|
|
||||||
public Rect sourceColorRect;
|
|
||||||
public Vector2 sourceSize;
|
|
||||||
private Rect _uv;
|
|
||||||
private Vector2[] cuv;
|
|
||||||
public Rect UV {
|
|
||||||
get {
|
|
||||||
return _uv;
|
|
||||||
}
|
|
||||||
private set {
|
|
||||||
_uv = value;
|
|
||||||
float x0 = Mathf.Min(_uv.xMin, _uv.xMax);
|
|
||||||
float x1 = Mathf.Max(_uv.xMin, _uv.xMax);
|
|
||||||
float y0 = Mathf.Min(_uv.yMin, _uv.yMax);
|
|
||||||
float y1 = Mathf.Max(_uv.yMin, _uv.yMax);
|
|
||||||
if (_rotated) cuv = new Vector2[]{
|
|
||||||
new Vector2(x0, y1),
|
|
||||||
new Vector2(x1, y0),
|
|
||||||
new Vector2(x0, y0),
|
|
||||||
new Vector2(x1, y1),
|
|
||||||
};
|
|
||||||
else cuv = new Vector2[]{
|
|
||||||
new Vector2(x0, y0),
|
|
||||||
new Vector2(x1, y1),
|
|
||||||
new Vector2(x1, y0),
|
|
||||||
new Vector2(x0, y1),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public Vector2 GetUV(Vector2 uv) {
|
|
||||||
return GetUV(uv.x, uv.y);
|
|
||||||
}
|
|
||||||
public Vector2 GetUV(float u, float v) {
|
|
||||||
Vector2 uv00 = cuv[0], uv11 = cuv[1],
|
|
||||||
uv10 = cuv[2], uv01 = cuv[3];
|
|
||||||
return (1 - u - v) * uv00
|
|
||||||
+ u * uv10
|
|
||||||
+ v * uv01
|
|
||||||
+ u * v * (uv00 + uv11 - uv10 - uv01);
|
|
||||||
}
|
|
||||||
public Texture2D Texture {
|
|
||||||
get;
|
|
||||||
private set;
|
|
||||||
}
|
|
||||||
public Vector2 Size {
|
|
||||||
get {
|
|
||||||
return new Vector2(Texture.width, Texture.height);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Init() {
|
|
||||||
if (Texture == null)
|
|
||||||
throw new InvalidOperationException(); // TODO
|
|
||||||
_frame = new Rect(Vector2.zero, Size);
|
|
||||||
var w = _frame.width;
|
|
||||||
var h = _frame.height;
|
|
||||||
float x = _frame.x / w;
|
|
||||||
float y = 1 - _frame.y / h;
|
|
||||||
float tw = (_rotated ? _frame.height : _frame.width) / w;
|
|
||||||
float th = (_rotated ? _frame.width : _frame.height) / h;
|
|
||||||
if (_rotated) UV = new Rect(x, y, tw, -th);
|
|
||||||
else UV = new Rect(x, y, tw, -th);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Init(int w, int h, Texture2D _base) {
|
|
||||||
if (Texture != null)
|
|
||||||
throw new InvalidOperationException(); // TODO
|
|
||||||
Texture = _base;
|
|
||||||
float x = _frame.x / w;
|
|
||||||
float y = 1 - _frame.y / h;
|
|
||||||
float tw = (_rotated ? _frame.height : _frame.width) / w;
|
|
||||||
float th = (_rotated ? _frame.width : _frame.height) / h;
|
|
||||||
if (_rotated) UV = new Rect(x, y, tw, -th);
|
|
||||||
else UV = new Rect(x, y, tw, -th);
|
|
||||||
}
|
|
||||||
public Frame() { }
|
|
||||||
public Frame(Texture2D tex) {
|
|
||||||
Texture = tex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Texture2D _base;
|
|
||||||
|
|
||||||
public void Init(Dictionary<string, Texture2D> texs) {
|
|
||||||
_base = texs[StringUtils.TrimExt(metadata.textureFileName)];
|
|
||||||
var w = (int)metadata.size.x;
|
|
||||||
var h = (int)metadata.size.y;
|
|
||||||
if (w == 0 || h == 0) {
|
|
||||||
w = _base.width;
|
|
||||||
h = _base.height;
|
|
||||||
}
|
|
||||||
foreach (var f in frames) {
|
|
||||||
f.Value.Init(w, h, _base);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Cocos2dFramesBinder : EmptyBinder {
|
|
||||||
public override object ChangeType(object value, Type type, CultureInfo culture) {
|
|
||||||
if (value is string) {
|
|
||||||
var str = (string)value;
|
|
||||||
if (type == typeof(Rect)) {
|
|
||||||
var m = Regex.Match(str, @"^{({.*?}),({.*?})}$");
|
|
||||||
var p = (Vector2)ChangeType(m.Groups[1].Value, typeof(Vector2), culture);
|
|
||||||
var s = (Vector2)ChangeType(m.Groups[2].Value, typeof(Vector2), culture);
|
|
||||||
return new Rect(p, s);
|
|
||||||
}
|
|
||||||
else if (type == typeof(Vector2)) {
|
|
||||||
var m = Regex.Match(str, @"^{(.*?),(.*?)}$");
|
|
||||||
var w = float.Parse(m.Groups[1].Value);
|
|
||||||
var h = float.Parse(m.Groups[2].Value);
|
|
||||||
return new Vector2(w, h);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (typeof(IDictionary).IsAssignableFrom(value.GetType())) {
|
|
||||||
var dict = (IDictionary)value;
|
|
||||||
if (type == typeof(Rect)) {
|
|
||||||
var x = float.Parse((string)dict["x"]);
|
|
||||||
var y = float.Parse((string)dict["y"]);
|
|
||||||
var w = float.Parse((string)dict["w"]);
|
|
||||||
var h = float.Parse((string)dict["h"]);
|
|
||||||
return new Rect(x, y, w, h);
|
|
||||||
}
|
|
||||||
else if (type == typeof(Vector2)) {
|
|
||||||
var w = float.Parse((string)dict["w"]);
|
|
||||||
var h = float.Parse((string)dict["h"]);
|
|
||||||
return new Vector2(w, h);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return base.ChangeType(value, type, culture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
30
Assets/Cryville/Crtr/Components/MeshBase.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Cryville.Crtr.Components {
|
||||||
|
public abstract class MeshBase : SkinComponent {
|
||||||
|
public MeshBase() {
|
||||||
|
SubmitProperty("zindex", new PropOp.Integer(v => ZIndex = (short)v));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected MeshWrapper mesh = new MeshWrapper();
|
||||||
|
|
||||||
|
short _zindex;
|
||||||
|
public short ZIndex {
|
||||||
|
get {
|
||||||
|
return _zindex;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if (value < 0 || value > 5000)
|
||||||
|
throw new ArgumentOutOfRangeException("value", "Z-index must be in [0..5000]");
|
||||||
|
_zindex = value;
|
||||||
|
UpdateZIndex();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected void UpdateZIndex() {
|
||||||
|
if (!mesh.Initialized) return;
|
||||||
|
foreach (var mat in mesh.Renderer.materials) {
|
||||||
|
mat.renderQueue = _zindex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Cryville/Crtr/Components/MeshBase.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 75daba44e5811b943a08e6f137cc2b0c
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -5,11 +5,10 @@ using System.Collections.Generic;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Components {
|
namespace Cryville.Crtr.Components {
|
||||||
public abstract class SectionalGameObject : SkinComponent {
|
public abstract class SectionalGameObject : MeshBase {
|
||||||
protected Vector3? prevpt;
|
protected Vector3? prevpt;
|
||||||
protected Quaternion? prevrot;
|
protected Quaternion? prevrot;
|
||||||
protected int vertCount = 0;
|
protected int vertCount = 0;
|
||||||
protected MeshWrapper mesh = new MeshWrapper();
|
|
||||||
|
|
||||||
protected override void OnDestroy() {
|
protected override void OnDestroy() {
|
||||||
mesh.Destroy();
|
mesh.Destroy();
|
||||||
@@ -56,8 +55,7 @@ namespace Cryville.Crtr.Components {
|
|||||||
SubmitProperty("head", new PropOp.String(v => head.FrameName = v));
|
SubmitProperty("head", new PropOp.String(v => head.FrameName = v));
|
||||||
SubmitProperty("body", new PropOp.String(v => body.FrameName = v));
|
SubmitProperty("body", new PropOp.String(v => body.FrameName = v));
|
||||||
SubmitProperty("tail", new PropOp.String(v => tail.FrameName = v));
|
SubmitProperty("tail", new PropOp.String(v => tail.FrameName = v));
|
||||||
SubmitProperty("transparent", new PropOp.Boolean(v => transparent = v));
|
SubmitProperty("shape", new op_set_shape(this), 2);
|
||||||
SubmitProperty("shape", new op_set_shape(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma warning disable IDE1006
|
#pragma warning disable IDE1006
|
||||||
@@ -94,7 +92,6 @@ namespace Cryville.Crtr.Components {
|
|||||||
public SpriteInfo body = new SpriteInfo();
|
public SpriteInfo body = new SpriteInfo();
|
||||||
public SpriteInfo tail = new SpriteInfo();
|
public SpriteInfo tail = new SpriteInfo();
|
||||||
|
|
||||||
public bool transparent;
|
|
||||||
List<Vector3> vertices;
|
List<Vector3> vertices;
|
||||||
List<float> lengths;
|
List<float> lengths;
|
||||||
float sumLength = 0;
|
float sumLength = 0;
|
||||||
@@ -106,13 +103,14 @@ namespace Cryville.Crtr.Components {
|
|||||||
body.Load();
|
body.Load();
|
||||||
tail.Load();
|
tail.Load();
|
||||||
|
|
||||||
mesh.Init(transform, transparent);
|
mesh.Init(transform);
|
||||||
|
|
||||||
List<Material> materials = new List<Material>();
|
List<Material> materials = new List<Material>();
|
||||||
if (head.FrameName != null) AddMat(materials, head.FrameName);
|
if (head.FrameName != null) AddMat(materials, head.FrameName);
|
||||||
if (body.FrameName != null) AddMat(materials, body.FrameName);
|
if (body.FrameName != null) AddMat(materials, body.FrameName);
|
||||||
if (tail.FrameName != null) AddMat(materials, tail.FrameName);
|
if (tail.FrameName != null) AddMat(materials, tail.FrameName);
|
||||||
mesh.Renderer.materials = materials.ToArray();
|
mesh.Renderer.materials = materials.ToArray();
|
||||||
|
UpdateZIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddMat(List<Material> list, string frame) {
|
void AddMat(List<Material> list, string frame) {
|
||||||
@@ -132,7 +130,6 @@ namespace Cryville.Crtr.Components {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vector3 prevp = Vector3.zero;
|
|
||||||
protected override void AppendPointInternal(Vector3 p, Quaternion r) {
|
protected override void AppendPointInternal(Vector3 p, Quaternion r) {
|
||||||
if (vertices == null) {
|
if (vertices == null) {
|
||||||
vertices = _ptPool.Rent();
|
vertices = _ptPool.Rent();
|
||||||
|
@@ -7,25 +7,32 @@ namespace Cryville.Crtr.Components {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The property operators of the component.
|
/// The property operators of the component.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Dictionary<string, PdtOperator> PropOps { get; private set; }
|
public Dictionary<string, SkinProperty> Properties { get; private set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Submits a property.
|
/// Submits a property.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name">The name of the property.</param>
|
/// <param name="name">The name of the property.</param>
|
||||||
/// <param name="property">The property operator.</param>
|
/// <param name="property">The property.</param>
|
||||||
protected void SubmitProperty(string name, PdtOperator property) {
|
protected void SubmitProperty(string name, PdtOperator property, int uct = 1) {
|
||||||
PropOps.Add(name, property);
|
Properties.Add(name, new SkinProperty(property, uct));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a skin component
|
/// Creates a skin component.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected SkinComponent() {
|
protected SkinComponent() {
|
||||||
// Properties = new Dictionary<string, Property>();
|
Properties = new Dictionary<string, SkinProperty>();
|
||||||
PropOps = new Dictionary<string, PdtOperator>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Init() { }
|
public virtual void Init() { }
|
||||||
protected abstract void OnDestroy();
|
protected abstract void OnDestroy();
|
||||||
}
|
}
|
||||||
|
public struct SkinProperty {
|
||||||
|
public PdtOperator Operator { get; set; }
|
||||||
|
public int UpdateCloneType { get; set; }
|
||||||
|
public SkinProperty(PdtOperator op, int uct = 1) {
|
||||||
|
Operator = op;
|
||||||
|
UpdateCloneType = uct;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,14 +2,12 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Components {
|
namespace Cryville.Crtr.Components {
|
||||||
public abstract class SpriteBase : SkinComponent {
|
public abstract class SpriteBase : MeshBase {
|
||||||
public SpriteBase() {
|
public SpriteBase() {
|
||||||
SubmitProperty("bound", new op_set_bound(this));
|
SubmitProperty("bound", new op_set_bound(this));
|
||||||
SubmitProperty("transparent", new PropOp.Boolean(v => transparent = v));
|
|
||||||
SubmitProperty("pivot", new PropOp.Vector2(v => Pivot = v));
|
SubmitProperty("pivot", new PropOp.Vector2(v => Pivot = v));
|
||||||
SubmitProperty("scale", new PropOp.Vector2(v => Scale = v));
|
SubmitProperty("scale", new PropOp.Vector2(v => Scale = v));
|
||||||
SubmitProperty("ui", new PropOp.Boolean(v => UI = v));
|
SubmitProperty("ui", new PropOp.Boolean(v => UI = v));
|
||||||
SubmitProperty("zindex", new PropOp.Integer(v => ZIndex = (short)v));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma warning disable IDE1006
|
#pragma warning disable IDE1006
|
||||||
@@ -27,8 +25,6 @@ namespace Cryville.Crtr.Components {
|
|||||||
}
|
}
|
||||||
#pragma warning restore IDE1006
|
#pragma warning restore IDE1006
|
||||||
|
|
||||||
protected MeshWrapper mesh = new MeshWrapper();
|
|
||||||
|
|
||||||
protected override void OnDestroy() {
|
protected override void OnDestroy() {
|
||||||
mesh.Destroy();
|
mesh.Destroy();
|
||||||
}
|
}
|
||||||
@@ -83,21 +79,6 @@ namespace Cryville.Crtr.Components {
|
|||||||
if (da.y != 0) _scale.y = dp.z / da.y;
|
if (da.y != 0) _scale.y = dp.z / da.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
short _zindex;
|
|
||||||
public short ZIndex {
|
|
||||||
get {
|
|
||||||
return _zindex;
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
_zindex = value;
|
|
||||||
UpdateZIndex();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
protected void UpdateZIndex() {
|
|
||||||
if (!mesh.Initialized) return;
|
|
||||||
mesh.Renderer.sortingOrder = _zindex;
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly Quaternion uirot
|
static readonly Quaternion uirot
|
||||||
= Quaternion.Euler(new Vector3(-90, 0, 0));
|
= Quaternion.Euler(new Vector3(-90, 0, 0));
|
||||||
bool _ui;
|
bool _ui;
|
||||||
@@ -109,10 +90,8 @@ namespace Cryville.Crtr.Components {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool transparent = false;
|
|
||||||
|
|
||||||
protected void InternalInit(string meshName = "quad") {
|
protected void InternalInit(string meshName = "quad") {
|
||||||
mesh.Init(transform, transparent);
|
mesh.Init(transform);
|
||||||
mesh.Mesh = GenericResources.Meshes[meshName];
|
mesh.Mesh = GenericResources.Meshes[meshName];
|
||||||
UpdateScale();
|
UpdateScale();
|
||||||
UpdateZIndex();
|
UpdateZIndex();
|
||||||
|
@@ -5,7 +5,7 @@ using Logger = Cryville.Common.Logger;
|
|||||||
namespace Cryville.Crtr.Components {
|
namespace Cryville.Crtr.Components {
|
||||||
public class SpriteInfo {
|
public class SpriteInfo {
|
||||||
public string FrameName;
|
public string FrameName;
|
||||||
public Cocos2dFrames.Frame Frame {
|
public SpriteFrame Frame {
|
||||||
get;
|
get;
|
||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
|
@@ -4,8 +4,6 @@ namespace Cryville.Crtr.Components {
|
|||||||
public class SpriteRect : SpriteBase {
|
public class SpriteRect : SpriteBase {
|
||||||
public SpriteRect() {
|
public SpriteRect() {
|
||||||
SubmitProperty("color", new PropOp.Color(v => Color = v));
|
SubmitProperty("color", new PropOp.Color(v => Color = v));
|
||||||
|
|
||||||
transparent = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Color _color;
|
Color _color;
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
using Cryville.Common.Pdt;
|
using Cryville.Common.Buffers;
|
||||||
|
using Cryville.Common.Pdt;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -7,7 +8,7 @@ namespace Cryville.Crtr.Components {
|
|||||||
public class SpriteText : SpriteBase {
|
public class SpriteText : SpriteBase {
|
||||||
public SpriteText() {
|
public SpriteText() {
|
||||||
SubmitProperty("frames", new op_set_frames(this));
|
SubmitProperty("frames", new op_set_frames(this));
|
||||||
SubmitProperty("value", new PropOp.String(v => Value = v));
|
SubmitProperty("value", new PropOp.TargetString(() => Value));
|
||||||
SubmitProperty("size", new PropOp.Float(v => Size = v));
|
SubmitProperty("size", new PropOp.Float(v => Size = v));
|
||||||
SubmitProperty("spacing", new PropOp.Float(v => Spacing = v));
|
SubmitProperty("spacing", new PropOp.Float(v => Spacing = v));
|
||||||
SubmitProperty("opacity", new PropOp.Float(v => Opacity = v));
|
SubmitProperty("opacity", new PropOp.Float(v => Opacity = v));
|
||||||
@@ -41,21 +42,14 @@ namespace Cryville.Crtr.Components {
|
|||||||
foreach (var m in meshes) m.Value.Destroy();
|
foreach (var m in meshes) m.Value.Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly Dictionary<Texture2D, MeshWrapper> meshes = new Dictionary<Texture2D, MeshWrapper>();
|
|
||||||
Dictionary<char, SpriteInfo> m_frames;
|
Dictionary<char, SpriteInfo> m_frames;
|
||||||
public Dictionary<char, SpriteInfo> Frames {
|
public Dictionary<char, SpriteInfo> Frames {
|
||||||
get { return m_frames; }
|
get { return m_frames; }
|
||||||
set { m_frames = value; UpdateFrames(); UpdateScale(); }
|
set { m_frames = value; UpdateFrames(); UpdateScale(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string m_value;
|
readonly TargetString m_value = new TargetString();
|
||||||
public string Value {
|
public TargetString Value { get { return m_value; } }
|
||||||
get { return m_value; }
|
|
||||||
set {
|
|
||||||
if (m_value == value) return;
|
|
||||||
m_value = value; UpdateScale();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public float m_size;
|
public float m_size;
|
||||||
public float Size {
|
public float Size {
|
||||||
@@ -80,31 +74,38 @@ namespace Cryville.Crtr.Components {
|
|||||||
float frameHeight = 0;
|
float frameHeight = 0;
|
||||||
foreach (var m in meshes) m.Value.Destroy();
|
foreach (var m in meshes) m.Value.Destroy();
|
||||||
meshes.Clear();
|
meshes.Clear();
|
||||||
|
verts.Clear();
|
||||||
|
uvs.Clear();
|
||||||
foreach (var f in m_frames) {
|
foreach (var f in m_frames) {
|
||||||
f.Value.Load();
|
f.Value.Load();
|
||||||
if (frameHeight == 0) frameHeight = f.Value.Rect.height;
|
if (frameHeight == 0) frameHeight = f.Value.Rect.height;
|
||||||
else if (frameHeight != f.Value.Rect.height) throw new Exception("Inconsistent frame height");
|
else if (frameHeight != f.Value.Rect.height) throw new Exception("Inconsistent frame height");
|
||||||
if (!meshes.ContainsKey(f.Value.Frame.Texture)) {
|
var tex = f.Value.Frame.Texture;
|
||||||
|
if (!meshes.ContainsKey(tex)) {
|
||||||
var m = new MeshWrapper();
|
var m = new MeshWrapper();
|
||||||
m.Init(mesh.MeshTransform, transparent);
|
m.Init(mesh.MeshTransform);
|
||||||
m.Mesh = new Mesh();
|
m.Mesh = new Mesh();
|
||||||
m.Renderer.material.mainTexture = f.Value.Frame.Texture;
|
m.Renderer.material.mainTexture = tex;
|
||||||
meshes.Add(f.Value.Frame.Texture, m);
|
meshes.Add(tex, m);
|
||||||
|
verts.Add(tex, new List<Vector3>());
|
||||||
|
uvs.Add(tex, new List<Vector2>());
|
||||||
|
tris.Add(tex, new List<int>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float sum_x;
|
float sum_x;
|
||||||
|
readonly Dictionary<Texture2D, MeshWrapper> meshes = new Dictionary<Texture2D, MeshWrapper>();
|
||||||
|
readonly Dictionary<Texture2D, List<Vector3>> verts = new Dictionary<Texture2D, List<Vector3>>();
|
||||||
|
readonly Dictionary<Texture2D, List<Vector2>> uvs = new Dictionary<Texture2D, List<Vector2>>();
|
||||||
|
readonly Dictionary<Texture2D, List<int>> tris = new Dictionary<Texture2D, List<int>>();
|
||||||
void UpdateMeshes() {
|
void UpdateMeshes() {
|
||||||
// TODO optimize GC
|
|
||||||
if (meshes.Count == 0) return;
|
if (meshes.Count == 0) return;
|
||||||
sum_x = 0;
|
sum_x = 0;
|
||||||
int vc = m_value.Length * 4;
|
|
||||||
Dictionary<Texture2D, List<Vector3>> verts = new Dictionary<Texture2D, List<Vector3>>();
|
|
||||||
Dictionary<Texture2D, List<Vector2>> uvs = new Dictionary<Texture2D, List<Vector2>>();
|
|
||||||
foreach (var t in meshes.Keys) {
|
foreach (var t in meshes.Keys) {
|
||||||
verts.Add(t, new List<Vector3>(vc));
|
verts[t].Clear();
|
||||||
uvs.Add(t, new List<Vector2>(vc));
|
uvs[t].Clear();
|
||||||
|
tris[t].Clear();
|
||||||
}
|
}
|
||||||
foreach (var c in m_value) {
|
foreach (var c in m_value) {
|
||||||
var f = m_frames[c];
|
var f = m_frames[c];
|
||||||
@@ -124,18 +125,18 @@ namespace Cryville.Crtr.Components {
|
|||||||
var m = meshes[t].Mesh;
|
var m = meshes[t].Mesh;
|
||||||
m.Clear();
|
m.Clear();
|
||||||
int cc = verts[t].Count / 4;
|
int cc = verts[t].Count / 4;
|
||||||
int[] tris = new int[cc * 6];
|
var _tris = tris[t];
|
||||||
for (int i = 0; i < cc; i++) {
|
for (int i = 0; i < cc; i++) {
|
||||||
tris[i * 6 ] = i * 4 ;
|
_tris.Add(i * 4);
|
||||||
tris[i * 6 + 1] = i * 4 + 3;
|
_tris.Add(i * 4 + 3);
|
||||||
tris[i * 6 + 2] = i * 4 + 1;
|
_tris.Add(i * 4 + 1);
|
||||||
tris[i * 6 + 3] = i * 4 + 1;
|
_tris.Add(i * 4 + 1);
|
||||||
tris[i * 6 + 4] = i * 4 + 3;
|
_tris.Add(i * 4 + 3);
|
||||||
tris[i * 6 + 5] = i * 4 + 2;
|
_tris.Add(i * 4 + 2);
|
||||||
}
|
}
|
||||||
m.vertices = verts[t].ToArray();
|
m.SetVertices(verts[t]);
|
||||||
m.uv = uvs[t].ToArray();
|
m.SetUVs(0, uvs[t]);
|
||||||
m.triangles = tris;
|
m.SetTriangles(tris[t], 0);
|
||||||
m.RecalculateNormals();
|
m.RecalculateNormals();
|
||||||
}
|
}
|
||||||
sum_x -= m_spacing;
|
sum_x -= m_spacing;
|
||||||
@@ -175,6 +176,7 @@ namespace Cryville.Crtr.Components {
|
|||||||
UpdateFrames();
|
UpdateFrames();
|
||||||
mesh.Mesh.Clear();
|
mesh.Mesh.Clear();
|
||||||
UpdateScale();
|
UpdateScale();
|
||||||
|
Value.OnUpdate += UpdateScale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
@@ -10,6 +10,9 @@ namespace Cryville.Crtr.Config {
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
Transform m_content;
|
Transform m_content;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
SettingsPanel m_genericConfigPanel;
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
InputConfigPanel m_inputConfigPanel;
|
InputConfigPanel m_inputConfigPanel;
|
||||||
|
|
||||||
@@ -21,12 +24,17 @@ namespace Cryville.Crtr.Config {
|
|||||||
FileInfo file = new FileInfo(
|
FileInfo file = new FileInfo(
|
||||||
Game.GameDataPath + "/rulesets/" + Settings.Default.LoadRuleset
|
Game.GameDataPath + "/rulesets/" + Settings.Default.LoadRuleset
|
||||||
);
|
);
|
||||||
|
if (!file.Exists) {
|
||||||
|
Popup.Create("Ruleset for the chart not found\nMake sure you have imported the ruleset");
|
||||||
|
ReturnToMenu();
|
||||||
|
return;
|
||||||
|
}
|
||||||
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<Ruleset>(reader.ReadToEnd(), new JsonSerializerSettings() {
|
||||||
MissingMemberHandling = MissingMemberHandling.Error
|
MissingMemberHandling = MissingMemberHandling.Error
|
||||||
});
|
});
|
||||||
if (ruleset.format != 1) throw new FormatException("Invalid ruleset file version");
|
if (ruleset.format != Ruleset.CURRENT_FORMAT) throw new FormatException("Invalid ruleset file version");
|
||||||
ruleset.LoadPdt(dir);
|
ruleset.LoadPdt(dir);
|
||||||
}
|
}
|
||||||
FileInfo cfgfile = new FileInfo(
|
FileInfo cfgfile = new FileInfo(
|
||||||
@@ -43,6 +51,9 @@ namespace Cryville.Crtr.Config {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_genericConfigPanel.Target = _rscfg.generic;
|
||||||
|
|
||||||
var proxy = new InputProxy(ruleset.Root, null);
|
var proxy = new InputProxy(ruleset.Root, null);
|
||||||
proxy.LoadFrom(_rscfg.inputs);
|
proxy.LoadFrom(_rscfg.inputs);
|
||||||
m_inputConfigPanel.proxy = proxy;
|
m_inputConfigPanel.proxy = proxy;
|
||||||
@@ -56,7 +67,7 @@ namespace Cryville.Crtr.Config {
|
|||||||
cat.SetActive(true);
|
cat.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReturnToMenu() {
|
public void SaveAndReturnToMenu() {
|
||||||
Game.InputManager.Deactivate();
|
Game.InputManager.Deactivate();
|
||||||
m_inputConfigPanel.proxy.SaveTo(_rscfg.inputs);
|
m_inputConfigPanel.proxy.SaveTo(_rscfg.inputs);
|
||||||
m_inputConfigPanel.proxy.Dispose();
|
m_inputConfigPanel.proxy.Dispose();
|
||||||
@@ -66,6 +77,9 @@ namespace Cryville.Crtr.Config {
|
|||||||
using (StreamWriter cfgwriter = new StreamWriter(cfgfile.FullName, false, Encoding.UTF8)) {
|
using (StreamWriter cfgwriter = new StreamWriter(cfgfile.FullName, false, Encoding.UTF8)) {
|
||||||
cfgwriter.Write(JsonConvert.SerializeObject(_rscfg, Game.GlobalJsonSerializerSettings));
|
cfgwriter.Write(JsonConvert.SerializeObject(_rscfg, Game.GlobalJsonSerializerSettings));
|
||||||
}
|
}
|
||||||
|
ReturnToMenu();
|
||||||
|
}
|
||||||
|
public void ReturnToMenu() {
|
||||||
GameObject.Find("Master").GetComponent<Master>().ShowMenu();
|
GameObject.Find("Master").GetComponent<Master>().ShowMenu();
|
||||||
#if UNITY_5_5_OR_NEWER
|
#if UNITY_5_5_OR_NEWER
|
||||||
SceneManager.UnloadSceneAsync("Config");
|
SceneManager.UnloadSceneAsync("Config");
|
||||||
|
@@ -25,13 +25,14 @@ namespace Cryville.Crtr.Config {
|
|||||||
GameObject m_prefabInputConfigEntry;
|
GameObject m_prefabInputConfigEntry;
|
||||||
|
|
||||||
public InputProxy proxy;
|
public InputProxy proxy;
|
||||||
Dictionary<string, InputConfigPanelEntry> _entries = new Dictionary<string, InputConfigPanelEntry>();
|
readonly Dictionary<string, InputConfigPanelEntry> _entries = new Dictionary<string, InputConfigPanelEntry>();
|
||||||
|
|
||||||
string _sel;
|
string _sel;
|
||||||
public void OpenDialog(string entry) {
|
public void OpenDialog(string entry) {
|
||||||
_sel = entry;
|
_sel = entry;
|
||||||
m_inputDialog.SetActive(true);
|
m_inputDialog.SetActive(true);
|
||||||
CallHelper.Purge(m_deviceList);
|
CallHelper.Purge(m_deviceList);
|
||||||
|
Game.InputManager.EnumerateEvents(ev => { });
|
||||||
_recvsrcs.Clear();
|
_recvsrcs.Clear();
|
||||||
AddSourceItem(null);
|
AddSourceItem(null);
|
||||||
}
|
}
|
||||||
|
@@ -1,12 +1,32 @@
|
|||||||
using System.Collections.Generic;
|
using Cryville.Common.ComponentModel;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Config {
|
namespace Cryville.Crtr.Config {
|
||||||
public class RulesetConfig {
|
public class RulesetConfig {
|
||||||
public Dictionary<string, InputConfigEntry> inputs
|
public Generic generic = new Generic();
|
||||||
= new Dictionary<string, InputConfigEntry>();
|
public class Generic {
|
||||||
|
[Category("basic")]
|
||||||
|
[JsonProperty("skin")]
|
||||||
|
public string Skin { get; set; }
|
||||||
|
|
||||||
|
[Category("deprecated")][Obsolete]
|
||||||
|
[JsonProperty("scroll_velocity")][DefaultValue(1)]
|
||||||
|
[LogarithmicScale][Step(0.5f)][Precision(1e-1)]
|
||||||
|
public float ScrollVelocity { get; set; }
|
||||||
|
|
||||||
|
public Generic() {
|
||||||
|
Skin = "";
|
||||||
|
ScrollVelocity = 1;
|
||||||
}
|
}
|
||||||
public class InputConfigEntry {
|
}
|
||||||
|
public Dictionary<string, InputEntry> inputs
|
||||||
|
= new Dictionary<string, InputEntry>();
|
||||||
|
public class InputEntry {
|
||||||
public string handler;
|
public string handler;
|
||||||
public int type;
|
public int type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
using Cryville.Crtr.Components;
|
using Cryville.Crtr.Components;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Event {
|
namespace Cryville.Crtr.Event {
|
||||||
@@ -63,12 +64,19 @@ namespace Cryville.Crtr.Event {
|
|||||||
get { return cs.Container; }
|
get { return cs.Container; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SkinContainer skinContainer;
|
||||||
|
public Judge judge;
|
||||||
|
public void AttachSystems(PdtSkin skin, Judge judge) {
|
||||||
|
skinContainer = new SkinContainer(skin);
|
||||||
|
this.judge = judge;
|
||||||
|
}
|
||||||
|
|
||||||
public ContainerHandler() { }
|
public ContainerHandler() { }
|
||||||
public abstract string TypeName {
|
public abstract string TypeName {
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
public virtual void PreInit() {
|
public virtual void PreInit() {
|
||||||
gogroup = new GameObject(TypeName + ":" + Container.GetHashCode().ToString()).transform;
|
gogroup = new GameObject(TypeName + ":" + Container.GetHashCode().ToString(CultureInfo.InvariantCulture)).transform;
|
||||||
if (cs.Parent != null)
|
if (cs.Parent != null)
|
||||||
gogroup.SetParent(cs.Parent.Handler.gogroup, false);
|
gogroup.SetParent(cs.Parent.Handler.gogroup, false);
|
||||||
a_head = new GameObject("::head").transform;
|
a_head = new GameObject("::head").transform;
|
||||||
@@ -79,10 +87,10 @@ namespace Cryville.Crtr.Event {
|
|||||||
Anchors.Add("tail", new Anchor() { Transform = a_tail });
|
Anchors.Add("tail", new Anchor() { Transform = a_tail });
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called upon initialization of <see cref="cs" />.
|
/// Called upon StartUpdate of ps 17.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void Init() {
|
public virtual void Init() {
|
||||||
cs.skinContainer.MatchStatic(cs);
|
skinContainer.MatchStatic(ps);
|
||||||
foreach (var i in gogroup.GetComponentsInChildren<SkinComponent>())
|
foreach (var i in gogroup.GetComponentsInChildren<SkinComponent>())
|
||||||
i.Init();
|
i.Init();
|
||||||
}
|
}
|
||||||
@@ -111,11 +119,14 @@ namespace Cryville.Crtr.Event {
|
|||||||
PreAwake(s);
|
PreAwake(s);
|
||||||
Awake(s);
|
Awake(s);
|
||||||
}
|
}
|
||||||
|
else if (s.CloneType == 17) {
|
||||||
|
Init();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public virtual void Update(ContainerState s, StampedEvent ev) {
|
public virtual void Update(ContainerState s, StampedEvent ev) {
|
||||||
bool flag = !Awoken && s.CloneType >= 2 && s.CloneType < 16;
|
bool flag = !Awoken && s.CloneType >= 2 && s.CloneType < 16;
|
||||||
if (flag) PreAwake(s);
|
if (flag) PreAwake(s);
|
||||||
if (Awoken && s.CloneType <= 2) if (gogroup) cs.skinContainer.MatchDynamic(s);
|
if (s.CloneType <= 2) if (gogroup) skinContainer.MatchDynamic(s);
|
||||||
if (flag) Awake(s);
|
if (flag) Awake(s);
|
||||||
}
|
}
|
||||||
public virtual void ExUpdate(ContainerState s, StampedEvent ev) { }
|
public virtual void ExUpdate(ContainerState s, StampedEvent ev) { }
|
||||||
@@ -123,7 +134,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
public virtual void EndUpdate(ContainerState s) {
|
public virtual void EndUpdate(ContainerState s) {
|
||||||
if (s.CloneType < 16) {
|
if (s.CloneType < 16) {
|
||||||
Awoken = false;
|
Awoken = false;
|
||||||
if (gogroup && s.CloneType <= 2) cs.skinContainer.MatchDynamic(s);
|
if (gogroup && s.CloneType <= 2) skinContainer.MatchDynamic(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public virtual void Anchor() { }
|
public virtual void Anchor() { }
|
||||||
|
@@ -50,8 +50,6 @@ namespace Cryville.Crtr.Event {
|
|||||||
public byte CloneType;
|
public byte CloneType;
|
||||||
private ContainerState rootPrototype = null;
|
private ContainerState rootPrototype = null;
|
||||||
private ContainerState prototype = null;
|
private ContainerState prototype = null;
|
||||||
public SkinContainer skinContainer;
|
|
||||||
public Judge judge;
|
|
||||||
|
|
||||||
public ContainerHandler Handler {
|
public ContainerHandler Handler {
|
||||||
get;
|
get;
|
||||||
@@ -67,8 +65,14 @@ namespace Cryville.Crtr.Event {
|
|||||||
readonly RMVPool RMVPool = new RMVPool();
|
readonly RMVPool RMVPool = new RMVPool();
|
||||||
protected Dictionary<StampedEvent, RealtimeMotionValue> PlayingMotions = new Dictionary<StampedEvent, RealtimeMotionValue>();
|
protected Dictionary<StampedEvent, RealtimeMotionValue> PlayingMotions = new Dictionary<StampedEvent, RealtimeMotionValue>();
|
||||||
protected Dictionary<Identifier, RealtimeMotionValue> Values;
|
protected Dictionary<Identifier, RealtimeMotionValue> Values;
|
||||||
protected Dictionary<Identifier, Vector> CachedValues;
|
protected Dictionary<Identifier, CacheEntry> CachedValues;
|
||||||
protected Dictionary<Identifier, bool> CachedValueStates;
|
protected class CacheEntry {
|
||||||
|
public bool Valid { get; set; }
|
||||||
|
public Vector Value { get; set; }
|
||||||
|
public CacheEntry Clone() {
|
||||||
|
return new CacheEntry { Valid = Valid, Value = Value == null ? null : Value.Clone() };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a motion value.
|
/// Gets a motion value.
|
||||||
@@ -90,7 +94,10 @@ namespace Cryville.Crtr.Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InvalidateMotion(Identifier name) {
|
void InvalidateMotion(Identifier name) {
|
||||||
CachedValueStates[name] = false;
|
CacheEntry cache;
|
||||||
|
if (!CachedValues.TryGetValue(name, out cache))
|
||||||
|
CachedValues.Add(name, cache = new CacheEntry());
|
||||||
|
cache.Valid = false;
|
||||||
foreach (var c in Children)
|
foreach (var c in Children)
|
||||||
c.Value.InvalidateMotion(name);
|
c.Value.InvalidateMotion(name);
|
||||||
}
|
}
|
||||||
@@ -104,8 +111,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Values = new Dictionary<Identifier, RealtimeMotionValue>(ChartPlayer.motionRegistry.Count);
|
Values = new Dictionary<Identifier, RealtimeMotionValue>(ChartPlayer.motionRegistry.Count);
|
||||||
CachedValues = new Dictionary<Identifier, Vector>(ChartPlayer.motionRegistry.Count);
|
CachedValues = new Dictionary<Identifier, CacheEntry>(ChartPlayer.motionRegistry.Count);
|
||||||
CachedValueStates = new Dictionary<Identifier, bool>(ChartPlayer.motionRegistry.Count);
|
|
||||||
foreach (var m in ChartPlayer.motionRegistry)
|
foreach (var m in ChartPlayer.motionRegistry)
|
||||||
Values.Add(m.Key, new RealtimeMotionValue().Init(Parent == null ? m.Value.GlobalInitValue : m.Value.InitValue));
|
Values.Add(m.Key, new RealtimeMotionValue().Init(Parent == null ? m.Value.GlobalInitValue : m.Value.InitValue));
|
||||||
}
|
}
|
||||||
@@ -126,18 +132,12 @@ namespace Cryville.Crtr.Event {
|
|||||||
}
|
}
|
||||||
r.Values = mvs;
|
r.Values = mvs;
|
||||||
|
|
||||||
var cvs = new Dictionary<Identifier, Vector>(ChartPlayer.motionRegistry.Count);
|
var cvs = new Dictionary<Identifier, CacheEntry>(ChartPlayer.motionRegistry.Count);
|
||||||
foreach (var cv in CachedValues) {
|
foreach (var cv in CachedValues) {
|
||||||
cvs.Add(cv.Key, cv.Value.Clone());
|
cvs.Add(cv.Key, cv.Value.Clone());
|
||||||
}
|
}
|
||||||
r.CachedValues = cvs;
|
r.CachedValues = cvs;
|
||||||
|
|
||||||
var cvss = new Dictionary<Identifier, bool>(ChartPlayer.motionRegistry.Count);
|
|
||||||
foreach (var cv in CachedValueStates) {
|
|
||||||
cvss.Add(cv.Key, cv.Value);
|
|
||||||
}
|
|
||||||
r.CachedValueStates = cvss;
|
|
||||||
|
|
||||||
r.Children = new Dictionary<EventContainer, ContainerState>();
|
r.Children = new Dictionary<EventContainer, ContainerState>();
|
||||||
foreach (var child in Children) {
|
foreach (var child in Children) {
|
||||||
var cc = child.Value.Clone(ct);
|
var cc = child.Value.Clone(ct);
|
||||||
@@ -172,11 +172,13 @@ namespace Cryville.Crtr.Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (var cv in CachedValues) {
|
foreach (var cv in CachedValues) {
|
||||||
Vector dv;
|
CacheEntry dv;
|
||||||
if(dest.CachedValues.TryGetValue(cv.Key, out dv)) cv.Value.CopyTo(dv);
|
if (dest.CachedValues.TryGetValue(cv.Key, out dv)) {
|
||||||
|
dv.Valid = cv.Value.Valid;
|
||||||
|
if (cv.Value.Value != null) cv.Value.Value.CopyTo(dv.Value);
|
||||||
|
}
|
||||||
else dest.CachedValues.Add(cv.Key, cv.Value.Clone());
|
else dest.CachedValues.Add(cv.Key, cv.Value.Clone());
|
||||||
}
|
}
|
||||||
foreach (var cvs in CachedValueStates) dest.CachedValueStates[cvs.Key] = cvs.Value;
|
|
||||||
|
|
||||||
if (ct != 1) foreach (var cev in WorkingChildren)
|
if (ct != 1) foreach (var cev in WorkingChildren)
|
||||||
Children[cev].CopyTo(ct, dest.Children[cev]);
|
Children[cev].CopyTo(ct, dest.Children[cev]);
|
||||||
@@ -184,7 +186,6 @@ namespace Cryville.Crtr.Event {
|
|||||||
child.Value.CopyTo(ct, dest.Children[child.Key]);
|
child.Value.CopyTo(ct, dest.Children[child.Key]);
|
||||||
ValidateChildren();
|
ValidateChildren();
|
||||||
|
|
||||||
RMVPool.ReturnAll();
|
|
||||||
dest.PlayingMotions.Clear();
|
dest.PlayingMotions.Clear();
|
||||||
foreach (var m in PlayingMotions) dest.PlayingMotions.Add(m.Key, m.Value);
|
foreach (var m in PlayingMotions) dest.PlayingMotions.Add(m.Key, m.Value);
|
||||||
}
|
}
|
||||||
@@ -210,27 +211,25 @@ namespace Cryville.Crtr.Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void AttachSystems(PdtSkin skin, Judge judge) {
|
public void AttachSystems(PdtSkin skin, Judge judge) {
|
||||||
skinContainer = new SkinContainer(skin);
|
Handler.AttachSystems(skin, judge);
|
||||||
this.judge = judge;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector GetRawValue(Identifier key) {
|
public Vector GetRawValue(Identifier key) {
|
||||||
Vector tr;
|
CacheEntry tr;
|
||||||
if (!CachedValues.TryGetValue(key, out tr)) {
|
if (!CachedValues.TryGetValue(key, out tr))
|
||||||
tr = (Vector)ReflectionHelper.InvokeEmptyConstructor(ChartPlayer.motionRegistry[key].Type);
|
CachedValues.Add(key, tr = new CacheEntry { Valid = false });
|
||||||
CachedValues.Add(key, tr);
|
if (tr.Value == null)
|
||||||
CachedValueStates[key] = false;
|
tr.Value = (Vector)ReflectionHelper.InvokeEmptyConstructor(ChartPlayer.motionRegistry[key].Type);
|
||||||
}
|
Vector r = tr.Value;
|
||||||
Vector r = tr;
|
|
||||||
#if !DISABLE_CACHE
|
#if !DISABLE_CACHE
|
||||||
if (CachedValueStates[key]) return r;
|
if (tr.Valid) return r;
|
||||||
#endif
|
#endif
|
||||||
float reltime = 0;
|
float reltime = 0;
|
||||||
if (rootPrototype != null) reltime = Time - rootPrototype.Time;
|
if (rootPrototype != null) reltime = Time - rootPrototype.Time;
|
||||||
GetMotionValue(key).GetValue(reltime, ref r);
|
GetMotionValue(key).GetValue(reltime, ref r);
|
||||||
if (Parent != null) r.ApplyFrom(Parent.GetRawValue(key));
|
if (Parent != null) r.ApplyFrom(Parent.GetRawValue(key));
|
||||||
#if !DISABLE_CACHE
|
#if !DISABLE_CACHE
|
||||||
CachedValueStates[key] = true;
|
tr.Valid = true;
|
||||||
#endif
|
#endif
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
@@ -324,11 +323,14 @@ namespace Cryville.Crtr.Event {
|
|||||||
if (ev.Unstamped is Chart.Motion) {
|
if (ev.Unstamped is Chart.Motion) {
|
||||||
var tev = (Chart.Motion)ev.Unstamped;
|
var tev = (Chart.Motion)ev.Unstamped;
|
||||||
var mv = RMVPool.Rent(tev.Name);
|
var mv = RMVPool.Rent(tev.Name);
|
||||||
|
mv.CloneTypeFlag = CloneType;
|
||||||
GetMotionValue(tev.Name).CopyTo(mv);
|
GetMotionValue(tev.Name).CopyTo(mv);
|
||||||
PlayingMotions.Add(ev, mv);
|
PlayingMotions.Add(ev, mv);
|
||||||
Callback(ev, callback);
|
Callback(ev, callback);
|
||||||
if (!ev.Unstamped.IsLong)
|
if (!ev.Unstamped.IsLong) {
|
||||||
PlayingMotions.Remove(ev);
|
PlayingMotions.Remove(ev);
|
||||||
|
RMVPool.Return(mv);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (ev.Unstamped is EventContainer) {
|
else if (ev.Unstamped is EventContainer) {
|
||||||
var cev = (EventContainer)ev.Unstamped;
|
var cev = (EventContainer)ev.Unstamped;
|
||||||
@@ -348,6 +350,8 @@ namespace Cryville.Crtr.Event {
|
|||||||
var nev = tev.Original;
|
var nev = tev.Original;
|
||||||
if (nev is Chart.Motion) {
|
if (nev is Chart.Motion) {
|
||||||
Callback(ev, callback);
|
Callback(ev, callback);
|
||||||
|
var mv = PlayingMotions[ev.Origin];
|
||||||
|
if (mv.CloneTypeFlag == CloneType) RMVPool.Return(mv);
|
||||||
PlayingMotions.Remove(ev.Origin);
|
PlayingMotions.Remove(ev.Origin);
|
||||||
}
|
}
|
||||||
else if (nev is EventContainer) {
|
else if (nev is EventContainer) {
|
||||||
@@ -404,13 +408,17 @@ namespace Cryville.Crtr.Event {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BroadcastInit() {
|
public void BroadcastPreInit() {
|
||||||
Handler.PreInit();
|
Handler.PreInit();
|
||||||
Handler.Init();
|
foreach (var c in Children.Values) {
|
||||||
foreach (var s in Children) {
|
c.BroadcastPreInit();
|
||||||
s.Value.BroadcastInit();
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
public void BroadcastPostInit() {
|
||||||
Handler.PostInit();
|
Handler.PostInit();
|
||||||
|
foreach (var c in Children.Values) {
|
||||||
|
c.BroadcastPostInit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StartUpdate() {
|
public void StartUpdate() {
|
||||||
|
@@ -35,6 +35,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
r.invalidatedStates = new HashSet<ContainerState>();
|
r.invalidatedStates = new HashSet<ContainerState>();
|
||||||
r.Time += offsetTime;
|
r.Time += offsetTime;
|
||||||
r.RootState = RootState.Clone(ct);
|
r.RootState = RootState.Clone(ct);
|
||||||
|
r.RootState.StartUpdate();
|
||||||
r.Expand();
|
r.Expand();
|
||||||
r.AttachBus();
|
r.AttachBus();
|
||||||
foreach (var s in r.states) r.invalidatedStates.Add(s.Value);
|
foreach (var s in r.states) r.invalidatedStates.Add(s.Value);
|
||||||
@@ -146,8 +147,11 @@ namespace Cryville.Crtr.Event {
|
|||||||
invalidatedStates.Clear();
|
invalidatedStates.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BroadcastInit() {
|
public void BroadcastPreInit() {
|
||||||
RootState.BroadcastInit();
|
RootState.BroadcastPreInit();
|
||||||
|
}
|
||||||
|
public void BroadcastPostInit() {
|
||||||
|
RootState.BroadcastPostInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BroadcastEndUpdate() {
|
public void BroadcastEndUpdate() {
|
||||||
|
@@ -20,7 +20,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
_buckets.Add(reg.Key, new Bucket(reg.Key, 4096));
|
_buckets.Add(reg.Key, new Bucket(reg.Key, 4096));
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly Dictionary<RealtimeMotionValue, string> _rented = new Dictionary<RealtimeMotionValue, string>();
|
readonly Dictionary<RealtimeMotionValue, Identifier> _rented = new Dictionary<RealtimeMotionValue, Identifier>();
|
||||||
public RealtimeMotionValue Rent(Identifier name) {
|
public RealtimeMotionValue Rent(Identifier name) {
|
||||||
var n = name;
|
var n = name;
|
||||||
var obj = _buckets[n].Rent();
|
var obj = _buckets[n].Rent();
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 925f95cb7c6644a4695b2701d42e1ea2
|
guid: b9bd9e24d7c553341a2a12391843542f
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
timeCreated: 1606989037
|
|
||||||
licenseType: Free
|
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
@@ -0,0 +1,188 @@
|
|||||||
|
using Cryville.Common;
|
||||||
|
using Cryville.Common.Math;
|
||||||
|
using Cryville.Crtr.Browsing;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace Cryville.Crtr.Extensions.Bestdori {
|
||||||
|
public class BestdoriChartConverter : ResourceConverter {
|
||||||
|
static readonly string[] SUPPORTED_FORMATS = { ".json" };
|
||||||
|
public override string[] GetSupportedFormats() {
|
||||||
|
return SUPPORTED_FORMATS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override IEnumerable<Resource> ConvertFrom(FileInfo file) {
|
||||||
|
List<Resource> result = new List<Resource>();
|
||||||
|
List<BestdoriChartEvent> src;
|
||||||
|
using (var reader = new StreamReader(file.FullName)) {
|
||||||
|
src = JsonConvert.DeserializeObject<List<BestdoriChartEvent>>(reader.ReadToEnd());
|
||||||
|
}
|
||||||
|
var group = new Chart.Group() {
|
||||||
|
tracks = new List<Chart.Track>(),
|
||||||
|
notes = new List<Chart.Note>(),
|
||||||
|
motions = new List<Chart.Motion>(),
|
||||||
|
};
|
||||||
|
Chart chart = new Chart {
|
||||||
|
format = 2,
|
||||||
|
time = new BeatTime(0, 0, 1),
|
||||||
|
ruleset = "bang_dream_girls_band_party",
|
||||||
|
sigs = new List<Chart.Signature>(),
|
||||||
|
sounds = new List<Chart.Sound>(),
|
||||||
|
motions = new List<Chart.Motion>(),
|
||||||
|
groups = new List<Chart.Group> { group },
|
||||||
|
};
|
||||||
|
string bgm = null;
|
||||||
|
double? cbpm = null;
|
||||||
|
double pbeat = 0, ctime = 0;
|
||||||
|
double endbeat = 0;
|
||||||
|
foreach (var ev in src) {
|
||||||
|
double cbeat = ev.StartBeat;
|
||||||
|
ctime += cbpm == null ? 0 : (cbeat - pbeat) / cbpm.Value * 60;
|
||||||
|
pbeat = cbeat;
|
||||||
|
if (cbeat > endbeat) endbeat = cbeat;
|
||||||
|
if (ev is BestdoriChartEvent.System) {
|
||||||
|
if (bgm != null) continue;
|
||||||
|
var tev = (BestdoriChartEvent.System)ev;
|
||||||
|
bgm = StringUtils.TrimExt(tev.data);
|
||||||
|
var name = "bang_dream_girls_band_party__" + bgm;
|
||||||
|
result.Add(new SongResource(name, new FileInfo(Path.Combine(file.Directory.FullName, tev.data))));
|
||||||
|
chart.sounds.Add(new Chart.Sound { time = ToBeatTime(tev.beat), id = name });
|
||||||
|
}
|
||||||
|
else if (ev is BestdoriChartEvent.BPM) {
|
||||||
|
var tev = (BestdoriChartEvent.BPM)ev;
|
||||||
|
cbpm = tev.bpm;
|
||||||
|
chart.sigs.Add(new Chart.Signature { time = ToBeatTime(tev.beat), tempo = (float)tev.bpm });
|
||||||
|
}
|
||||||
|
else if (ev is BestdoriChartEvent.Single) {
|
||||||
|
var tev = (BestdoriChartEvent.Single)ev;
|
||||||
|
group.notes.Add(new Chart.Note {
|
||||||
|
time = ToBeatTime(tev.beat),
|
||||||
|
judges = new List<Chart.Judge> { new Chart.Judge { name = tev.flick ? "single_flick" : "single" } },
|
||||||
|
motions = new List<Chart.Motion> { new Chart.Motion { motion = "track:" + tev.lane.ToString(CultureInfo.InvariantCulture) } },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else if (ev is BestdoriChartEvent.Long) {
|
||||||
|
var tev = (BestdoriChartEvent.Long)ev;
|
||||||
|
var c1 = tev.connections[tev.connections.Count - 1];
|
||||||
|
var note = new Chart.Note {
|
||||||
|
time = ToBeatTime(tev.connections[0].beat),
|
||||||
|
endtime = ToBeatTime(c1.beat),
|
||||||
|
judges = new List<Chart.Judge>(),
|
||||||
|
};
|
||||||
|
for (int i = 0; i < tev.connections.Count; i++) {
|
||||||
|
BestdoriChartEvent.Connection c = tev.connections[i];
|
||||||
|
if (i == 0) {
|
||||||
|
note.judges.Add(new Chart.Judge { name = "single" });
|
||||||
|
note.motions.Add(new Chart.Motion { motion = "track:" + c.lane.ToString(CultureInfo.InvariantCulture) });
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
note.motions.Add(new Chart.Motion { time = ToBeatTime(tev.connections[i - 1].beat), endtime = ToBeatTime(c.beat), motion = "track:" + c.lane.ToString(CultureInfo.InvariantCulture) });
|
||||||
|
if (i == tev.connections.Count - 1)
|
||||||
|
note.judges.Add(new Chart.Judge { time = ToBeatTime(c.beat), name = c.flick ? "longend_flick" : "longend" });
|
||||||
|
else if (!c.hidden)
|
||||||
|
note.judges.Add(new Chart.Judge { time = ToBeatTime(c.beat), name = "longnode" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (c1.beat > endbeat) endbeat = c1.beat;
|
||||||
|
group.notes.Add(note);
|
||||||
|
}
|
||||||
|
else throw new NotImplementedException("Unsupported event: " + ev.type);
|
||||||
|
}
|
||||||
|
if (bgm == null) throw new FormatException("Chart contains no song");
|
||||||
|
chart.endtime = ToBeatTime(endbeat + 4);
|
||||||
|
result.Add(new RawChartResource(string.Format("bang_dream_girls_band_party__{0}__{1}", bgm, StringUtils.TrimExt(file.Name)), chart, new ChartMeta {
|
||||||
|
name = string.Format("Bandori {0} {1}", bgm, StringUtils.TrimExt(file.Name)),
|
||||||
|
author = "©BanG Dream! Project ©Craft Egg Inc. ©bushiroad",
|
||||||
|
ruleset = "bang_dream_girls_band_party",
|
||||||
|
note_count = group.notes.Count,
|
||||||
|
length = (float)ctime,
|
||||||
|
song = new SongMetaInfo {
|
||||||
|
name = bgm,
|
||||||
|
author = "©BanG Dream! Project ©Craft Egg Inc. ©bushiroad",
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
BeatTime ToBeatTime(double beat, double error = 1e-4) {
|
||||||
|
int i, n, d;
|
||||||
|
FractionUtils.ToFraction(beat, error, out n, out d);
|
||||||
|
i = n / d; n %= d;
|
||||||
|
return new BeatTime(i, n, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma warning disable IDE1006
|
||||||
|
[JsonConverter(typeof(BestdoriChartEventCreator))]
|
||||||
|
abstract class BestdoriChartEvent {
|
||||||
|
public abstract string type { get; }
|
||||||
|
public abstract double StartBeat { get; }
|
||||||
|
public abstract class InstantEvent : BestdoriChartEvent {
|
||||||
|
public double beat;
|
||||||
|
public override double StartBeat { get { return beat; } }
|
||||||
|
}
|
||||||
|
public class BPM : InstantEvent {
|
||||||
|
public override string type { get { return "BPM"; } }
|
||||||
|
public double bpm;
|
||||||
|
}
|
||||||
|
public class System : InstantEvent {
|
||||||
|
public override string type { get { return "System"; } }
|
||||||
|
public string data;
|
||||||
|
}
|
||||||
|
public abstract class SingleBase : InstantEvent {
|
||||||
|
public double lane;
|
||||||
|
public bool skill;
|
||||||
|
public bool flick;
|
||||||
|
}
|
||||||
|
public class Single : SingleBase {
|
||||||
|
public override string type { get { return "Single"; } }
|
||||||
|
}
|
||||||
|
public class Directional : SingleBase {
|
||||||
|
public override string type { get { return "Directional"; } }
|
||||||
|
public string direction;
|
||||||
|
public int width;
|
||||||
|
}
|
||||||
|
public class Connection : SingleBase {
|
||||||
|
public override string type { get { return null; } }
|
||||||
|
public bool hidden;
|
||||||
|
}
|
||||||
|
public class Long : BestdoriChartEvent {
|
||||||
|
public override string type { get { return "Long"; } }
|
||||||
|
public List<Connection> connections;
|
||||||
|
public override double StartBeat { get { return connections[0].beat; } }
|
||||||
|
}
|
||||||
|
public class Slide : Long {
|
||||||
|
public override string type { get { return "Slide"; } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#pragma warning restore IDE1006
|
||||||
|
class BestdoriChartEventCreator : CustomCreationConverter<BestdoriChartEvent> {
|
||||||
|
string _currentType;
|
||||||
|
|
||||||
|
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) {
|
||||||
|
var obj = JObject.ReadFrom(reader);
|
||||||
|
var type = obj["type"];
|
||||||
|
if (type == null) _currentType = null;
|
||||||
|
else _currentType = obj["type"].ToObject<string>();
|
||||||
|
return base.ReadJson(obj.CreateReader(), objectType, existingValue, serializer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override BestdoriChartEvent Create(Type objectType) {
|
||||||
|
switch (_currentType) {
|
||||||
|
case "BPM": return new BestdoriChartEvent.BPM();
|
||||||
|
case "System": return new BestdoriChartEvent.System();
|
||||||
|
case "Single": return new BestdoriChartEvent.Single();
|
||||||
|
case "Directional": return new BestdoriChartEvent.Directional();
|
||||||
|
case null: return new BestdoriChartEvent.Connection();
|
||||||
|
case "Long": return new BestdoriChartEvent.Long();
|
||||||
|
case "Slide": return new BestdoriChartEvent.Slide();
|
||||||
|
default: throw new ArgumentException("Unknown event type: " + _currentType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e3c5a8bf05d5e284ba498e91cb0dd35e
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -18,11 +18,11 @@ namespace Cryville.Crtr.Extensions.Malody {
|
|||||||
public override IEnumerable<Resource> ConvertFrom(FileInfo file) {
|
public override IEnumerable<Resource> ConvertFrom(FileInfo file) {
|
||||||
List<Resource> result = new List<Resource>();
|
List<Resource> result = new List<Resource>();
|
||||||
MalodyChart src;
|
MalodyChart src;
|
||||||
|
if (file.Extension != ".mc") throw new NotImplementedException("mcz file is not supported");
|
||||||
using (var reader = new StreamReader(file.FullName)) {
|
using (var reader = new StreamReader(file.FullName)) {
|
||||||
src = JsonConvert.DeserializeObject<MalodyChart>(reader.ReadToEnd());
|
src = JsonConvert.DeserializeObject<MalodyChart>(reader.ReadToEnd());
|
||||||
}
|
}
|
||||||
if (src.meta.mode != 0) throw new NotImplementedException("The chart mode is not supported");
|
if (src.meta.mode != 0) throw new NotImplementedException("The chart mode is not supported");
|
||||||
if (src.meta.mode_ext.column != 4) throw new NotImplementedException("The key count is not supported");
|
|
||||||
|
|
||||||
var ruleset = "malody!" + MODES[src.meta.mode];
|
var ruleset = "malody!" + MODES[src.meta.mode];
|
||||||
if (src.meta.mode == 0) {
|
if (src.meta.mode == 0) {
|
||||||
@@ -30,7 +30,9 @@ namespace Cryville.Crtr.Extensions.Malody {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ChartMeta meta = new ChartMeta() {
|
ChartMeta meta = new ChartMeta() {
|
||||||
song = new ChartMeta.MetaInfo() {
|
name = src.meta.version,
|
||||||
|
author = src.meta.creator,
|
||||||
|
song = new SongMetaInfo() {
|
||||||
name = src.meta.song.titleorg != null ? src.meta.song.titleorg : src.meta.song.title,
|
name = src.meta.song.titleorg != null ? src.meta.song.titleorg : src.meta.song.title,
|
||||||
author = src.meta.song.artistorg != null ? src.meta.song.artistorg : src.meta.song.artist,
|
author = src.meta.song.artistorg != null ? src.meta.song.artistorg : src.meta.song.artist,
|
||||||
},
|
},
|
||||||
@@ -71,30 +73,31 @@ namespace Cryville.Crtr.Extensions.Malody {
|
|||||||
Dictionary<MalodyChart.IEvent, StartEventState> longEvents
|
Dictionary<MalodyChart.IEvent, StartEventState> longEvents
|
||||||
= new Dictionary<MalodyChart.IEvent, StartEventState>();
|
= new Dictionary<MalodyChart.IEvent, StartEventState>();
|
||||||
|
|
||||||
float? baseBpm = null;
|
float? baseBpm = null, cbpm = null;
|
||||||
float pbeat = 0f, ctime = 0f;
|
float pbeat = 0f, ctime = 0f;
|
||||||
int[] endbeat = new int[] { 0, 0, 1 };
|
int[] endbeat = new int[] { 0, 0, 1 };
|
||||||
foreach (var ev in events) {
|
foreach (var ev in events) {
|
||||||
float cbeat = ConvertBeat(ev.beat);
|
float cbeat = ConvertBeat(ev.beat);
|
||||||
ctime += baseBpm == null ? 0 : (cbeat - pbeat) / baseBpm.Value * 60f;
|
ctime += cbpm == null ? 0 : (cbeat - pbeat) / cbpm.Value * 60f;
|
||||||
pbeat = cbeat;
|
pbeat = cbeat;
|
||||||
if (ev is MalodyChart.Time) {
|
if (ev is MalodyChart.Time) {
|
||||||
var tev = (MalodyChart.Time)ev;
|
var tev = (MalodyChart.Time)ev;
|
||||||
if (baseBpm == null) baseBpm = tev.bpm;
|
if (baseBpm == null) baseBpm = tev.bpm;
|
||||||
|
cbpm = tev.bpm;
|
||||||
chart.sigs.Add(new Chart.Signature {
|
chart.sigs.Add(new Chart.Signature {
|
||||||
time = new BeatTime(ev.beat[0], ev.beat[1], ev.beat[2]),
|
time = new BeatTime(ev.beat[0], ev.beat[1], ev.beat[2]),
|
||||||
tempo = tev.bpm,
|
tempo = tev.bpm,
|
||||||
});
|
});
|
||||||
chart.motions.Add(new Chart.Motion {
|
chart.motions.Add(new Chart.Motion {
|
||||||
time = new BeatTime(ev.beat[0], ev.beat[1], ev.beat[2]),
|
time = new BeatTime(ev.beat[0], ev.beat[1], ev.beat[2]),
|
||||||
motion = "svm:" + (tev.bpm / baseBpm).ToString()
|
motion = "svm:" + (tev.bpm / baseBpm.Value).ToString(CultureInfo.InvariantCulture)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (ev is MalodyChart.Effect) {
|
else if (ev is MalodyChart.Effect) {
|
||||||
var tev = (MalodyChart.Effect)ev;
|
var tev = (MalodyChart.Effect)ev;
|
||||||
if (tev.scroll != null) group.motions.Add(new Chart.Motion {
|
if (tev.scroll != null) group.motions.Add(new Chart.Motion {
|
||||||
time = new BeatTime(ev.beat[0], ev.beat[1], ev.beat[2]),
|
time = new BeatTime(ev.beat[0], ev.beat[1], ev.beat[2]),
|
||||||
motion = "svm:" + tev.scroll.ToString()
|
motion = "svm:" + tev.scroll.Value.ToString(CultureInfo.InvariantCulture)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (ev is MalodyChart.Note) {
|
else if (ev is MalodyChart.Note) {
|
||||||
@@ -116,7 +119,7 @@ namespace Cryville.Crtr.Extensions.Malody {
|
|||||||
var rn = new Chart.Note() {
|
var rn = new Chart.Note() {
|
||||||
time = new BeatTime(tev.beat[0], tev.beat[1], tev.beat[2]),
|
time = new BeatTime(tev.beat[0], tev.beat[1], tev.beat[2]),
|
||||||
motions = new List<Chart.Motion> {
|
motions = new List<Chart.Motion> {
|
||||||
new Chart.Motion() { motion = "track:" + tev.column.ToString() }
|
new Chart.Motion() { motion = "track:" + tev.column.ToString(CultureInfo.InvariantCulture) }
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
if (tev.endbeat != null) {
|
if (tev.endbeat != null) {
|
||||||
@@ -141,16 +144,13 @@ namespace Cryville.Crtr.Extensions.Malody {
|
|||||||
else throw new NotSupportedException();
|
else throw new NotSupportedException();
|
||||||
}
|
}
|
||||||
chart.endtime = new BeatTime(endbeat[0] + 4, endbeat[1], endbeat[2]);
|
chart.endtime = new BeatTime(endbeat[0] + 4, endbeat[1], endbeat[2]);
|
||||||
meta.chart = new ChartMeta.MetaInfo() {
|
meta.length = ctime;
|
||||||
name = src.meta.version,
|
|
||||||
author = src.meta.creator,
|
|
||||||
length = ctime,
|
|
||||||
};
|
|
||||||
meta.note_count = group.notes.Count;
|
meta.note_count = group.notes.Count;
|
||||||
string chartName = string.Format("{0} - {1}", meta.song.name, meta.chart.name);
|
string chartName = string.Format("{0} - {1}", meta.song.name, meta.name);
|
||||||
result.Add(new ChartResource(chartName, chart, meta));
|
if (src.meta.background != null) {
|
||||||
if (src.meta.background != null)
|
meta.cover = src.meta.background;
|
||||||
result.Add(new CoverResource(chartName, new FileInfo(file.DirectoryName + "/" + src.meta.background)));
|
}
|
||||||
|
result.Add(new RawChartResource(chartName, chart, meta));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ namespace Cryville.Crtr.Extensions.Malody {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pragma warning disable IDE1006
|
#pragma warning disable IDE1006
|
||||||
public struct MalodyChart {
|
struct MalodyChart {
|
||||||
public interface IEvent {
|
public interface IEvent {
|
||||||
int[] beat { get; set; }
|
int[] beat { get; set; }
|
||||||
int[] endbeat { get; set; }
|
int[] endbeat { get; set; }
|
||||||
|
@@ -76,7 +76,14 @@ namespace Cryville.Crtr {
|
|||||||
#if UNITY_ANDROID
|
#if UNITY_ANDROID
|
||||||
Cryville.Audio.OpenSL.OutputClient.CallbackFunction = audioCallback;
|
Cryville.Audio.OpenSL.OutputClient.CallbackFunction = audioCallback;
|
||||||
#endif
|
#endif
|
||||||
|
while (true) {
|
||||||
|
try {
|
||||||
AudioManager = EngineBuilder.Create();
|
AudioManager = EngineBuilder.Create();
|
||||||
|
if (AudioManager == null) {
|
||||||
|
Popup.Create("Cannot initialize audio engine");
|
||||||
|
Logger.Log("main", 5, "Audio", "Cannot initialize audio engine");
|
||||||
|
}
|
||||||
|
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();
|
AudioClient = AudioManager.GetDefaultDevice(DataFlow.Out).Connect();
|
||||||
AudioClient.Init(AudioClient.DefaultFormat);
|
AudioClient.Init(AudioClient.DefaultFormat);
|
||||||
@@ -84,6 +91,15 @@ namespace Cryville.Crtr {
|
|||||||
AudioSession = AudioSequencer.NewSession();
|
AudioSession = AudioSequencer.NewSession();
|
||||||
AudioSequencer.Playing = true;
|
AudioSequencer.Playing = true;
|
||||||
AudioClient.Start();
|
AudioClient.Start();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
Logger.Log("main", 4, "Audio", "An error occured when initializing the audio engine: {0}", ex);
|
||||||
|
Logger.Log("main", 3, "Audio", "Trying to use fallback audio engines");
|
||||||
|
EngineBuilder.Engines.Remove(AudioManager.GetType());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ChartPlayer.motionRegistry = new Dictionary<Identifier, MotionRegistry> {
|
ChartPlayer.motionRegistry = new Dictionary<Identifier, MotionRegistry> {
|
||||||
{ "pt" , new MotionRegistry(typeof(VecPt)) },
|
{ "pt" , new MotionRegistry(typeof(VecPt)) },
|
||||||
|
@@ -19,6 +19,7 @@ namespace Cryville.Crtr {
|
|||||||
public static void LoadDefault() {
|
public static void LoadDefault() {
|
||||||
if (loaded) return;
|
if (loaded) return;
|
||||||
Components.Add("image", typeof(SpritePlane));
|
Components.Add("image", typeof(SpritePlane));
|
||||||
|
Components.Add("mesh", typeof(MeshBase));
|
||||||
Components.Add("polysec", typeof(PolygonSGO));
|
Components.Add("polysec", typeof(PolygonSGO));
|
||||||
Components.Add("rect", typeof(SpriteRect));
|
Components.Add("rect", typeof(SpriteRect));
|
||||||
Components.Add("scale3", typeof(SpriteScale3));
|
Components.Add("scale3", typeof(SpriteScale3));
|
||||||
@@ -29,8 +30,7 @@ namespace Cryville.Crtr {
|
|||||||
Meshes.Add("quad_scale3h", Resources.Load<Mesh>("quad_scale3h"));
|
Meshes.Add("quad_scale3h", Resources.Load<Mesh>("quad_scale3h"));
|
||||||
Meshes.Add("quad_scale9", Resources.Load<Mesh>("quad_scale9"));
|
Meshes.Add("quad_scale9", Resources.Load<Mesh>("quad_scale9"));
|
||||||
|
|
||||||
Materials.Add("-CutoutMat", Resources.Load<Material>("CutoutMat"));
|
Materials.Add("-SpriteMat", Resources.Load<Material>("SpriteMat"));
|
||||||
Materials.Add("-TransparentMat", Resources.Load<Material>("TransparentMat"));
|
|
||||||
|
|
||||||
loaded = true;
|
loaded = true;
|
||||||
}
|
}
|
||||||
|
@@ -17,6 +17,7 @@ namespace Cryville.Crtr {
|
|||||||
*(int*)(ptr + 3 * sizeof(float)) = PdtInternalType.Number;
|
*(int*)(ptr + 3 * sizeof(float)) = PdtInternalType.Number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_vecsrc = new PropSrc.Arbitrary(PdtInternalType.Vector, _vecbuf);
|
||||||
_etor = ChartPlayer.etor;
|
_etor = ChartPlayer.etor;
|
||||||
_ruleset = ruleset;
|
_ruleset = ruleset;
|
||||||
_judge = judge;
|
_judge = judge;
|
||||||
@@ -37,7 +38,7 @@ namespace Cryville.Crtr {
|
|||||||
readonly Dictionary<string, int> _use = new Dictionary<string, int>();
|
readonly Dictionary<string, int> _use = new Dictionary<string, int>();
|
||||||
readonly Dictionary<string, List<string>> _rev = new Dictionary<string, List<string>>();
|
readonly Dictionary<string, List<string>> _rev = new Dictionary<string, List<string>>();
|
||||||
public event EventHandler<ProxyChangedEventArgs> ProxyChanged;
|
public event EventHandler<ProxyChangedEventArgs> ProxyChanged;
|
||||||
public void LoadFrom(Dictionary<string, InputConfigEntry> config) {
|
public void LoadFrom(Dictionary<string, RulesetConfig.InputEntry> config) {
|
||||||
foreach (var cfg in config) {
|
foreach (var cfg in config) {
|
||||||
Set(new InputProxyEntry {
|
Set(new InputProxyEntry {
|
||||||
Target = cfg.Key,
|
Target = cfg.Key,
|
||||||
@@ -48,10 +49,10 @@ namespace Cryville.Crtr {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void SaveTo(Dictionary<string, InputConfigEntry> config) {
|
public void SaveTo(Dictionary<string, RulesetConfig.InputEntry> config) {
|
||||||
config.Clear();
|
config.Clear();
|
||||||
foreach (var p in _tproxies) {
|
foreach (var p in _tproxies) {
|
||||||
config.Add(p.Key, new InputConfigEntry {
|
config.Add(p.Key, new RulesetConfig.InputEntry {
|
||||||
handler = ReflectionHelper.GetNamespaceQualifiedName(p.Value.Source.Value.Handler.GetType()),
|
handler = ReflectionHelper.GetNamespaceQualifiedName(p.Value.Source.Value.Handler.GetType()),
|
||||||
type = p.Value.Source.Value.Type
|
type = p.Value.Source.Value.Type
|
||||||
});
|
});
|
||||||
@@ -168,11 +169,12 @@ namespace Cryville.Crtr {
|
|||||||
static readonly int _var_value = IdentifierManager.SharedInstance.Request("value");
|
static readonly int _var_value = IdentifierManager.SharedInstance.Request("value");
|
||||||
static readonly PropOp.Arbitrary _arbop = new PropOp.Arbitrary();
|
static readonly PropOp.Arbitrary _arbop = new PropOp.Arbitrary();
|
||||||
readonly byte[] _vecbuf = new byte[3 * sizeof(float) + sizeof(int)];
|
readonly byte[] _vecbuf = new byte[3 * sizeof(float) + sizeof(int)];
|
||||||
|
readonly PropSrc.Arbitrary _vecsrc;
|
||||||
readonly Dictionary<InputHandler, double> _timeOrigins = new Dictionary<InputHandler, double>();
|
readonly Dictionary<InputHandler, double> _timeOrigins = new Dictionary<InputHandler, double>();
|
||||||
readonly Dictionary<InputSource, int> _activeCounts = new Dictionary<InputSource, int>();
|
readonly Dictionary<InputSource, int> _activeCounts = new Dictionary<InputSource, int>();
|
||||||
readonly Dictionary<InputIdentifier, float> _vect = new Dictionary<InputIdentifier, float>();
|
readonly Dictionary<InputIdentifier, float> _vect = new Dictionary<InputIdentifier, float>();
|
||||||
readonly Dictionary<ProxiedInputIdentifier, PropSrc.Arbitrary> _vecs = new Dictionary<ProxiedInputIdentifier, PropSrc.Arbitrary>();
|
readonly Dictionary<ProxiedInputIdentifier, PropSrc.Arbitrary> _vecs = new Dictionary<ProxiedInputIdentifier, PropSrc.Arbitrary>();
|
||||||
static readonly byte[] _nullvalue = new byte[0];
|
static readonly PropSrc.Arbitrary _nullsrc = new PropSrc.Arbitrary(PdtInternalType.Null, new byte[0]);
|
||||||
unsafe void OnInput(InputIdentifier id, InputVector vec) {
|
unsafe void OnInput(InputIdentifier id, InputVector vec) {
|
||||||
lock (_lock) {
|
lock (_lock) {
|
||||||
InputProxyEntry proxy;
|
InputProxyEntry proxy;
|
||||||
@@ -181,14 +183,15 @@ namespace Cryville.Crtr {
|
|||||||
float ft, tt = (float)(vec.Time - _timeOrigins[id.Source.Handler]);
|
float ft, tt = (float)(vec.Time - _timeOrigins[id.Source.Handler]);
|
||||||
if (!_vect.TryGetValue(id, out ft)) ft = tt;
|
if (!_vect.TryGetValue(id, out ft)) ft = tt;
|
||||||
if (vec.IsNull) {
|
if (vec.IsNull) {
|
||||||
_etor.ContextCascadeUpdate(_var_value, new PropSrc.Arbitrary(PdtInternalType.Null, _nullvalue));
|
_etor.ContextCascadeUpdate(_var_value, _nullsrc);
|
||||||
OnInput(id, proxy.Target, ft, tt, true);
|
OnInput(id, proxy.Target, ft, tt, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fixed (byte* ptr = _vecbuf) {
|
fixed (byte* ptr = _vecbuf) {
|
||||||
*(Vector3*)ptr = vec.Vector;
|
*(Vector3*)ptr = vec.Vector;
|
||||||
}
|
}
|
||||||
_etor.ContextCascadeUpdate(_var_value, new PropSrc.Arbitrary(PdtInternalType.Vector, _vecbuf));
|
_vecsrc.Invalidate();
|
||||||
|
_etor.ContextCascadeUpdate(_var_value, _vecsrc);
|
||||||
OnInput(id, proxy.Target, ft, tt, false);
|
OnInput(id, proxy.Target, ft, tt, false);
|
||||||
}
|
}
|
||||||
_vect[id] = tt;
|
_vect[id] = tt;
|
||||||
@@ -212,7 +215,7 @@ namespace Cryville.Crtr {
|
|||||||
else {
|
else {
|
||||||
var pid = new ProxiedInputIdentifier { Source = id, Target = target };
|
var pid = new ProxiedInputIdentifier { Source = id, Target = target };
|
||||||
PropSrc.Arbitrary fv, tv = _etor.ContextCascadeLookup(_var_value);
|
PropSrc.Arbitrary fv, tv = _etor.ContextCascadeLookup(_var_value);
|
||||||
if (!_vecs.TryGetValue(pid, out fv)) fv = new PropSrc.Arbitrary(PdtInternalType.Null, _nullvalue);
|
if (!_vecs.TryGetValue(pid, out fv)) fv = _nullsrc;
|
||||||
if (fv.Type != PdtInternalType.Null || tv.Type != PdtInternalType.Null) {
|
if (fv.Type != PdtInternalType.Null || tv.Type != PdtInternalType.Null) {
|
||||||
if (fv.Type == PdtInternalType.Null) _activeCounts[id.Source]++;
|
if (fv.Type == PdtInternalType.Null) _activeCounts[id.Source]++;
|
||||||
_etor.ContextCascadeInsert();
|
_etor.ContextCascadeInsert();
|
||||||
@@ -222,7 +225,7 @@ namespace Cryville.Crtr {
|
|||||||
_etor.ContextCascadeDiscard();
|
_etor.ContextCascadeDiscard();
|
||||||
if (tv.Type == PdtInternalType.Null) _activeCounts[id.Source]--;
|
if (tv.Type == PdtInternalType.Null) _activeCounts[id.Source]--;
|
||||||
}
|
}
|
||||||
_judge.Cleanup(target, ft, tt);
|
_judge.Cleanup(target, tt);
|
||||||
_vecs[pid] = tv;
|
_vecs[pid] = tv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,10 @@
|
|||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
|
using Cryville.Common.Buffers;
|
||||||
using Cryville.Common.Pdt;
|
using Cryville.Common.Pdt;
|
||||||
using Cryville.Crtr.Event;
|
using Cryville.Crtr.Event;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr {
|
||||||
public class Judge {
|
public class Judge {
|
||||||
@@ -30,14 +33,7 @@ namespace Cryville.Crtr {
|
|||||||
public Judge(PdtRuleset rs) {
|
public Judge(PdtRuleset rs) {
|
||||||
_etor = ChartPlayer.etor;
|
_etor = ChartPlayer.etor;
|
||||||
_rs = rs;
|
_rs = rs;
|
||||||
foreach (var s in rs.scores) {
|
InitScores();
|
||||||
var key = s.Key;
|
|
||||||
scoreSrcs.Add(key.Key, new PropSrc.Float(() => scores[key.Key]));
|
|
||||||
scoreOps.Add(key.Key, new PropOp.Float(v => scores[key.Key] = v));
|
|
||||||
scoreFmtKeys.Add(key.Key, IdentifierManager.SharedInstance.Request("_score_" + (string)key.Name));
|
|
||||||
scoreDefs.Add(key.Key, s.Value);
|
|
||||||
scores.Add(key.Key, s.Value.init);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public void Prepare(float st, float et, Identifier input, JudgeDefinition def, ContainerState container) {
|
public void Prepare(float st, float et, Identifier input, JudgeDefinition def, ContainerState container) {
|
||||||
List<JudgeEvent> list;
|
List<JudgeEvent> list;
|
||||||
@@ -93,10 +89,12 @@ namespace Cryville.Crtr {
|
|||||||
int num3 = num + (num2 - num >> 1);
|
int num3 = num + (num2 - num >> 1);
|
||||||
int num4 = -list[num3].Definition.stack.CompareTo(stack);
|
int num4 = -list[num3].Definition.stack.CompareTo(stack);
|
||||||
if (num4 == 0) num4 = list[num3].StartClip.CompareTo(time);
|
if (num4 == 0) num4 = list[num3].StartClip.CompareTo(time);
|
||||||
if (num4 >= 0) num2 = num3 - 1;
|
if (num4 > 0) num2 = num3 - 1;
|
||||||
else num = num3 + 1;
|
else if (num4 < 0) num = num3 + 1;
|
||||||
|
else if (num != num3) num2 = num3;
|
||||||
|
else return num;
|
||||||
}
|
}
|
||||||
return num + 1;
|
return ~num;
|
||||||
}
|
}
|
||||||
public void Feed(Identifier target, float ft, float tt) {
|
public void Feed(Identifier target, float ft, float tt) {
|
||||||
Forward(target, tt);
|
Forward(target, tt);
|
||||||
@@ -116,8 +114,8 @@ namespace Cryville.Crtr {
|
|||||||
if (def.scores != null) UpdateScore(def.scores);
|
if (def.scores != null) UpdateScore(def.scores);
|
||||||
if (def.pass != null) Pass(def.pass);
|
if (def.pass != null) Pass(def.pass);
|
||||||
actlist.RemoveAt(index);
|
actlist.RemoveAt(index);
|
||||||
if (def.stack != def.prop && actlist.Count > 0) {
|
if (def.prop != 0 && actlist.Count > 0) {
|
||||||
index = BinarySearchFirst(actlist, ev.StartClip, def.prop);
|
index = BinarySearchFirst(actlist, ev.StartClip, def.stack - def.prop);
|
||||||
if (index < 0) index = ~index;
|
if (index < 0) index = ~index;
|
||||||
}
|
}
|
||||||
else index++;
|
else index++;
|
||||||
@@ -139,7 +137,7 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public void Cleanup(Identifier target, float ft, float tt) {
|
public void Cleanup(Identifier target, float tt) {
|
||||||
Forward(target, tt);
|
Forward(target, tt);
|
||||||
var actlist = activeEvs[target];
|
var actlist = activeEvs[target];
|
||||||
for (int i = actlist.Count - 1; i >= 0; i--) {
|
for (int i = actlist.Count - 1; i >= 0; i--) {
|
||||||
@@ -166,42 +164,95 @@ namespace Cryville.Crtr {
|
|||||||
var key = scoreop.Key;
|
var key = scoreop.Key;
|
||||||
_etor.ContextSelfValue = scoreSrcs[key.name.Key];
|
_etor.ContextSelfValue = scoreSrcs[key.name.Key];
|
||||||
_etor.Evaluate(scoreOps[key.name.Key], scoreop.Value);
|
_etor.Evaluate(scoreOps[key.name.Key], scoreop.Value);
|
||||||
scoreSrcs[key.name.Key].Invalidate();
|
InvalidateScore(key.name.Key);
|
||||||
foreach (var s in _rs.scores) {
|
foreach (var s in _rs.scores) {
|
||||||
if (s.Value.value != null) {
|
if (s.Value.value != null) {
|
||||||
_etor.ContextSelfValue = scoreSrcs[s.Key.Key];
|
_etor.ContextSelfValue = scoreSrcs[s.Key.Key];
|
||||||
_etor.Evaluate(scoreOps[s.Key.Key], s.Value.value);
|
_etor.Evaluate(scoreOps[s.Key.Key], s.Value.value);
|
||||||
scoreSrcs[s.Key.Key].Invalidate();
|
InvalidateScore(s.Key.Key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ScoreCache.Clear();
|
|
||||||
}
|
}
|
||||||
readonly Dictionary<int, int> scoreFmtKeys = new Dictionary<int, int>();
|
readonly Dictionary<int, int> scoreStringKeys = new Dictionary<int, int>();
|
||||||
|
readonly Dictionary<int, int> scoreStringKeysRev = new Dictionary<int, int>();
|
||||||
readonly Dictionary<int, PropSrc> scoreSrcs = new Dictionary<int, PropSrc>();
|
readonly Dictionary<int, PropSrc> scoreSrcs = new Dictionary<int, PropSrc>();
|
||||||
readonly Dictionary<int, PropOp> scoreOps = new Dictionary<int, PropOp>();
|
readonly Dictionary<int, PropOp> scoreOps = new Dictionary<int, PropOp>();
|
||||||
readonly Dictionary<int, ScoreDefinition> scoreDefs = new Dictionary<int, ScoreDefinition>();
|
readonly Dictionary<int, ScoreDefinition> scoreDefs = new Dictionary<int, ScoreDefinition>();
|
||||||
public readonly Dictionary<int, float> scores = new Dictionary<int, float>();
|
readonly Dictionary<int, float> scores = new Dictionary<int, float>();
|
||||||
readonly Dictionary<int, string> ScoreCache = new Dictionary<int, string>();
|
readonly Dictionary<int, string> scoreStringCache = new Dictionary<int, string>();
|
||||||
readonly object _lock = new object();
|
readonly Dictionary<int, PropSrc> scoreStringSrcs = new Dictionary<int, PropSrc>();
|
||||||
public Dictionary<int, string> GetFormattedScoreStrings() {
|
readonly ArrayPool<byte> scoreStringPool = new ArrayPool<byte>();
|
||||||
lock (_lock) {
|
void InitScores() {
|
||||||
if (ScoreCache.Count == 0) {
|
foreach (var s in _rs.scores) {
|
||||||
foreach (var s in scores)
|
var key = s.Key.Key;
|
||||||
ScoreCache.Add(scoreFmtKeys[s.Key], s.Value.ToString(scoreDefs[s.Key].format));
|
var strkey = IdentifierManager.SharedInstance.Request("_score_" + (string)s.Key.Name);
|
||||||
|
scoreStringKeys.Add(key, strkey);
|
||||||
|
scoreStringKeysRev.Add(strkey, key);
|
||||||
|
scoreSrcs.Add(key, new PropSrc.Float(() => scores[key]));
|
||||||
|
scoreOps.Add(key, new PropOp.Float(v => scores[key] = v));
|
||||||
|
scoreDefs.Add(key, s.Value);
|
||||||
|
scores.Add(key, s.Value.init);
|
||||||
|
scoreStringCache.Add(scoreStringKeys[key], null);
|
||||||
|
scoreStringSrcs.Add(scoreStringKeys[key], new ScoreStringSrc(scoreStringPool, () => GetScoreString(strkey)));
|
||||||
}
|
}
|
||||||
return ScoreCache;
|
|
||||||
}
|
}
|
||||||
|
void InvalidateScore(int key) {
|
||||||
|
scoreSrcs[key].Invalidate();
|
||||||
|
scoreStringCache[scoreStringKeys[key]] = null;
|
||||||
|
scoreStringSrcs[scoreStringKeys[key]].Invalidate();
|
||||||
|
}
|
||||||
|
string GetScoreString(int key) {
|
||||||
|
var result = scoreStringCache[key];
|
||||||
|
if (result == null) {
|
||||||
|
var rkey = scoreStringKeysRev[key];
|
||||||
|
return scoreStringCache[key] = scores[rkey].ToString(scoreDefs[rkey].format, CultureInfo.InvariantCulture);
|
||||||
|
}
|
||||||
|
else return result;
|
||||||
|
}
|
||||||
|
public bool TryGetScoreSrc(int key, out PropSrc value) {
|
||||||
|
return scoreSrcs.TryGetValue(key, out value);
|
||||||
|
}
|
||||||
|
public bool TryGetScoreStringSrc(int key, out PropSrc value) {
|
||||||
|
return scoreStringSrcs.TryGetValue(key, out value);
|
||||||
}
|
}
|
||||||
public string GetFullFormattedScoreString() {
|
public string GetFullFormattedScoreString() {
|
||||||
bool flag = false;
|
bool flag = false;
|
||||||
string result = "";
|
string result = "";
|
||||||
foreach (var s in GetFormattedScoreStrings()) {
|
foreach (var s in scores.Keys) {
|
||||||
result += string.Format(flag ? "\n{0}: {1}" : "{0}: {1}", IdentifierManager.SharedInstance.Retrieve(s.Key), s.Value);
|
result += string.Format(flag ? "\n{0}: {1}" : "{0}: {1}", IdentifierManager.SharedInstance.Retrieve(s), GetScoreString(scoreStringKeys[s]));
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
class ScoreStringSrc : PropSrc {
|
||||||
|
readonly Func<string> _cb;
|
||||||
|
readonly ArrayPool<byte> _pool;
|
||||||
|
byte[] _buf;
|
||||||
|
public ScoreStringSrc(ArrayPool<byte> pool, Func<string> cb) {
|
||||||
|
_pool = pool;
|
||||||
|
_cb = cb;
|
||||||
|
}
|
||||||
|
public override void Invalidate() {
|
||||||
|
base.Invalidate();
|
||||||
|
if (_buf != null) {
|
||||||
|
_pool.Return(_buf);
|
||||||
|
_buf = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected override unsafe void InternalGet(out int type, out byte[] value) {
|
||||||
|
var src = _cb();
|
||||||
|
int strlen = src.Length;
|
||||||
|
type = PdtInternalType.String;
|
||||||
|
value = _pool.Rent(sizeof(int) + strlen * sizeof(char));
|
||||||
|
fixed (byte* _ptr = value) {
|
||||||
|
char* ptr = (char*)(_ptr + sizeof(int));
|
||||||
|
*(int*)_ptr = strlen;
|
||||||
|
int i = 0;
|
||||||
|
foreach (var c in src) ptr[i++] = c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public class InputDefinition {
|
public class InputDefinition {
|
||||||
public int dim;
|
public int dim;
|
||||||
@@ -216,7 +267,7 @@ namespace Cryville.Crtr {
|
|||||||
public Identifier[] miss;
|
public Identifier[] miss;
|
||||||
public Dictionary<ScoreOperation, PdtExpression> scores;
|
public Dictionary<ScoreOperation, PdtExpression> scores;
|
||||||
public int stack;
|
public int stack;
|
||||||
public int prop = -1;
|
public int prop = 1;
|
||||||
}
|
}
|
||||||
public class ScoreOperation {
|
public class ScoreOperation {
|
||||||
public Identifier name;
|
public Identifier name;
|
||||||
|
@@ -15,6 +15,7 @@ namespace Cryville.Crtr {
|
|||||||
SettingsPanel m_settingsPanel;
|
SettingsPanel m_settingsPanel;
|
||||||
#pragma warning restore IDE0044
|
#pragma warning restore IDE0044
|
||||||
|
|
||||||
|
int frameIndex = 2;
|
||||||
bool initialized = false;
|
bool initialized = false;
|
||||||
int totalTasks = 0;
|
int totalTasks = 0;
|
||||||
#pragma warning disable IDE0051
|
#pragma warning disable IDE0051
|
||||||
@@ -27,7 +28,11 @@ namespace Cryville.Crtr {
|
|||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
int taskCount = Game.NetworkTaskWorker.TaskCount;
|
int taskCount = Game.NetworkTaskWorker.TaskCount;
|
||||||
if (totalTasks < taskCount) totalTasks = taskCount;
|
if (totalTasks < taskCount) totalTasks = taskCount;
|
||||||
m_progressBar.value = 1 - (float)taskCount / totalTasks;
|
if (frameIndex > 0) {
|
||||||
|
frameIndex--;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_progressBar.value = totalTasks == 0 ? 1 : (1 - (float)taskCount / totalTasks);
|
||||||
if (taskCount == 0) {
|
if (taskCount == 0) {
|
||||||
initialized = true;
|
initialized = true;
|
||||||
m_targetAnimator.SetTrigger("T_Main");
|
m_targetAnimator.SetTrigger("T_Main");
|
||||||
|
@@ -22,23 +22,16 @@ namespace Cryville.Crtr {
|
|||||||
get;
|
get;
|
||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
public bool Transparent {
|
|
||||||
get;
|
|
||||||
private set;
|
|
||||||
}
|
|
||||||
public bool Initialized {
|
public bool Initialized {
|
||||||
get;
|
get;
|
||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
public Material NewMaterial {
|
public Material NewMaterial {
|
||||||
get {
|
get {
|
||||||
return Material.Instantiate(GenericResources.Materials[
|
return Material.Instantiate(GenericResources.Materials["-SpriteMat"]);
|
||||||
Transparent ? "-TransparentMat" : "-CutoutMat"
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void Init(Transform parent, bool transparent = false) {
|
public void Init(Transform parent) {
|
||||||
Transparent = transparent;
|
|
||||||
MeshObject = new GameObject("__mesh__");
|
MeshObject = new GameObject("__mesh__");
|
||||||
MeshTransform = MeshObject.transform;
|
MeshTransform = MeshObject.transform;
|
||||||
MeshTransform.SetParent(parent, false);
|
MeshTransform.SetParent(parent, false);
|
||||||
@@ -48,9 +41,7 @@ namespace Cryville.Crtr {
|
|||||||
MeshObject.AddComponent<MeshRenderer>();
|
MeshObject.AddComponent<MeshRenderer>();
|
||||||
MeshFilter = MeshObject.GetComponent<MeshFilter>();
|
MeshFilter = MeshObject.GetComponent<MeshFilter>();
|
||||||
Renderer = MeshObject.GetComponent<Renderer>();
|
Renderer = MeshObject.GetComponent<Renderer>();
|
||||||
Renderer.material = GenericResources.Materials[
|
Renderer.material = GenericResources.Materials["-SpriteMat"];
|
||||||
transparent ? "-TransparentMat" : "-CutoutMat"
|
|
||||||
]; // TODO
|
|
||||||
Initialized = true;
|
Initialized = true;
|
||||||
}
|
}
|
||||||
public void Destroy() {
|
public void Destroy() {
|
||||||
|
@@ -2,6 +2,7 @@ using Cryville.Common;
|
|||||||
using Cryville.Common.Pdt;
|
using Cryville.Common.Pdt;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@@ -170,6 +171,7 @@ namespace Cryville.Crtr {
|
|||||||
public class RealtimeMotionValue {
|
public class RealtimeMotionValue {
|
||||||
public Vector AbsoluteValue;
|
public Vector AbsoluteValue;
|
||||||
List<MotionNode> RelativeNodes;
|
List<MotionNode> RelativeNodes;
|
||||||
|
internal byte CloneTypeFlag;
|
||||||
|
|
||||||
public RealtimeMotionValue Init(Vector init) {
|
public RealtimeMotionValue Init(Vector init) {
|
||||||
RelativeNodes = new List<MotionNode> {
|
RelativeNodes = new List<MotionNode> {
|
||||||
@@ -367,11 +369,11 @@ namespace Cryville.Crtr {
|
|||||||
static readonly Type[] stringTypeArray = new Type[] { typeof(string) };
|
static readonly Type[] stringTypeArray = new Type[] { typeof(string) };
|
||||||
static readonly Type[] floatArrayTypeArray = new Type[] { typeof(float[]) };
|
static readonly Type[] floatArrayTypeArray = new Type[] { typeof(float[]) };
|
||||||
public static Vector Construct(Type type, string s) {
|
public static Vector Construct(Type type, string s) {
|
||||||
if (!typeof(Vector).IsAssignableFrom(type)) throw new ArgumentException(); // TODO
|
if (!typeof(Vector).IsAssignableFrom(type)) throw new ArgumentException("Type is not vector");
|
||||||
return (Vector)type.GetConstructor(stringTypeArray).Invoke(new object[] { s });
|
return (Vector)type.GetConstructor(stringTypeArray).Invoke(new object[] { s });
|
||||||
}
|
}
|
||||||
public static Vector Construct(Type type, float[] values) {
|
public static Vector Construct(Type type, float[] values) {
|
||||||
if (!typeof(Vector).IsAssignableFrom(type)) throw new ArgumentException(); // TODO
|
if (!typeof(Vector).IsAssignableFrom(type)) throw new ArgumentException("Type is not vector");
|
||||||
return (Vector)type.GetConstructor(floatArrayTypeArray).Invoke(new object[] { values });
|
return (Vector)type.GetConstructor(floatArrayTypeArray).Invoke(new object[] { values });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -433,7 +435,7 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString() {
|
public override string ToString() {
|
||||||
return Value.ToString();
|
return Value.ToString(CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float[] ToArray() {
|
public override float[] ToArray() {
|
||||||
@@ -493,7 +495,7 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString() {
|
public override string ToString() {
|
||||||
return Value.ToString();
|
return Value.ToString(CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float[] ToArray() {
|
public override float[] ToArray() {
|
||||||
@@ -553,7 +555,7 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString() {
|
public override string ToString() {
|
||||||
return Value.ToString();
|
return Value.ToString(CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float[] ToArray() {
|
public override float[] ToArray() {
|
||||||
@@ -648,8 +650,8 @@ namespace Cryville.Crtr {
|
|||||||
|
|
||||||
public static string ToString(float? w, float? h) {
|
public static string ToString(float? w, float? h) {
|
||||||
List<string> list = new List<string>();
|
List<string> list = new List<string>();
|
||||||
if (w != null) list.Add(w.ToString() + "w");
|
if (w != null) list.Add(w.Value.ToString(CultureInfo.InvariantCulture) + "w");
|
||||||
if (h != null) list.Add(h.ToString() + "h");
|
if (h != null) list.Add(h.Value.ToString(CultureInfo.InvariantCulture) + "h");
|
||||||
return string.Join("+", list.ToArray());
|
return string.Join("+", list.ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -744,9 +746,9 @@ namespace Cryville.Crtr {
|
|||||||
|
|
||||||
public override string ToString() {
|
public override string ToString() {
|
||||||
return string.Format("{0},{1},{2}",
|
return string.Format("{0},{1},{2}",
|
||||||
x != null ? x.ToString() : "",
|
x != null ? x.Value.ToString(CultureInfo.InvariantCulture) : "",
|
||||||
y != null ? y.ToString() : "",
|
y != null ? y.Value.ToString(CultureInfo.InvariantCulture) : "",
|
||||||
z != null ? z.ToString() : ""
|
z != null ? z.Value.ToString(CultureInfo.InvariantCulture) : ""
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -915,7 +917,7 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString() {
|
public override string ToString() {
|
||||||
return VecPtComp.ToString(xw, xh) + "," + VecPtComp.ToString(yw, yh) + "," + (z != null ? z.ToString() : "");
|
return VecPtComp.ToString(xw, xh) + "," + VecPtComp.ToString(yw, yh) + "," + (z != null ? z.Value.ToString(CultureInfo.InvariantCulture) : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float[] ToArray() {
|
public override float[] ToArray() {
|
||||||
|
@@ -11,7 +11,6 @@ namespace Cryville.Crtr {
|
|||||||
readonly GroupHandler gh;
|
readonly GroupHandler gh;
|
||||||
public readonly Chart.Note Event;
|
public readonly Chart.Note Event;
|
||||||
readonly PdtRuleset ruleset;
|
readonly PdtRuleset ruleset;
|
||||||
readonly Judge judge;
|
|
||||||
public NoteHandler(GroupHandler gh, Chart.Note ev, PdtRuleset rs, Judge j) : base() {
|
public NoteHandler(GroupHandler gh, Chart.Note ev, PdtRuleset rs, Judge j) : base() {
|
||||||
this.gh = gh;
|
this.gh = gh;
|
||||||
Event = ev;
|
Event = ev;
|
||||||
@@ -62,18 +61,6 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly Dictionary<Chart.Motion, Vec1> phMotions = new Dictionary<Chart.Motion, Vec1>();
|
|
||||||
bool invalidated = false;
|
|
||||||
readonly List<StampedEvent.Judge> patchedJudgeEvents = new List<StampedEvent.Judge>();
|
|
||||||
|
|
||||||
public override void StartUpdate(ContainerState s) {
|
|
||||||
base.StartUpdate(s);
|
|
||||||
/*if (s.CloneType == 16 && Event.judge != null) {
|
|
||||||
// var etor = new Evaluator();
|
|
||||||
//CompiledRuleset.PatchJudge(Event, ChartPlayer.cruleset.primary_judges[Event.judge], s.Time, etor, patchedJudgeEvents, !Event.@long);
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Update(ContainerState s, StampedEvent ev) {
|
public override void Update(ContainerState s, StampedEvent ev) {
|
||||||
base.Update(s, ev);
|
base.Update(s, ev);
|
||||||
if (s.CloneType == 1) {
|
if (s.CloneType == 1) {
|
||||||
@@ -103,73 +90,6 @@ namespace Cryville.Crtr {
|
|||||||
ChartPlayer.etor.ContextState = null;
|
ChartPlayer.etor.ContextState = null;
|
||||||
ChartPlayer.etor.ContextEvent = null;
|
ChartPlayer.etor.ContextEvent = null;
|
||||||
}
|
}
|
||||||
else if (ev.Unstamped is Chart.Motion) {
|
|
||||||
/*var tev = (Chart.Motion)ev.Unstamped;
|
|
||||||
if (tev.Name != "judge") return;
|
|
||||||
phMotions.Add(tev, (Vec1)s.GetRawValue<Vec1>(tev.Name).Clone());*/
|
|
||||||
}
|
|
||||||
else if (ev.Unstamped is InstantEvent) {
|
|
||||||
/*var oev = ((InstantEvent)ev.Unstamped).Original;
|
|
||||||
if (oev is Chart.Motion) {
|
|
||||||
var tev = (Chart.Motion)oev;
|
|
||||||
if (tev.Name != "judge") return;
|
|
||||||
var v0 = phMotions[tev];
|
|
||||||
var v1 = s.GetRawValue<Vec1>(tev.Name);
|
|
||||||
// var etor = new Evaluator();
|
|
||||||
for (var vi = Mathf.Ceil(v0.Value); vi < v1.Value; vi++) {
|
|
||||||
var v = new Vec1(vi);
|
|
||||||
var t = MotionLerper.Delerp(v, ev.Time, v1, ev.Origin.Time, v0, tev.transition, tev.rate);
|
|
||||||
CompiledRuleset.PatchJudge(
|
|
||||||
Event, ChartPlayer.cruleset.primary_judges[tev.Name.SubName],
|
|
||||||
t, etor, patchedJudgeEvents
|
|
||||||
);
|
|
||||||
}
|
|
||||||
phMotions.Remove(tev);
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void ExUpdate(ContainerState s, StampedEvent ev) {
|
|
||||||
base.ExUpdate(s, ev);
|
|
||||||
if (ev is StampedEvent.Judge) {
|
|
||||||
var tev = (StampedEvent.Judge)ev;
|
|
||||||
if (tev.TargetJudge != null && s.CloneType == 0 && !invalidated) {
|
|
||||||
//judge.Issue(tev, this);
|
|
||||||
}
|
|
||||||
else if (tev.TargetJudge == null && s.CloneType == 17) {
|
|
||||||
//judge.RecordPos(tev.StartEvent, GetFramePoint(s.Parent, s.Track));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
patchedJudgeEvents.Remove(tev);
|
|
||||||
// Logger.Log("main", 0, "Judge", "ir {0}", patchedJudgeEvents.Count);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void MotionUpdate(byte ct, Chart.Motion ev) {
|
|
||||||
base.MotionUpdate(ct, ev);
|
|
||||||
if (ct == 0) {
|
|
||||||
/*if (ev.Name == "judge") {
|
|
||||||
if (invalidated) return;
|
|
||||||
if (ev.Name == null)
|
|
||||||
throw new InvalidOperationException();
|
|
||||||
judge.IssueImmediate(this, ev.Name.SubName, GetFramePoint(cs.Parent, cs.Track));
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
else if (ct == 16) {
|
|
||||||
/*var etor = new EvalImpl();
|
|
||||||
if (ev.MotionName == "judge") {
|
|
||||||
if (ev.MotionSubName == null)
|
|
||||||
throw new InvalidOperationException();
|
|
||||||
var l = new List<StampedEvent>();
|
|
||||||
float t = ps.Time;
|
|
||||||
CompiledRuleset.PatchJudge(
|
|
||||||
Event, ChartPlayer.cruleset.primary_judges[ev.MotionSubName],
|
|
||||||
t, etor, ref l
|
|
||||||
);
|
|
||||||
cs.Bus.IssueEventPatch(l);
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,13 +103,6 @@ namespace Cryville.Crtr {
|
|||||||
a_tail.rotation = Quaternion.Euler(ts.Direction);
|
a_tail.rotation = Quaternion.Euler(ts.Direction);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (s.CloneType == 16) {
|
|
||||||
/*if (Event.endjudge != null) {
|
|
||||||
//var etor = new Evaluator();
|
|
||||||
//CompiledRuleset.PatchJudge(Event, ChartPlayer.cruleset.primary_judges[Event.endjudge], ps.Time, etor, patchedJudgeEvents, true);
|
|
||||||
}
|
|
||||||
cs.Bus.IssuePatch(patchedJudgeEvents.Cast<StampedEvent>());*/
|
|
||||||
}
|
|
||||||
OpenAnchor("tail");
|
OpenAnchor("tail");
|
||||||
base.EndUpdate(s);
|
base.EndUpdate(s);
|
||||||
CloseAnchor("tail");
|
CloseAnchor("tail");
|
||||||
@@ -248,10 +161,5 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<StampedEvent.Judge> Invalidate() {
|
|
||||||
invalidated = true;
|
|
||||||
return patchedJudgeEvents;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,6 +3,7 @@ using Cryville.Common.Pdt;
|
|||||||
using Cryville.Crtr.Event;
|
using Cryville.Crtr.Event;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr {
|
||||||
@@ -23,8 +24,6 @@ namespace Cryville.Crtr {
|
|||||||
else {
|
else {
|
||||||
var id = new Identifier(name);
|
var id = new Identifier(name);
|
||||||
PropSrc prop;
|
PropSrc prop;
|
||||||
string str;
|
|
||||||
float num;
|
|
||||||
if (ContextEvent != null && ContextEvent.PropSrcs.TryGetValue(name, out prop)) {
|
if (ContextEvent != null && ContextEvent.PropSrcs.TryGetValue(name, out prop)) {
|
||||||
prop.Get(out type, out value);
|
prop.Get(out type, out value);
|
||||||
}
|
}
|
||||||
@@ -32,15 +31,12 @@ namespace Cryville.Crtr {
|
|||||||
var vec = ContextState.GetRawValue(id);
|
var vec = ContextState.GetRawValue(id);
|
||||||
new VectorSrc(() => vec).Get(out type, out value);
|
new VectorSrc(() => vec).Get(out type, out value);
|
||||||
}
|
}
|
||||||
else if (ContextJudge != null && ContextJudge.scores.TryGetValue(name, out num)) {
|
else if (ContextJudge != null && ContextJudge.TryGetScoreSrc(name, out prop)) {
|
||||||
type = PdtInternalType.Number;
|
prop.Get(out type, out value);
|
||||||
LoadNum(num);
|
|
||||||
value = _numbuf;
|
|
||||||
RevokePotentialConstant();
|
RevokePotentialConstant();
|
||||||
}
|
}
|
||||||
else if (ContextJudge != null && ContextJudge.GetFormattedScoreStrings().TryGetValue(name, out str)) {
|
else if (ContextJudge != null && ContextJudge.TryGetScoreStringSrc(name, out prop)) {
|
||||||
type = PdtInternalType.String;
|
prop.Get(out type, out value);
|
||||||
value = GetBytes(str);
|
|
||||||
RevokePotentialConstant();
|
RevokePotentialConstant();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -62,17 +58,6 @@ namespace Cryville.Crtr {
|
|||||||
unsafe void LoadNum(float value) {
|
unsafe void LoadNum(float value) {
|
||||||
fixed (byte* ptr = _numbuf) *(float*)ptr = value;
|
fixed (byte* ptr = _numbuf) *(float*)ptr = value;
|
||||||
}
|
}
|
||||||
unsafe byte[] GetBytes(string value) {
|
|
||||||
int strlen = value.Length;
|
|
||||||
byte[] result = new byte[strlen * sizeof(char) + sizeof(int)];
|
|
||||||
fixed (byte* _ptr = result) {
|
|
||||||
char* ptr = (char*)(_ptr + sizeof(int));
|
|
||||||
*(int*)_ptr = strlen;
|
|
||||||
int i = 0;
|
|
||||||
foreach (var c in value) ptr[i++] = c;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
static readonly int _op_sep = IdentifierManager.SharedInstance.Request(",");
|
static readonly int _op_sep = IdentifierManager.SharedInstance.Request(",");
|
||||||
static readonly int _func_int_map = IdentifierManager.SharedInstance.Request("int_map");
|
static readonly int _func_int_map = IdentifierManager.SharedInstance.Request("int_map");
|
||||||
protected override PdtOperator GetOperator(PdtOperatorSignature sig) {
|
protected override PdtOperator GetOperator(PdtOperatorSignature sig) {
|
||||||
@@ -314,7 +299,7 @@ namespace Cryville.Crtr {
|
|||||||
ret.SetArraySuffix(PdtInternalType.String, fc);
|
ret.SetArraySuffix(PdtInternalType.String, fc);
|
||||||
int o = 0;
|
int o = 0;
|
||||||
for (int i = f; i <= t; i++) {
|
for (int i = f; i <= t; i++) {
|
||||||
var s = pf + i.ToString();
|
var s = pf + i.ToString(CultureInfo.InvariantCulture);
|
||||||
ret.SetString(s, o);
|
ret.SetString(s, o);
|
||||||
o += sizeof(int) + s.Length * sizeof(char);
|
o += sizeof(int) + s.Length * sizeof(char);
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using RBeatTime = Cryville.Crtr.BeatTime;
|
using RBeatTime = Cryville.Crtr.BeatTime;
|
||||||
|
using RTargetString = Cryville.Common.Buffers.TargetString;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr {
|
||||||
public abstract class PropOp : PdtOperator {
|
public abstract class PropOp : PdtOperator {
|
||||||
@@ -45,6 +46,22 @@ namespace Cryville.Crtr {
|
|||||||
_cb(GetOperand(0).AsString());
|
_cb(GetOperand(0).AsString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public class TargetString : PropOp {
|
||||||
|
readonly Func<RTargetString> _cb;
|
||||||
|
public TargetString(Func<RTargetString> cb) { _cb = cb; }
|
||||||
|
protected override unsafe void Execute() {
|
||||||
|
var target = _cb();
|
||||||
|
var op = GetOperand(0);
|
||||||
|
if (op.Type != PdtInternalType.String) throw new ArgumentException("Not a string");
|
||||||
|
var ptr = (byte*)op.TrustedAsOfLength(op.Length);
|
||||||
|
var len = *(int*)ptr;
|
||||||
|
target.Length = len;
|
||||||
|
var cptr = (char*)(ptr + sizeof(int));
|
||||||
|
for (int i = 0; i < len; i++)
|
||||||
|
target[i] = cptr[i];
|
||||||
|
target.Validate();
|
||||||
|
}
|
||||||
|
}
|
||||||
public class Identifier : PropOp {
|
public class Identifier : PropOp {
|
||||||
readonly Action<int> _cb;
|
readonly Action<int> _cb;
|
||||||
public Identifier(Action<int> cb) { _cb = cb; }
|
public Identifier(Action<int> cb) { _cb = cb; }
|
||||||
|
@@ -6,7 +6,7 @@ namespace Cryville.Crtr {
|
|||||||
public abstract class PropSrc {
|
public abstract class PropSrc {
|
||||||
int _type;
|
int _type;
|
||||||
byte[] _buf = null;
|
byte[] _buf = null;
|
||||||
public void Invalidate() { _buf = null; }
|
public virtual void Invalidate() { _buf = null; }
|
||||||
public void Get(out int type, out byte[] value) {
|
public void Get(out int type, out byte[] value) {
|
||||||
if (_buf == null) InternalGet(out _type, out _buf);
|
if (_buf == null) InternalGet(out _type, out _buf);
|
||||||
type = _type;
|
type = _type;
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
using Cryville.Common.Pdt;
|
using Cryville.Common.Pdt;
|
||||||
|
using Cryville.Crtr.Browsing;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -10,21 +11,19 @@ using System.Text.RegularExpressions;
|
|||||||
using SIdentifier = Cryville.Common.Identifier;
|
using SIdentifier = Cryville.Common.Identifier;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr {
|
||||||
public class Ruleset {
|
public class Ruleset : MetaInfo {
|
||||||
|
public const long CURRENT_FORMAT = 2;
|
||||||
|
|
||||||
[JsonRequired]
|
[JsonRequired]
|
||||||
public long format;
|
public long format;
|
||||||
|
|
||||||
[JsonRequired]
|
|
||||||
public string @base;
|
public string @base;
|
||||||
|
|
||||||
[JsonRequired]
|
|
||||||
public string pdt;
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public PdtRuleset Root { get; private set; }
|
public PdtRuleset Root { get; private set; }
|
||||||
|
|
||||||
public void LoadPdt(DirectoryInfo dir) {
|
public void LoadPdt(DirectoryInfo dir) {
|
||||||
using (StreamReader pdtreader = new StreamReader(dir.FullName + "/" + pdt + ".pdt", Encoding.UTF8)) {
|
using (StreamReader pdtreader = new StreamReader(dir.FullName + "/" + data + ".pdt", Encoding.UTF8)) {
|
||||||
var src = pdtreader.ReadToEnd();
|
var src = pdtreader.ReadToEnd();
|
||||||
Root = new RulesetInterpreter(src, null).Interpret();
|
Root = new RulesetInterpreter(src, null).Interpret();
|
||||||
}
|
}
|
||||||
|
@@ -112,7 +112,7 @@ namespace Cryville.Crtr {
|
|||||||
[LogarithmicScale][Step(0.5f)][Precision(1e-1)]
|
[LogarithmicScale][Step(0.5f)][Precision(1e-1)]
|
||||||
public float RenderDistance {
|
public float RenderDistance {
|
||||||
get {
|
get {
|
||||||
return PlayerPrefs.GetFloat("RenderDistance", 6);
|
return PlayerPrefs.GetFloat("RenderDistance", 4);
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
PlayerPrefs.SetFloat("RenderDistance", value);
|
PlayerPrefs.SetFloat("RenderDistance", value);
|
||||||
@@ -131,17 +131,6 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Category("gameplay")]
|
|
||||||
[LogarithmicScale][Step(0.5f)][Precision(1e-1)]
|
|
||||||
public float ScrollVelocity {
|
|
||||||
get {
|
|
||||||
return PlayerPrefs.GetFloat("ScrollVelocity", 1);
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
PlayerPrefs.SetFloat("ScrollVelocity", value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Category("gameplay")]
|
[Category("gameplay")]
|
||||||
[Step(0.04f)][Precision(1e-3)]
|
[Step(0.04f)][Precision(1e-3)]
|
||||||
public float SoundOffset {
|
public float SoundOffset {
|
||||||
@@ -186,6 +175,26 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Category("debug")]
|
||||||
|
public bool ClearLogOnPlay {
|
||||||
|
get {
|
||||||
|
return PlayerPrefs.GetInt("ClearLogOnPlay", 1) == 1;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
PlayerPrefs.SetInt("ClearLogOnPlay", value ? 1 : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("debug")]
|
||||||
|
public bool HideLogOnPlay {
|
||||||
|
get {
|
||||||
|
return PlayerPrefs.GetInt("HideLogOnPlay", 1) == 1;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
PlayerPrefs.SetInt("HideLogOnPlay", value ? 1 : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Save() { PlayerPrefs.Save(); }
|
public void Save() { PlayerPrefs.Save(); }
|
||||||
public void Reset() { PlayerPrefs.DeleteAll(); }
|
public void Reset() { PlayerPrefs.DeleteAll(); }
|
||||||
}
|
}
|
||||||
|
@@ -36,7 +36,7 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Dictionary<string, List<PropertyInfo>> _categories = new Dictionary<string, List<PropertyInfo>>();
|
readonly Dictionary<string, List<PropertyInfo>> _categories = new Dictionary<string, List<PropertyInfo>>();
|
||||||
public void LoadProperties() {
|
public void LoadProperties() {
|
||||||
_categories.Clear();
|
_categories.Clear();
|
||||||
_invalidated = false;
|
_invalidated = false;
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
using Cryville.Common.Pdt;
|
using Cryville.Common.Pdt;
|
||||||
|
using Cryville.Crtr.Browsing;
|
||||||
using Cryville.Crtr.Components;
|
using Cryville.Crtr.Components;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
@@ -10,7 +11,9 @@ using System.Reflection;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr {
|
||||||
public class Skin {
|
public class Skin : MetaInfo {
|
||||||
|
public const long CURRENT_FORMAT = 2;
|
||||||
|
|
||||||
[JsonRequired]
|
[JsonRequired]
|
||||||
public long format;
|
public long format;
|
||||||
|
|
||||||
@@ -19,14 +22,13 @@ namespace Cryville.Crtr {
|
|||||||
[JsonRequired]
|
[JsonRequired]
|
||||||
public string ruleset;
|
public string ruleset;
|
||||||
|
|
||||||
[JsonRequired]
|
public List<string> frames = new List<string>();
|
||||||
public string pdt;
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public PdtSkin Root { get; private set; }
|
public PdtSkin Root { get; private set; }
|
||||||
|
|
||||||
public void LoadPdt(DirectoryInfo dir) {
|
public void LoadPdt(DirectoryInfo dir) {
|
||||||
using (StreamReader pdtreader = new StreamReader(dir.FullName + "/" + pdt + ".pdt", Encoding.UTF8)) {
|
using (StreamReader pdtreader = new StreamReader(dir.FullName + "/" + data + ".pdt", Encoding.UTF8)) {
|
||||||
var src = pdtreader.ReadToEnd();
|
var src = pdtreader.ReadToEnd();
|
||||||
Root = new SkinInterpreter(src, null).Interpret();
|
Root = new SkinInterpreter(src, null).Interpret();
|
||||||
}
|
}
|
||||||
|
@@ -9,82 +9,100 @@ using UnityEngine.Profiling;
|
|||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr {
|
||||||
public class SkinContainer {
|
public class SkinContainer {
|
||||||
readonly PdtSkin skin;
|
readonly PdtSkin skin;
|
||||||
readonly Dictionary<SkinElement, Transform> matchedStatic
|
readonly List<DynamicProperty> dynprops = new List<DynamicProperty>();
|
||||||
= new Dictionary<SkinElement, Transform>();
|
struct DynamicProperty {
|
||||||
readonly Dictionary<SkinElement, Transform> matchedDynamic
|
public Transform Anchor { get; set; }
|
||||||
= new Dictionary<SkinElement, Transform>();
|
public SkinPropertyKey Key { get; set; }
|
||||||
|
public PdtExpression Value { get; set; }
|
||||||
|
}
|
||||||
|
readonly List<DynamicElement> dynelems = new List<DynamicElement>();
|
||||||
|
struct DynamicElement {
|
||||||
|
public Transform Anchor { get; set; }
|
||||||
|
public SkinSelectors Selectors { get; set; }
|
||||||
|
public SkinElement Element { get; set; }
|
||||||
|
}
|
||||||
public SkinContainer(PdtSkin _skin) {
|
public SkinContainer(PdtSkin _skin) {
|
||||||
skin = _skin;
|
skin = _skin;
|
||||||
}
|
}
|
||||||
public void MatchStatic(ContainerState context) {
|
public void MatchStatic(ContainerState context) {
|
||||||
matchedStatic.Clear();
|
dynprops.Clear(); dynelems.Clear();
|
||||||
MatchStatic(skin, context, context.Handler.gogroup);
|
ChartPlayer.etor.ContextState = context;
|
||||||
|
|
||||||
foreach (var m in matchedStatic) {
|
|
||||||
var el = m.Key;
|
|
||||||
var obj = m.Value;
|
|
||||||
foreach (var p in el.properties) {
|
|
||||||
if (p.Key.Name == null)
|
|
||||||
obj.gameObject.AddComponent(p.Key.Component);
|
|
||||||
else {
|
|
||||||
ChartPlayer.etor.ContextTransform = obj;
|
|
||||||
ChartPlayer.etor.ContextEvent = context.Container;
|
ChartPlayer.etor.ContextEvent = context.Container;
|
||||||
ChartPlayer.etor.Evaluate(GetPropOp(obj, p.Key), p.Value);
|
MatchStatic(skin, context, context.Handler.gogroup);
|
||||||
ChartPlayer.etor.ContextEvent = null;
|
ChartPlayer.etor.ContextEvent = null;
|
||||||
ChartPlayer.etor.ContextTransform = null;
|
ChartPlayer.etor.ContextState = null;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
void MatchStatic(SkinElement rel, ContainerState context, Transform anchor = null) {
|
void MatchStatic(SkinElement rel, ContainerState context, Transform anchor = null) {
|
||||||
matchedStatic.Add(rel, anchor);
|
ChartPlayer.etor.ContextTransform = anchor;
|
||||||
|
foreach (var p in rel.properties) {
|
||||||
|
if (p.Key.Name == null)
|
||||||
|
anchor.gameObject.AddComponent(p.Key.Component);
|
||||||
|
else {
|
||||||
|
ChartPlayer.etor.Evaluate(GetPropOp(anchor, p.Key).Operator, p.Value);
|
||||||
|
if (!p.Value.IsConstant) dynprops.Add(
|
||||||
|
new DynamicProperty { Anchor = anchor, Key = p.Key, Value = p.Value }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ChartPlayer.etor.ContextTransform = null;
|
||||||
foreach (var r in rel.elements) {
|
foreach (var r in rel.elements) {
|
||||||
|
try {
|
||||||
var new_anchor = r.Key.MatchStatic(context, anchor);
|
var new_anchor = r.Key.MatchStatic(context, anchor);
|
||||||
if (new_anchor != null) {
|
if (new_anchor != null) {
|
||||||
MatchStatic(r.Value, context, new_anchor);
|
MatchStatic(r.Value, context, new_anchor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (SelectorNotStaticException) {
|
||||||
|
dynelems.Add(
|
||||||
|
new DynamicElement { Anchor = anchor, Selectors = r.Key, Element = r.Value }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public void MatchDynamic(ContainerState context) {
|
public void MatchDynamic(ContainerState context) {
|
||||||
|
if (dynprops.Count == 0 && dynelems.Count == 0) return;
|
||||||
Profiler.BeginSample("SkinContainer.MatchDynamic");
|
Profiler.BeginSample("SkinContainer.MatchDynamic");
|
||||||
matchedDynamic.Clear();
|
ChartPlayer.etor.ContextState = context;
|
||||||
MatchDynamic(skin, context, context.Handler.gogroup);
|
|
||||||
|
|
||||||
foreach (var m in matchedDynamic) {
|
|
||||||
var el = m.Key;
|
|
||||||
var obj = m.Value;
|
|
||||||
foreach (var p in el.properties) {
|
|
||||||
if (p.Key.Name == null) continue;
|
|
||||||
if (p.Value.IsConstant) continue;
|
|
||||||
ChartPlayer.etor.ContextTransform = obj;
|
|
||||||
ChartPlayer.etor.ContextEvent = context.Container;
|
ChartPlayer.etor.ContextEvent = context.Container;
|
||||||
ChartPlayer.etor.Evaluate(GetPropOp(obj, p.Key), p.Value);
|
for (int i = 0; i < dynprops.Count; i++) {
|
||||||
|
DynamicProperty p = dynprops[i];
|
||||||
|
var prop = GetPropOp(p.Anchor, p.Key);
|
||||||
|
if (context.CloneType > prop.UpdateCloneType) continue;
|
||||||
|
ChartPlayer.etor.Evaluate(prop.Operator, p.Value);
|
||||||
|
}
|
||||||
|
for (int i = 0; i < dynelems.Count; i++) {
|
||||||
|
DynamicElement e = dynelems[i];
|
||||||
|
var anchor = e.Selectors.MatchDynamic(context, e.Anchor);
|
||||||
|
if (anchor != null) MatchDynamic(e.Element, context, anchor);
|
||||||
|
}
|
||||||
ChartPlayer.etor.ContextEvent = null;
|
ChartPlayer.etor.ContextEvent = null;
|
||||||
ChartPlayer.etor.ContextTransform = null;
|
ChartPlayer.etor.ContextState = null;
|
||||||
}
|
|
||||||
}
|
|
||||||
Profiler.EndSample();
|
Profiler.EndSample();
|
||||||
}
|
}
|
||||||
void MatchDynamic(SkinElement rel, ContainerState context, Transform anchor = null) {
|
void MatchDynamic(SkinElement rel, ContainerState context, Transform anchor = null) {
|
||||||
matchedDynamic.Add(rel, anchor);
|
ChartPlayer.etor.ContextTransform = anchor;
|
||||||
|
foreach (var p in rel.properties) {
|
||||||
|
if (p.Key.Name == null)
|
||||||
|
throw new InvalidOperationException("Component creation in dynamic context is not allowed");
|
||||||
|
var prop = GetPropOp(anchor, p.Key);
|
||||||
|
if (context.CloneType > prop.UpdateCloneType) continue;
|
||||||
|
ChartPlayer.etor.Evaluate(prop.Operator, p.Value);
|
||||||
|
}
|
||||||
|
ChartPlayer.etor.ContextTransform = null;
|
||||||
foreach (var r in rel.elements) {
|
foreach (var r in rel.elements) {
|
||||||
Transform new_anchor;
|
|
||||||
if (!matchedStatic.ContainsKey(r.Value)) continue;
|
|
||||||
if (!r.Key.IsUpdatable(context)) continue;
|
if (!r.Key.IsUpdatable(context)) continue;
|
||||||
new_anchor = r.Key.MatchDynamic(
|
var new_anchor = r.Key.MatchDynamic(context, anchor);
|
||||||
context, r.Value, matchedStatic[r.Value], anchor
|
|
||||||
);
|
|
||||||
if (new_anchor != null) {
|
if (new_anchor != null) {
|
||||||
MatchDynamic(r.Value, context, new_anchor);
|
MatchDynamic(r.Value, context, new_anchor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PdtOperator GetPropOp(Transform obj, SkinPropertyKey key) {
|
SkinProperty GetPropOp(Transform obj, SkinPropertyKey key) {
|
||||||
var ctype = key.Component;
|
var ctype = key.Component;
|
||||||
var comp = (SkinComponent)obj.GetComponent(ctype);
|
var comp = (SkinComponent)obj.GetComponent(ctype);
|
||||||
if (comp == null) throw new InvalidOperationException("Component instance not found");
|
if (comp == null) throw new InvalidOperationException("Component instance not found");
|
||||||
PdtOperator result;
|
SkinProperty result;
|
||||||
if (!comp.PropOps.TryGetValue(key.Name, out result))
|
if (!comp.Properties.TryGetValue(key.Name, out result))
|
||||||
throw new ArgumentException(string.Format("Property {0} not found on component", key.Name));
|
throw new ArgumentException(string.Format("Property {0} not found on component", key.Name));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,7 @@ using Cryville.Crtr.Event;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr {
|
||||||
@@ -34,7 +35,15 @@ namespace Cryville.Crtr {
|
|||||||
selectors[i].Optimize(etor);
|
selectors[i].Optimize(etor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public Transform MatchStatic(ContainerState h, Transform anchor = null) {
|
public bool IsStatic {
|
||||||
|
get {
|
||||||
|
foreach (var s in selectors) {
|
||||||
|
if (!s.IsStatic) return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Transform MatchStatic(ContainerState h, Transform anchor) {
|
||||||
foreach (var s in selectors) {
|
foreach (var s in selectors) {
|
||||||
anchor = s.Match(h, anchor);
|
anchor = s.Match(h, anchor);
|
||||||
if (anchor == null) return null;
|
if (anchor == null) return null;
|
||||||
@@ -46,10 +55,9 @@ namespace Cryville.Crtr {
|
|||||||
if (!s.IsUpdatable(h)) return false;
|
if (!s.IsUpdatable(h)) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public Transform MatchDynamic(ContainerState h, SkinElement e, Transform old_target, Transform anchor = null) {
|
public Transform MatchDynamic(ContainerState h, Transform anchor) {
|
||||||
if (!e.IsDynamic) return null;
|
|
||||||
foreach (var s in selectors) {
|
foreach (var s in selectors) {
|
||||||
anchor = s.Match(h, anchor, old_target);
|
anchor = s.Match(h, anchor, true);
|
||||||
if (anchor == null) return null;
|
if (anchor == null) return null;
|
||||||
}
|
}
|
||||||
return anchor;
|
return anchor;
|
||||||
@@ -62,7 +70,7 @@ namespace Cryville.Crtr {
|
|||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
public virtual void Optimize(PdtEvaluatorBase etor) { }
|
public virtual void Optimize(PdtEvaluatorBase etor) { }
|
||||||
public abstract Transform Match(ContainerState h, Transform a, Transform ot = null);
|
public abstract Transform Match(ContainerState h, Transform a, bool dyn = false);
|
||||||
public virtual bool IsUpdatable(ContainerState h) {
|
public virtual bool IsUpdatable(ContainerState h) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -71,12 +79,9 @@ namespace Cryville.Crtr {
|
|||||||
public override bool IsStatic {
|
public override bool IsStatic {
|
||||||
get { return true; }
|
get { return true; }
|
||||||
}
|
}
|
||||||
public override Transform Match(ContainerState h, Transform a, Transform ot = null) {
|
public override Transform Match(ContainerState h, Transform a, bool dyn = false) {
|
||||||
if (ot != null)
|
if (dyn) throw new InvalidOperationException("Object creation in dynamic context is not allowed");
|
||||||
return ot;
|
var obj = new GameObject("__obj__");
|
||||||
var obj = new GameObject {
|
|
||||||
name = "__obj__"
|
|
||||||
};
|
|
||||||
obj.transform.SetParent(a, false);
|
obj.transform.SetParent(a, false);
|
||||||
obj.AddComponent<TransformInterface>();
|
obj.AddComponent<TransformInterface>();
|
||||||
return obj.transform;
|
return obj.transform;
|
||||||
@@ -91,7 +96,7 @@ namespace Cryville.Crtr {
|
|||||||
get { return true; }
|
get { return true; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Transform Match(ContainerState h, Transform a, Transform ot = null) {
|
public override Transform Match(ContainerState h, Transform a, bool dyn = false) {
|
||||||
return h.Handler.Anchors[Name].Transform;
|
return h.Handler.Anchors[Name].Transform;
|
||||||
}
|
}
|
||||||
public override bool IsUpdatable(ContainerState h) {
|
public override bool IsUpdatable(ContainerState h) {
|
||||||
@@ -110,23 +115,28 @@ namespace Cryville.Crtr {
|
|||||||
etor.Optimize(_exp);
|
etor.Optimize(_exp);
|
||||||
}
|
}
|
||||||
public override bool IsStatic {
|
public override bool IsStatic {
|
||||||
get { throw new NotImplementedException(); }
|
get { return _exp.IsConstant; }
|
||||||
}
|
}
|
||||||
public override Transform Match(ContainerState h, Transform a, Transform ot = null) {
|
public override Transform Match(ContainerState h, Transform a, bool dyn = false) {
|
||||||
ChartPlayer.etor.ContextTransform = a;
|
ChartPlayer.etor.ContextTransform = a;
|
||||||
ChartPlayer.etor.ContextEvent = h.Container;
|
try {
|
||||||
ChartPlayer.etor.Evaluate(_op, _exp);
|
ChartPlayer.etor.Evaluate(_op, _exp);
|
||||||
ChartPlayer.etor.ContextEvent = null;
|
|
||||||
ChartPlayer.etor.ContextTransform = null;
|
|
||||||
return _flag ? a : null;
|
return _flag ? a : null;
|
||||||
}
|
}
|
||||||
|
catch (Exception) {
|
||||||
|
throw new SelectorNotStaticException();
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
ChartPlayer.etor.ContextTransform = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public class State : SkinSelector {
|
public class State : SkinSelector {
|
||||||
public State(string state) { }
|
public State(string state) { }
|
||||||
public override bool IsStatic {
|
public override bool IsStatic {
|
||||||
get { return false; }
|
get { return false; }
|
||||||
}
|
}
|
||||||
public override Transform Match(ContainerState h, Transform a, Transform ot = null) {
|
public override Transform Match(ContainerState h, Transform a, bool dyn = false) {
|
||||||
return null; // TODO
|
return null; // TODO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -136,9 +146,15 @@ namespace Cryville.Crtr {
|
|||||||
public override bool IsStatic {
|
public override bool IsStatic {
|
||||||
get { return true; }
|
get { return true; }
|
||||||
}
|
}
|
||||||
public override Transform Match(ContainerState h, Transform a, Transform ot = null) {
|
public override Transform Match(ContainerState h, Transform a, bool dyn = false) {
|
||||||
return h.Handler.TypeName == _type ? a : null;
|
return h.Handler.TypeName == _type ? a : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public class SelectorNotStaticException : Exception {
|
||||||
|
public SelectorNotStaticException() : base("The selector is not static") { }
|
||||||
|
public SelectorNotStaticException(string message) : base(message) { }
|
||||||
|
public SelectorNotStaticException(string message, Exception innerException) : base(message, innerException) { }
|
||||||
|
protected SelectorNotStaticException(SerializationInfo info, StreamingContext context) : base(info, context) { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
109
Assets/Cryville/Crtr/SpriteFrame.cs
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Cryville.Crtr {
|
||||||
|
public class SpriteFrame {
|
||||||
|
#pragma warning disable IDE1006
|
||||||
|
Rect _frame;
|
||||||
|
public Rect frame {
|
||||||
|
get { return _frame; }
|
||||||
|
set { _frame = value; }
|
||||||
|
}
|
||||||
|
public Rect textureRect {
|
||||||
|
get { return _frame; }
|
||||||
|
set { _frame = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _rotated = false;
|
||||||
|
public bool rotated {
|
||||||
|
get { return _rotated; }
|
||||||
|
set { _rotated = value; }
|
||||||
|
}
|
||||||
|
public bool textureRotated {
|
||||||
|
get { return _rotated; }
|
||||||
|
set { _rotated = value; }
|
||||||
|
}
|
||||||
|
#pragma warning restore IDE1006
|
||||||
|
|
||||||
|
public Vector2 offset;
|
||||||
|
|
||||||
|
public Rect sourceColorRect;
|
||||||
|
public Vector2 sourceSize;
|
||||||
|
private Rect _uv;
|
||||||
|
private Vector2[] cuv;
|
||||||
|
public Rect UV {
|
||||||
|
get {
|
||||||
|
return _uv;
|
||||||
|
}
|
||||||
|
private set {
|
||||||
|
_uv = value;
|
||||||
|
float x0 = Mathf.Min(_uv.xMin, _uv.xMax);
|
||||||
|
float x1 = Mathf.Max(_uv.xMin, _uv.xMax);
|
||||||
|
float y0 = Mathf.Min(_uv.yMin, _uv.yMax);
|
||||||
|
float y1 = Mathf.Max(_uv.yMin, _uv.yMax);
|
||||||
|
if (_rotated) cuv = new Vector2[]{
|
||||||
|
new Vector2(x0, y1),
|
||||||
|
new Vector2(x1, y0),
|
||||||
|
new Vector2(x0, y0),
|
||||||
|
new Vector2(x1, y1),
|
||||||
|
};
|
||||||
|
else cuv = new Vector2[]{
|
||||||
|
new Vector2(x0, y0),
|
||||||
|
new Vector2(x1, y1),
|
||||||
|
new Vector2(x1, y0),
|
||||||
|
new Vector2(x0, y1),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Vector2 GetUV(Vector2 uv) {
|
||||||
|
return GetUV(uv.x, uv.y);
|
||||||
|
}
|
||||||
|
public Vector2 GetUV(float u, float v) {
|
||||||
|
Vector2 uv00 = cuv[0], uv11 = cuv[1],
|
||||||
|
uv10 = cuv[2], uv01 = cuv[3];
|
||||||
|
return (1 - u - v) * uv00
|
||||||
|
+ u * uv10
|
||||||
|
+ v * uv01
|
||||||
|
+ u * v * (uv00 + uv11 - uv10 - uv01);
|
||||||
|
}
|
||||||
|
public Texture2D Texture {
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
|
public Vector2 Size {
|
||||||
|
get {
|
||||||
|
return new Vector2(Texture.width, Texture.height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Init() {
|
||||||
|
if (Texture == null)
|
||||||
|
throw new InvalidOperationException("Missing texture");
|
||||||
|
_frame = new Rect(Vector2.zero, Size);
|
||||||
|
var w = _frame.width;
|
||||||
|
var h = _frame.height;
|
||||||
|
float x = _frame.x / w;
|
||||||
|
float y = 1 - _frame.y / h;
|
||||||
|
float tw = (_rotated ? _frame.height : _frame.width) / w;
|
||||||
|
float th = (_rotated ? _frame.width : _frame.height) / h;
|
||||||
|
if (_rotated) UV = new Rect(x, y, tw, -th);
|
||||||
|
else UV = new Rect(x, y, tw, -th);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Init(int w, int h, Texture2D _base) {
|
||||||
|
if (Texture != null)
|
||||||
|
throw new InvalidOperationException("Missing texture");
|
||||||
|
Texture = _base;
|
||||||
|
float x = _frame.x / w;
|
||||||
|
float y = 1 - _frame.y / h;
|
||||||
|
float tw = (_rotated ? _frame.height : _frame.width) / w;
|
||||||
|
float th = (_rotated ? _frame.width : _frame.height) / h;
|
||||||
|
if (_rotated) UV = new Rect(x, y, tw, -th);
|
||||||
|
else UV = new Rect(x, y, tw, -th);
|
||||||
|
}
|
||||||
|
public SpriteFrame() { }
|
||||||
|
public SpriteFrame(Texture2D tex) {
|
||||||
|
Texture = tex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -43,7 +43,7 @@ namespace Cryville.Crtr {
|
|||||||
public override int Priority {
|
public override int Priority {
|
||||||
get { return StartEvent == null ? 4 : 6; }
|
get { return StartEvent == null ? 4 : 6; }
|
||||||
}
|
}
|
||||||
protected override int cmpExtra(StampedEvent other) {
|
protected override int CompareExtra(StampedEvent other) {
|
||||||
return Equals(StartEvent, other) ? 1 : 0;
|
return Equals(StartEvent, other) ? 1 : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -75,12 +75,12 @@ namespace Cryville.Crtr {
|
|||||||
if (u != 0) return u;
|
if (u != 0) return u;
|
||||||
u = this.Duration.CompareTo(other.Duration);
|
u = this.Duration.CompareTo(other.Duration);
|
||||||
if (u != 0) return u;
|
if (u != 0) return u;
|
||||||
u = cmpExtra(other);
|
u = CompareExtra(other);
|
||||||
if (u != 0) return u;
|
if (u != 0) return u;
|
||||||
return GetHashCode().CompareTo(other.GetHashCode());
|
return GetHashCode().CompareTo(other.GetHashCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual int cmpExtra(StampedEvent other) {
|
protected virtual int CompareExtra(StampedEvent other) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,7 @@ using System.Diagnostics.CodeAnalysis;
|
|||||||
[assembly: SuppressMessage("Style", "IDE0020")]
|
[assembly: SuppressMessage("Style", "IDE0020")]
|
||||||
[assembly: SuppressMessage("Style", "IDE0038")]
|
[assembly: SuppressMessage("Style", "IDE0038")]
|
||||||
[assembly: SuppressMessage("Style", "IDE0018")]
|
[assembly: SuppressMessage("Style", "IDE0018")]
|
||||||
|
[assembly: SuppressMessage("Style", "IDE0019")]
|
||||||
|
|
||||||
// Null operators not supported
|
// Null operators not supported
|
||||||
[assembly: SuppressMessage("Style", "IDE0016")]
|
[assembly: SuppressMessage("Style", "IDE0016")]
|
||||||
@@ -40,3 +41,6 @@ using System.Diagnostics.CodeAnalysis;
|
|||||||
|
|
||||||
// Local function not supported
|
// Local function not supported
|
||||||
[assembly: SuppressMessage("Style", "IDE0039")]
|
[assembly: SuppressMessage("Style", "IDE0039")]
|
||||||
|
|
||||||
|
// Readonly struct not supported
|
||||||
|
[assembly: SuppressMessage("Style", "IDE0250")]
|
||||||
|
Before Width: | Height: | Size: 625 B After Width: | Height: | Size: 705 B |
@@ -67,16 +67,16 @@ TextureImporter:
|
|||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 1024
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 1
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -88,7 +88,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -100,7 +100,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Server
|
buildTarget: Server
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -112,7 +112,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
Before Width: | Height: | Size: 567 B After Width: | Height: | Size: 629 B |
@@ -67,16 +67,16 @@ TextureImporter:
|
|||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 1024
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 1
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -88,7 +88,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -100,7 +100,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Server
|
buildTarget: Server
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -112,7 +112,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
@@ -3,7 +3,7 @@ guid: 3b0f4d3ea575f0b4493f280f4886a2ab
|
|||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 11
|
serializedVersion: 12
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 0
|
enableMipMap: 0
|
||||||
@@ -63,19 +63,20 @@ TextureImporter:
|
|||||||
textureFormatSet: 0
|
textureFormatSet: 0
|
||||||
ignorePngGamma: 0
|
ignorePngGamma: 0
|
||||||
applyGammaDecoding: 1
|
applyGammaDecoding: 1
|
||||||
|
cookieLightType: 1
|
||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 1024
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 1
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -87,7 +88,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -99,7 +100,19 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.8 KiB |
@@ -3,7 +3,7 @@ guid: 9441fbd3981d6f64dab5212300af7c4a
|
|||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 11
|
serializedVersion: 12
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 0
|
enableMipMap: 0
|
||||||
@@ -63,19 +63,20 @@ TextureImporter:
|
|||||||
textureFormatSet: 0
|
textureFormatSet: 0
|
||||||
ignorePngGamma: 0
|
ignorePngGamma: 0
|
||||||
applyGammaDecoding: 1
|
applyGammaDecoding: 1
|
||||||
|
cookieLightType: 1
|
||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 1024
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 1
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -87,7 +88,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -99,7 +100,19 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 12 KiB |
@@ -3,7 +3,7 @@ guid: 25ce690763945dc478d042ecad84ed73
|
|||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 11
|
serializedVersion: 12
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 0
|
enableMipMap: 0
|
||||||
@@ -63,19 +63,20 @@ TextureImporter:
|
|||||||
textureFormatSet: 0
|
textureFormatSet: 0
|
||||||
ignorePngGamma: 0
|
ignorePngGamma: 0
|
||||||
applyGammaDecoding: 1
|
applyGammaDecoding: 1
|
||||||
|
cookieLightType: 1
|
||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 1024
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 1
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -87,7 +88,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -99,7 +100,19 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 6.4 KiB |
@@ -3,7 +3,7 @@ guid: a22e5dbdac0ef3c4da3ef7ff616d785d
|
|||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 11
|
serializedVersion: 12
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 0
|
enableMipMap: 0
|
||||||
@@ -63,19 +63,20 @@ TextureImporter:
|
|||||||
textureFormatSet: 0
|
textureFormatSet: 0
|
||||||
ignorePngGamma: 0
|
ignorePngGamma: 0
|
||||||
applyGammaDecoding: 1
|
applyGammaDecoding: 1
|
||||||
|
cookieLightType: 1
|
||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 1024
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 1
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -87,7 +88,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -99,7 +100,19 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
Before Width: | Height: | Size: 550 B After Width: | Height: | Size: 574 B |
@@ -3,7 +3,7 @@ guid: 93413c93ff38c29489df01d9e1a045f4
|
|||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 11
|
serializedVersion: 12
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 0
|
enableMipMap: 0
|
||||||
@@ -63,19 +63,20 @@ TextureImporter:
|
|||||||
textureFormatSet: 0
|
textureFormatSet: 0
|
||||||
ignorePngGamma: 0
|
ignorePngGamma: 0
|
||||||
applyGammaDecoding: 1
|
applyGammaDecoding: 1
|
||||||
|
cookieLightType: 1
|
||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 1024
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 1
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -87,7 +88,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -99,7 +100,19 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
@@ -3,7 +3,7 @@ guid: 214b3d683e5be1c488a63a9b86930b60
|
|||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 11
|
serializedVersion: 12
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 0
|
enableMipMap: 0
|
||||||
@@ -63,19 +63,20 @@ TextureImporter:
|
|||||||
textureFormatSet: 0
|
textureFormatSet: 0
|
||||||
ignorePngGamma: 0
|
ignorePngGamma: 0
|
||||||
applyGammaDecoding: 1
|
applyGammaDecoding: 1
|
||||||
|
cookieLightType: 1
|
||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 1024
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 1
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -87,7 +88,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -99,7 +100,19 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 8.1 KiB |
@@ -3,7 +3,7 @@ guid: 4470ebf3375d8c34cac280ecb5e7fe0d
|
|||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 11
|
serializedVersion: 12
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 0
|
enableMipMap: 0
|
||||||
@@ -63,19 +63,20 @@ TextureImporter:
|
|||||||
textureFormatSet: 0
|
textureFormatSet: 0
|
||||||
ignorePngGamma: 0
|
ignorePngGamma: 0
|
||||||
applyGammaDecoding: 1
|
applyGammaDecoding: 1
|
||||||
|
cookieLightType: 1
|
||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 1024
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 1
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -87,7 +88,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -99,7 +100,19 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.6 KiB |
@@ -3,7 +3,7 @@ guid: e851c75e51ee5c544beb402d46c3c870
|
|||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 11
|
serializedVersion: 12
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 0
|
enableMipMap: 0
|
||||||
@@ -63,19 +63,20 @@ TextureImporter:
|
|||||||
textureFormatSet: 0
|
textureFormatSet: 0
|
||||||
ignorePngGamma: 0
|
ignorePngGamma: 0
|
||||||
applyGammaDecoding: 1
|
applyGammaDecoding: 1
|
||||||
|
cookieLightType: 1
|
||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 1024
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 1
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -87,7 +88,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -99,7 +100,19 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -3,7 +3,7 @@ guid: 42bbcfc892cd2a24a989c925389c2160
|
|||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 11
|
serializedVersion: 12
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 0
|
enableMipMap: 0
|
||||||
@@ -63,19 +63,20 @@ TextureImporter:
|
|||||||
textureFormatSet: 0
|
textureFormatSet: 0
|
||||||
ignorePngGamma: 0
|
ignorePngGamma: 0
|
||||||
applyGammaDecoding: 1
|
applyGammaDecoding: 1
|
||||||
|
cookieLightType: 1
|
||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 1024
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 1
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -87,7 +88,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -99,7 +100,19 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 368 B |
@@ -3,7 +3,7 @@ guid: faee4ec2120f8a142b33d1a2956c39ca
|
|||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 11
|
serializedVersion: 12
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 0
|
enableMipMap: 0
|
||||||
@@ -63,19 +63,20 @@ TextureImporter:
|
|||||||
textureFormatSet: 0
|
textureFormatSet: 0
|
||||||
ignorePngGamma: 0
|
ignorePngGamma: 0
|
||||||
applyGammaDecoding: 1
|
applyGammaDecoding: 1
|
||||||
|
cookieLightType: 1
|
||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 1024
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 1
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -87,7 +88,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -99,7 +100,19 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -3,7 +3,7 @@ guid: 6c494e6330a696246aca99abe95d0d9e
|
|||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 11
|
serializedVersion: 12
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 0
|
enableMipMap: 0
|
||||||
@@ -63,19 +63,20 @@ TextureImporter:
|
|||||||
textureFormatSet: 0
|
textureFormatSet: 0
|
||||||
ignorePngGamma: 0
|
ignorePngGamma: 0
|
||||||
applyGammaDecoding: 1
|
applyGammaDecoding: 1
|
||||||
|
cookieLightType: 1
|
||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 1024
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 1
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -87,7 +88,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -99,7 +100,19 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
@@ -3,7 +3,7 @@ guid: 15cf38e3a4deaec4cb102518f1ec7bf9
|
|||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 11
|
serializedVersion: 12
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 0
|
enableMipMap: 0
|
||||||
@@ -63,19 +63,20 @@ TextureImporter:
|
|||||||
textureFormatSet: 0
|
textureFormatSet: 0
|
||||||
ignorePngGamma: 0
|
ignorePngGamma: 0
|
||||||
applyGammaDecoding: 1
|
applyGammaDecoding: 1
|
||||||
|
cookieLightType: 1
|
||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 1024
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 1
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -87,7 +88,7 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
@@ -99,7 +100,19 @@ TextureImporter:
|
|||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 4.0 KiB |