Compare commits
93 Commits
0.6.0-rc2
...
dev-extens
| Author | SHA1 | Date | |
|---|---|---|---|
| 054b17811d | |||
| 94d5f7f82e | |||
| 0e4445e52b | |||
| ed2c216cf4 | |||
| 609645c108 | |||
| d280d27a0a | |||
| 5b727065f3 | |||
| 7aa2577059 | |||
| c1b7e9ab55 | |||
| 99384397ed | |||
| a2391aeb22 | |||
| 2207c80951 | |||
| bf578d7cb9 | |||
| 0bc57c368f | |||
| b64f85aaa2 | |||
| 93fa2f2d7e | |||
| d72216de8b | |||
| df5133a91a | |||
| 88b959a118 | |||
| 310bf91fbd | |||
| 699f47f98d | |||
| 24e881b138 | |||
| 2eef1b5c4e | |||
| c18ceb50d4 | |||
| 27ca1a7292 | |||
| dc59176eac | |||
| aec7470ff8 | |||
| 983cba6843 | |||
| 871782e73f | |||
| 9aaa96fe10 | |||
| 22190a29c1 | |||
| 613ca467d0 | |||
| 536a3066b2 | |||
| 43488cd002 | |||
| a11ccbd39c | |||
| 76df4929a7 | |||
| 505b826627 | |||
| 26a8675922 | |||
| b89e1f983e | |||
| 717e77b47e | |||
| 2f10c79dee | |||
| 55f7790f89 | |||
| ae5f4a8c16 | |||
| 1851bd3c54 | |||
| 6d74685cb7 | |||
| 03fd7f6d01 | |||
| 28c878f3e5 | |||
| 7736eba14d | |||
| 2e54b38d2b | |||
| da60dc0903 | |||
| 215f72b3b5 | |||
| a93c081dd8 | |||
| 456782930a | |||
| ba3cbbd64c | |||
| dfc3e9ca06 | |||
| f567a2b78e | |||
| c7e7bd8a77 | |||
| 67720fd0e1 | |||
| 1a30149942 | |||
| a755cc13bd | |||
| 9a51cf1b56 | |||
| 256c656e9c | |||
| 2ac7f05316 | |||
| 28d46dbabe | |||
| 18b3e0bc84 | |||
| 23f2e7c1f2 | |||
| 998713b41f | |||
| 3561354231 | |||
| 0cccb170c1 | |||
| d2480b8a6f | |||
| 6837d3f7ee | |||
| 3ecf3b4bfc | |||
| 1da8647ff1 | |||
| 2f19e8daad | |||
| 07f62c7aeb | |||
| 39db8dfa45 | |||
| f04cd370f1 | |||
| 5c4acd54ce | |||
| 82dbc5c479 | |||
| 1f1663d714 | |||
| a3c5392caa | |||
| 6c983cc2cb | |||
| 3bf3fdac3d | |||
| f2f3dba098 | |||
| 3728360dd2 | |||
| 887837bb3d | |||
| 99b4c2dfc1 | |||
| e59769158a | |||
| ba3238614b | |||
| a115999aab | |||
| 393947db9f | |||
| e9b2a7f894 | |||
| 9c73455761 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -68,3 +68,4 @@ crashlytics-build.properties
|
|||||||
/UserSettings
|
/UserSettings
|
||||||
/*.zip
|
/*.zip
|
||||||
*.lnk
|
*.lnk
|
||||||
|
/HybridCLRData
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 5335612e48e4c3947808c99fb99411d5
|
guid: c4ef48e4a4983de4e9c31483df2a918e
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 6823ead66b33bc048bbad48719feb25d
|
guid: 9ec674235c0dd6744af2dab2b58dd53c
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
8
Assets/Cryville/Common/Collections/Generic/IPairList.cs
Normal file
8
Assets/Cryville/Common/Collections/Generic/IPairList.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Cryville.Common.Collections.Generic {
|
||||||
|
public interface IPairList<TKey, TValue> : IList<KeyValuePair<TKey, TValue>> {
|
||||||
|
void Add(TKey key, TValue value);
|
||||||
|
void Insert(int index, TKey key, TValue value);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: f5b3f3294f679f14f8ec1195b0def630
|
guid: 73fb17b484b343242bcce27c15ed7d44
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
46
Assets/Cryville/Common/Collections/Generic/PairCollection.cs
Normal file
46
Assets/Cryville/Common/Collections/Generic/PairCollection.cs
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
|
namespace Cryville.Common.Collections.Generic {
|
||||||
|
[DebuggerDisplay("Count = {Count}"), DebuggerTypeProxy(typeof(PairCollectionDebugView<,>))]
|
||||||
|
public struct PairCollection<TKey, TValue> : IDisposable {
|
||||||
|
public void Dispose() { }
|
||||||
|
readonly IPairList<TKey, TValue> _pairList;
|
||||||
|
readonly IDictionary<TKey, TValue> _dictionary;
|
||||||
|
public PairCollection(object collection) : this() {
|
||||||
|
var type = collection.GetType();
|
||||||
|
if (typeof(IPairList<TKey, TValue>).IsAssignableFrom(type)) _pairList = (IPairList<TKey, TValue>)collection;
|
||||||
|
else if (typeof(IDictionary<TKey, TValue>).IsAssignableFrom(type)) _dictionary = (IDictionary<TKey, TValue>)collection;
|
||||||
|
else throw new ArgumentException("Parameter is not a pair collection");
|
||||||
|
}
|
||||||
|
public int Count {
|
||||||
|
get {
|
||||||
|
if (_pairList != null) return _pairList.Count;
|
||||||
|
else return _dictionary.Count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void Add(TKey key, TValue value) {
|
||||||
|
if (_pairList != null) _pairList.Add(key, value);
|
||||||
|
else _dictionary.Add(key, value);
|
||||||
|
}
|
||||||
|
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int index) {
|
||||||
|
if (_pairList != null) _pairList.CopyTo(array, index);
|
||||||
|
else _dictionary.CopyTo(array, index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
internal class PairCollectionDebugView<TKey, TValue> {
|
||||||
|
readonly PairCollection<TKey, TValue> _self;
|
||||||
|
public PairCollectionDebugView(PairCollection<TKey, TValue> self) {
|
||||||
|
_self = self;
|
||||||
|
}
|
||||||
|
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
|
||||||
|
public KeyValuePair<TKey, TValue>[] Items {
|
||||||
|
get {
|
||||||
|
KeyValuePair<TKey, TValue>[] array = new KeyValuePair<TKey, TValue>[_self.Count];
|
||||||
|
_self.CopyTo(array, 0);
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 23377bf2926d93a4b8e3f3ab6040c7f2
|
guid: 2517e8f040bd36f46948e5fafaf5335c
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
48
Assets/Cryville/Common/Collections/Generic/PairList.cs
Normal file
48
Assets/Cryville/Common/Collections/Generic/PairList.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
|
namespace Cryville.Common.Collections.Generic {
|
||||||
|
[DebuggerDisplay("Count = {Count}"), DebuggerTypeProxy(typeof(PairListDebugView<,>))]
|
||||||
|
public class PairList<TKey, TValue> : List<KeyValuePair<TKey, TValue>>, IPairList<TKey, TValue>, IPairList {
|
||||||
|
public void Add(TKey key, TValue value) {
|
||||||
|
Add(new KeyValuePair<TKey, TValue>(key, value));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Add(object key, object value) {
|
||||||
|
try {
|
||||||
|
Add((TKey)key, (TValue)value);
|
||||||
|
}
|
||||||
|
catch (InvalidCastException) {
|
||||||
|
throw new ArgumentException("Wrong key type or value type");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Insert(int index, TKey key, TValue value) {
|
||||||
|
Insert(index, new KeyValuePair<TKey, TValue>(key, value));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Insert(int index, object key, object value) {
|
||||||
|
try {
|
||||||
|
Insert(index, (TKey)key, (TValue)value);
|
||||||
|
}
|
||||||
|
catch (InvalidCastException) {
|
||||||
|
throw new ArgumentException("Wrong key type or value type");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
internal class PairListDebugView<TKey, TValue> {
|
||||||
|
readonly PairList<TKey, TValue> _self;
|
||||||
|
public PairListDebugView(PairList<TKey, TValue> self) {
|
||||||
|
_self = self;
|
||||||
|
}
|
||||||
|
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
|
||||||
|
public KeyValuePair<TKey, TValue>[] Items {
|
||||||
|
get {
|
||||||
|
KeyValuePair<TKey, TValue>[] array = new KeyValuePair<TKey, TValue>[_self.Count];
|
||||||
|
_self.CopyTo(array, 0);
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 4ffe72fef6ebb9e4da3571b4117f0d6d
|
guid: d9ed5ea8b7b1a934287e7ec5971166c0
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
8
Assets/Cryville/Common/Collections/IPairList.cs
Normal file
8
Assets/Cryville/Common/Collections/IPairList.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
namespace Cryville.Common.Collections {
|
||||||
|
public interface IPairList : IList {
|
||||||
|
void Add(object key, object value);
|
||||||
|
void Insert(int index, object key, object value);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: e3c5a8bf05d5e284ba498e91cb0dd35e
|
guid: 046617672d437de4ab7e644a55defd3b
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
47
Assets/Cryville/Common/Collections/PairCollection.cs
Normal file
47
Assets/Cryville/Common/Collections/PairCollection.cs
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
|
namespace Cryville.Common.Collections {
|
||||||
|
[DebuggerDisplay("Count = {Count}"), DebuggerTypeProxy(typeof(PairCollectionDebugView))]
|
||||||
|
public struct PairCollection : IDisposable {
|
||||||
|
public void Dispose() { }
|
||||||
|
readonly IPairList _pairList;
|
||||||
|
readonly IDictionary _dictionary;
|
||||||
|
public PairCollection(object collection) : this() {
|
||||||
|
var type = collection.GetType();
|
||||||
|
if (typeof(IPairList).IsAssignableFrom(type)) _pairList = (IPairList)collection;
|
||||||
|
else if (typeof(IDictionary).IsAssignableFrom(type)) _dictionary = (IDictionary)collection;
|
||||||
|
else throw new ArgumentException("Parameter is not a pair collection");
|
||||||
|
}
|
||||||
|
public int Count {
|
||||||
|
get {
|
||||||
|
if (_pairList != null) return _pairList.Count;
|
||||||
|
else return _dictionary.Count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void Add(object key, object value) {
|
||||||
|
if (_pairList != null) _pairList.Add(key, value);
|
||||||
|
else _dictionary.Add(key, value);
|
||||||
|
}
|
||||||
|
public void CopyTo(KeyValuePair<object, object>[] array, int index) {
|
||||||
|
if (_pairList != null) _pairList.CopyTo(array, index);
|
||||||
|
else _dictionary.CopyTo(array, index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
internal class PairCollectionDebugView {
|
||||||
|
readonly PairCollection _self;
|
||||||
|
public PairCollectionDebugView(PairCollection self) {
|
||||||
|
_self = self;
|
||||||
|
}
|
||||||
|
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
|
||||||
|
public KeyValuePair<object, object>[] Items {
|
||||||
|
get {
|
||||||
|
KeyValuePair<object, object>[] array = new KeyValuePair<object, object>[_self.Count];
|
||||||
|
_self.CopyTo(array, 0);
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Cryville/Common/Collections/PairCollection.cs.meta
Normal file
11
Assets/Cryville/Common/Collections/PairCollection.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1f87dfb8f6a1f5640b6deae741cd715c
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
29
Assets/Cryville/Common/Collections/PairList.cs
Normal file
29
Assets/Cryville/Common/Collections/PairList.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
|
namespace Cryville.Common.Collections {
|
||||||
|
[DebuggerDisplay("Count = {Count}"), DebuggerTypeProxy(typeof(PairListDebugView))]
|
||||||
|
public class PairList : List<KeyValuePair<object, object>>, IPairList {
|
||||||
|
public void Add(object key, object value) {
|
||||||
|
Add(new KeyValuePair<object, object>(key, value));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Insert(int index, object key, object value) {
|
||||||
|
Insert(index, new KeyValuePair<object, object>(key, value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
internal class PairListDebugView {
|
||||||
|
readonly PairList _self;
|
||||||
|
public PairListDebugView(PairList self) {
|
||||||
|
_self = self;
|
||||||
|
}
|
||||||
|
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
|
||||||
|
public KeyValuePair<object, object>[] Items {
|
||||||
|
get {
|
||||||
|
KeyValuePair<object, object>[] array = new KeyValuePair<object, object>[_self.Count];
|
||||||
|
_self.CopyTo(array, 0);
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Cryville/Common/Collections/PairList.cs.meta
Normal file
11
Assets/Cryville/Common/Collections/PairList.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 57fc9f037c1fda5449e2a365a835c82c
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -45,7 +45,7 @@ namespace Cryville.Common.Font {
|
|||||||
return tableDirectoryOffsets;
|
return tableDirectoryOffsets;
|
||||||
}
|
}
|
||||||
public override TableDirectory GetSubTable(UInt32 item) {
|
public override TableDirectory GetSubTable(UInt32 item) {
|
||||||
var i = (UInt32)item;
|
var i = item;
|
||||||
return new TableDirectory(Reader, i);
|
return new TableDirectory(Reader, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Cryville.Common {
|
namespace Cryville.Common {
|
||||||
public struct Identifier : IEquatable<Identifier> {
|
public struct Identifier : IEquatable<Identifier> {
|
||||||
|
public static Identifier Empty = new Identifier(0);
|
||||||
public int Key { get; private set; }
|
public int Key { get; private set; }
|
||||||
public object Name { get { return IdentifierManager.SharedInstance.Retrieve(Key); } }
|
public object Name { get { return IdentifierManager.SharedInstance.Retrieve(Key); } }
|
||||||
public Identifier(int key) {
|
public Identifier(int key) {
|
||||||
|
|||||||
44
Assets/Cryville/Common/Math/CubicBezier.cs
Normal file
44
Assets/Cryville/Common/Math/CubicBezier.cs
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
using SMath = System.Math;
|
||||||
|
|
||||||
|
namespace Cryville.Common.Math {
|
||||||
|
// Ported from https://github.com/arian/cubic-bezier/blob/master/index.js
|
||||||
|
public static class CubicBezier {
|
||||||
|
public static float Evaluate(float t, float x1, float y1, float x2, float y2, float epsilon) {
|
||||||
|
float x = t, t0, t1, t2, tx, d2, i;
|
||||||
|
for (t2 = x, i = 0; i < 8; i++) {
|
||||||
|
tx = CurveX(t2, x1, x2) - x;
|
||||||
|
if (SMath.Abs(tx) < epsilon) return CurveY(t2, y1, y2);
|
||||||
|
d2 = DerivativeCurveX(t2, x1, x2);
|
||||||
|
if (SMath.Abs(d2) < 1e-6) break;
|
||||||
|
t2 -= tx / d2;
|
||||||
|
}
|
||||||
|
|
||||||
|
t0 = 0; t1 = 1; t2 = x;
|
||||||
|
|
||||||
|
if (t2 < t0) return CurveY(t0, y1, y2);
|
||||||
|
if (t2 > t1) return CurveY(t1, y1, y2);
|
||||||
|
|
||||||
|
while (t0 < t1) {
|
||||||
|
tx = CurveX(t2, x1, x2);
|
||||||
|
if (SMath.Abs(tx - x) < epsilon) return CurveY(t2, y1, y2);
|
||||||
|
if (x > tx) t0 = t2;
|
||||||
|
else t1 = t2;
|
||||||
|
t2 = (t1 - t0) * .5f + t0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CurveY(t2, y1, y2);
|
||||||
|
}
|
||||||
|
static float CurveX(float t, float x1, float x2) {
|
||||||
|
float v = 1 - t;
|
||||||
|
return 3 * v * v * t * x1 + 3 * v * t * t * x2 + t * t * t;
|
||||||
|
}
|
||||||
|
static float CurveY(float t, float y1, float y2) {
|
||||||
|
float v = 1 - t;
|
||||||
|
return 3 * v * v * t * y1 + 3 * v * t * t * y2 + t * t * t;
|
||||||
|
}
|
||||||
|
static float DerivativeCurveX(float t, float x1, float x2) {
|
||||||
|
float v = 1 - t;
|
||||||
|
return 3 * (2 * (t - 1) * t + v * v) * x1 + 3 * (-t * t * t + 2 * v * t) * x2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Cryville/Common/Math/CubicBezier.cs.meta
Normal file
11
Assets/Cryville/Common/Math/CubicBezier.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 17dd6f775fc965f43960da7166b55b87
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -12,12 +12,12 @@ namespace Cryville.Common.Math {
|
|||||||
/// <param name="error">The error.</param>
|
/// <param name="error">The error.</param>
|
||||||
/// <param name="n">The numerator.</param>
|
/// <param name="n">The numerator.</param>
|
||||||
/// <param name="d">The denominator.</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>
|
/// <exception cref="ArgumentOutOfRangeException"><paramref name="value" /> is less than 0 or <paramref name="error" /> is not greater than 0 or greater than 1.</exception>
|
||||||
public static void ToFraction(double value, double error, out int n, out int d) {
|
public static void ToFraction(double value, double error, out int n, out int d) {
|
||||||
if (value < 0.0)
|
if (value < 0.0)
|
||||||
throw new ArgumentOutOfRangeException("value", "Must be >= 0.");
|
throw new ArgumentOutOfRangeException("value", "Must be >= 0.");
|
||||||
if (error <= 0.0 || error >= 1.0)
|
if (error <= 0.0 || error > 1.0)
|
||||||
throw new ArgumentOutOfRangeException("accuracy", "Must be > 0 and < 1.");
|
throw new ArgumentOutOfRangeException("error", "Must be > 0 and <= 1.");
|
||||||
|
|
||||||
int num = (int)System.Math.Floor(value);
|
int num = (int)System.Math.Floor(value);
|
||||||
value -= num;
|
value -= num;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace Cryville.Common.Pdt {
|
|||||||
/// Indicates that the attributed member is an element list.
|
/// Indicates that the attributed member is an element list.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// <para>An element list is a <see cref="System.Collections.IDictionary" /> that represents a collection of PDT elements. There must be at most one element list in a class.</para>
|
/// <para>An element list is a <see cref="System.Collections.IDictionary" /> or <see cref="Cryville.Common.Collections.Generic.IPairList" /> that represents a collection of PDT elements. There must be at most one element list in a class.</para>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
|
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
|
||||||
public class ElementListAttribute : Attribute { }
|
public class ElementListAttribute : Attribute { }
|
||||||
@@ -14,7 +14,7 @@ namespace Cryville.Common.Pdt {
|
|||||||
/// Indicates that the attributed member is a property list.
|
/// Indicates that the attributed member is a property list.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// <para>A property list is a <see cref="System.Collections.IDictionary" /> that represents a collection of PDT properties. There must be at most one property list in a class.</para>
|
/// <para>A property list is a <see cref="System.Collections.IDictionary" /> or <see cref="Cryville.Common.Collections.Generic.IPairList" /> that represents a collection of PDT properties. There must be at most one property list in a class.</para>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
|
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
|
||||||
public class PropertyListAttribute : Attribute { }
|
public class PropertyListAttribute : Attribute { }
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ namespace Cryville.Common.Pdt {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public partial class PdtInterpreter {
|
public partial class PdtInterpreter {
|
||||||
readonly static Dictionary<char, int> OP_PRIORITY = new Dictionary<char, int> {
|
static readonly Dictionary<char, int> OP_PRIORITY = new Dictionary<char, int> {
|
||||||
{ '@', 7 },
|
{ '@', 7 },
|
||||||
{ '*', 6 }, { '/', 6 }, { '%', 6 },
|
{ '*', 6 }, { '/', 6 }, { '%', 6 },
|
||||||
{ '+', 5 }, { '-', 5 },
|
{ '+', 5 }, { '-', 5 },
|
||||||
@@ -103,7 +103,7 @@ namespace Cryville.Common.Pdt {
|
|||||||
{ ',', 0 },
|
{ ',', 0 },
|
||||||
{ '$', -1 },
|
{ '$', -1 },
|
||||||
};
|
};
|
||||||
readonly static Dictionary<char, int> OP_TYPE = new Dictionary<char, int> {
|
static readonly Dictionary<char, int> OP_TYPE = new Dictionary<char, int> {
|
||||||
{ '@', 0 },
|
{ '@', 0 },
|
||||||
{ '*', 0 }, { '/', 0 }, { '%', 0 },
|
{ '*', 0 }, { '/', 0 }, { '%', 0 },
|
||||||
{ '+', 0 }, { '-', 0 },
|
{ '+', 0 }, { '-', 0 },
|
||||||
@@ -115,7 +115,7 @@ namespace Cryville.Common.Pdt {
|
|||||||
{ '$', -1 },
|
{ '$', -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly static PdtExpression _emptyexp;
|
static readonly PdtExpression _emptyexp;
|
||||||
static PdtInterpreter() {
|
static PdtInterpreter() {
|
||||||
var ins = new LinkedList<PdtInstruction>();
|
var ins = new LinkedList<PdtInstruction>();
|
||||||
ins.AddLast(new PdtInstruction.PushConstant(
|
ins.AddLast(new PdtInstruction.PushConstant(
|
||||||
@@ -143,7 +143,7 @@ namespace Cryville.Common.Pdt {
|
|||||||
public override string ToString() {
|
public override string ToString() {
|
||||||
return string.Format("0x{0:x4}: {1}", Type, Value);
|
return string.Format("0x{0:x4}: {1}", Type, Value);
|
||||||
}
|
}
|
||||||
public readonly static PdtExpToken EmptyOperator = new PdtExpToken {
|
public static readonly PdtExpToken EmptyOperator = new PdtExpToken {
|
||||||
Type = 0x0080,
|
Type = 0x0080,
|
||||||
Value = "$",
|
Value = "$",
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,30 +6,30 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Error type.
|
/// Error type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly static int Error = 0x00525245;
|
public const int Error = 0x00525245;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Array of a same variable-length type, with a suffix indicating the element count and the element type.
|
/// Array of a same variable-length type, with a suffix indicating the element count and the element type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly static int Array = 0x00525241;
|
public const int Array = 0x00525241;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Null type.
|
/// Null type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly static int Null = 0x4c4c554e;
|
public const int Null = 0x4c4c554e;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// IEEE 754 32-bit floating-point number.
|
/// IEEE 754 32-bit floating-point number.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly static int Number = 0x004d554e;
|
public const int Number = 0x004d554e;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A sequence of UTF-16 code units, with a prefix indicating the number of the code units.
|
/// A sequence of UTF-16 code units, with a prefix indicating the number of the code units.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly static int String = 0x00525453;
|
public const int String = 0x00525453;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A sequence of UTF-16 code units, with a prefix indicating the number of the code units, representing the name of an undefined variable.
|
/// A sequence of UTF-16 code units, with a prefix indicating the number of the code units, representing the name of an undefined variable.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly static int Undefined = 0x00444e55;
|
public const int Undefined = 0x00444e55;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Vector of a same constant-length type, with a suffix indicating the element type.
|
/// Vector of a same constant-length type, with a suffix indicating the element type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly static int Vector = 0x00434556;
|
public const int Vector = 0x00434556;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using Cryville.Common.Collections;
|
||||||
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -27,7 +28,7 @@ namespace Cryville.Common.Pdt {
|
|||||||
/// <item><term><c>0x1000</c></term><description>End of Key</description></item>
|
/// <item><term><c>0x1000</c></term><description>End of Key</description></item>
|
||||||
/// </list>
|
/// </list>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
readonly static int[] cm = new int[] {
|
static readonly int[] cm = new int[] {
|
||||||
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
|
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000,
|
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000,
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||||
@@ -255,13 +256,13 @@ namespace Cryville.Common.Pdt {
|
|||||||
if (prop == null) throw new MissingMemberException(string.Format("The property \"{0}\" is not found", pkey));
|
if (prop == null) throw new MissingMemberException(string.Format("The property \"{0}\" is not found", pkey));
|
||||||
Type ptype = ReflectionHelper.GetMemberType(prop);
|
Type ptype = ReflectionHelper.GetMemberType(prop);
|
||||||
if (flag) {
|
if (flag) {
|
||||||
if (!typeof(IDictionary).IsAssignableFrom(ptype))
|
using (var collection = new PairCollection(ReflectionHelper.GetValue(prop, result))) {
|
||||||
throw new InvalidOperationException("Internal error: Element list is not a dictionary");
|
var ktype = ptype.GetGenericArguments()[0];
|
||||||
var ktype = ptype.GetGenericArguments()[0];
|
var vtype = ptype.GetGenericArguments()[1];
|
||||||
var vtype = ptype.GetGenericArguments()[1];
|
object key = _binder.ChangeType(pkey, ktype, null);
|
||||||
object key = _binder.ChangeType(pkey, ktype, null);
|
object value = InterpretObject(vtype);
|
||||||
object value = InterpretObject(vtype);
|
collection.Add(key, value);
|
||||||
((IDictionary)ReflectionHelper.GetValue(prop, result)).Add(key, value);
|
}
|
||||||
}
|
}
|
||||||
else ReflectionHelper.SetValue(prop, result, InterpretObject(ptype));
|
else ReflectionHelper.SetValue(prop, result, InterpretObject(ptype));
|
||||||
}
|
}
|
||||||
@@ -284,13 +285,13 @@ namespace Cryville.Common.Pdt {
|
|||||||
if (prop == null) throw new MissingMemberException(string.Format("The property \"{0}\" is not found", pkey));
|
if (prop == null) throw new MissingMemberException(string.Format("The property \"{0}\" is not found", pkey));
|
||||||
var ptype = ReflectionHelper.GetMemberType(prop);
|
var ptype = ReflectionHelper.GetMemberType(prop);
|
||||||
if (flag) {
|
if (flag) {
|
||||||
if (!typeof(IDictionary).IsAssignableFrom(ptype))
|
using (var collection = new PairCollection(ReflectionHelper.GetValue(prop, result))) {
|
||||||
throw new InvalidOperationException("Internal error: Property list is not a dictionary");
|
var ktype = ptype.GetGenericArguments()[0];
|
||||||
var ktype = ptype.GetGenericArguments()[0];
|
var vtype = ptype.GetGenericArguments()[1];
|
||||||
var vtype = ptype.GetGenericArguments()[1];
|
object key = _binder.ChangeType(pkey, ktype, null);
|
||||||
object key = _binder.ChangeType(pkey, ktype, null);
|
object value = _binder.ChangeType(exp, vtype, null);
|
||||||
object value = _binder.ChangeType(exp, vtype, null);
|
collection.Add(key, value);
|
||||||
((IDictionary)ReflectionHelper.GetValue(prop, result)).Add(key, value);
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
object value = _binder.ChangeType(exp, ptype, null);
|
object value = _binder.ChangeType(exp, ptype, null);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ namespace Cryville.Common.Pdt {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// PDT operator.
|
/// PDT operator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public unsafe abstract class PdtOperator {
|
public abstract unsafe class PdtOperator {
|
||||||
byte* _prmem;
|
byte* _prmem;
|
||||||
int _loadindex;
|
int _loadindex;
|
||||||
readonly PdtVariableMemory[] _operands;
|
readonly PdtVariableMemory[] _operands;
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ namespace Cryville.Common.Unity {
|
|||||||
set { m_filter = value; }
|
set { m_filter = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dictionary<string, string> m_presetPaths = new Dictionary<string, string>();
|
public IReadOnlyDictionary<string, string> m_presetPaths = new Dictionary<string, string>();
|
||||||
public Dictionary<string, string> PresetPaths {
|
public IReadOnlyDictionary<string, string> PresetPaths {
|
||||||
get { return m_presetPaths; }
|
get { return m_presetPaths; }
|
||||||
set { m_presetPaths = value; }
|
set { m_presetPaths = value; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ using UnityEngine;
|
|||||||
namespace Cryville.Common.Unity.UI {
|
namespace Cryville.Common.Unity.UI {
|
||||||
public abstract class SetParameterBehaviour : StateMachineBehaviour {
|
public abstract class SetParameterBehaviour : StateMachineBehaviour {
|
||||||
[SerializeField] protected string m_name;
|
[SerializeField] protected string m_name;
|
||||||
public override abstract void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex);
|
public abstract override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Cryville.Crtr.Browsing {
|
|
||||||
public abstract class ExtensionInterface {
|
|
||||||
public abstract IEnumerable<ResourceConverter> GetResourceConverters();
|
|
||||||
public abstract IEnumerable<LocalResourceFinder> GetResourceFinders();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
138
Assets/Cryville/Crtr/Browsing/ExtensionManager.cs
Normal file
138
Assets/Cryville/Crtr/Browsing/ExtensionManager.cs
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
using Cryville.Common;
|
||||||
|
using Cryville.Crtr.Extension;
|
||||||
|
using Mono.Cecil;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace Cryville.Crtr.Browsing {
|
||||||
|
internal static class ExtensionManager {
|
||||||
|
static readonly Dictionary<string, List<ResourceConverter>> _converters
|
||||||
|
= new Dictionary<string, List<ResourceConverter>>();
|
||||||
|
public static IEnumerable<string> GetSupportedFormats() {
|
||||||
|
return _converters.Keys;
|
||||||
|
}
|
||||||
|
public static bool TryGetConverters(string extension, out IEnumerable<ResourceConverter> converters) {
|
||||||
|
List<ResourceConverter> outResult;
|
||||||
|
bool result = _converters.TryGetValue(extension, out outResult);
|
||||||
|
converters = outResult;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
static readonly Dictionary<string, string> _localRes
|
||||||
|
= new Dictionary<string, string>();
|
||||||
|
public static IReadOnlyDictionary<string, string> GetLocalResourcePaths() {
|
||||||
|
return _localRes;
|
||||||
|
}
|
||||||
|
public static void Init(string rootPath) {
|
||||||
|
LoadExtension(typeof(Extensions.Umg.Extension));
|
||||||
|
var asms = AppDomain.CurrentDomain.GetAssemblies().Select(a => a.GetName().Name).ToHashSet();
|
||||||
|
var modules = new Queue<ModuleItem>();
|
||||||
|
var extensionDir = new DirectoryInfo(Path.Combine(rootPath, "extensions"));
|
||||||
|
if (extensionDir.Exists) {
|
||||||
|
foreach (var extension in extensionDir.EnumerateFiles("*.dll")) {
|
||||||
|
try {
|
||||||
|
modules.Enqueue(new ModuleItem(extension.OpenRead()));
|
||||||
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
Logger.Log("main", 4, "Extension", "Failed to load DLL {0}: {1}", extension, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int refCounter = 0;
|
||||||
|
while (modules.Count > 0 && refCounter < modules.Count) {
|
||||||
|
var module = modules.Dequeue();
|
||||||
|
bool flag = false;
|
||||||
|
foreach (var reference in module.Definition.AssemblyReferences) {
|
||||||
|
if (!asms.Contains(reference.Name)) {
|
||||||
|
flag = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (flag) {
|
||||||
|
modules.Enqueue(module);
|
||||||
|
refCounter++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
try {
|
||||||
|
var stream = module.Stream;
|
||||||
|
stream.Seek(0, SeekOrigin.Begin);
|
||||||
|
var buf = new byte[stream.Length];
|
||||||
|
stream.Read(buf, 0, buf.Length);
|
||||||
|
var asm = Assembly.Load(buf);
|
||||||
|
if (asm == null) throw new TypeLoadException("Failed to load the module");
|
||||||
|
asms.Add(asm.GetName().Name);
|
||||||
|
foreach (var type in asm.GetTypes()) {
|
||||||
|
if (typeof(ExtensionInterface).IsAssignableFrom(type)) {
|
||||||
|
LoadExtension(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Logger.Log("main", 1, "Extension", "Loaded module {0}", module.Definition.Name);
|
||||||
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
Logger.Log("main", 4, "Extension", "An error occured while trying to load module {0}: {1}", module.Definition.Name, ex);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
module.Definition.Dispose();
|
||||||
|
module.Stream.Dispose();
|
||||||
|
refCounter = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var missingList = new List<string>();
|
||||||
|
while (modules.Count > 0) {
|
||||||
|
missingList.Clear();
|
||||||
|
var module = modules.Dequeue();
|
||||||
|
foreach (var reference in module.Definition.AssemblyReferences) {
|
||||||
|
if (!asms.Contains(reference.Name)) {
|
||||||
|
missingList.Add(reference.Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Logger.Log("main", 4, "Extension", "Could not load the module {0} because the following dependencies were missing: {1}", module.Definition.Name, missingList.Aggregate((current, next) => current + ", " + next));
|
||||||
|
module.Definition.Dispose();
|
||||||
|
module.Stream.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct ModuleItem {
|
||||||
|
public ModuleDefinition Definition { get; set; }
|
||||||
|
public FileStream Stream { get; set; }
|
||||||
|
public ModuleItem(FileStream stream) {
|
||||||
|
Stream = stream;
|
||||||
|
Definition = ModuleDefinition.ReadModule(stream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void LoadExtension(Type type) {
|
||||||
|
try {
|
||||||
|
var extension = (ExtensionInterface)Activator.CreateInstance(type);
|
||||||
|
var l1 = extension.GetResourceConverters();
|
||||||
|
if (l1 != null) {
|
||||||
|
foreach (var c in l1) {
|
||||||
|
var fs = c.GetSupportedFormats();
|
||||||
|
if (fs == null) continue;
|
||||||
|
foreach (var f in fs) {
|
||||||
|
if (f == null) continue;
|
||||||
|
if (!_converters.ContainsKey(f))
|
||||||
|
_converters.Add(f, new List<ResourceConverter> { c });
|
||||||
|
else _converters[f].Add(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var l2 = extension.GetResourceFinders();
|
||||||
|
if (l2 != null) {
|
||||||
|
foreach (var f in l2) {
|
||||||
|
var name = f.Name;
|
||||||
|
var path = f.GetRootPath();
|
||||||
|
if (name != null && path != null) _localRes.Add(name, path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Logger.Log("main", 1, "Extension", "Loaded extension {0}", type);
|
||||||
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
Logger.Log("main", 4, "Extension", "Failed to load extension {0}: {1}", type, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Cryville/Crtr/Browsing/ExtensionManager.cs.meta
Normal file
11
Assets/Cryville/Crtr/Browsing/ExtensionManager.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a9ea11165e6269b488f916982507a2af
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -12,6 +12,6 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
|
|
||||||
bool ImportItemFrom(string path);
|
bool ImportItemFrom(string path);
|
||||||
string[] GetSupportedFormats();
|
string[] GetSupportedFormats();
|
||||||
Dictionary<string, string> GetPresetPaths();
|
IReadOnlyDictionary<string, string> GetPresetPaths();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
using Cryville.Common.Unity;
|
using Cryville.Common.Unity;
|
||||||
|
using Cryville.Crtr.Extension;
|
||||||
|
using Cryville.Crtr.Extensions.Umg;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -15,49 +17,13 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
private DirectoryInfo[] items = new DirectoryInfo[0];
|
private DirectoryInfo[] items = new DirectoryInfo[0];
|
||||||
public string[] CurrentDirectory { get; private set; }
|
public string[] CurrentDirectory { get; private set; }
|
||||||
|
|
||||||
static readonly Dictionary<string, List<ResourceConverter>> converters
|
static bool _init;
|
||||||
= new Dictionary<string, List<ResourceConverter>>();
|
|
||||||
static readonly Dictionary<string, string> localRes
|
|
||||||
= new Dictionary<string, string>();
|
|
||||||
|
|
||||||
public LegacyResourceManager(string rootPath) {
|
public LegacyResourceManager(string rootPath) {
|
||||||
_rootPath = rootPath;
|
_rootPath = rootPath;
|
||||||
}
|
if (!_init) {
|
||||||
|
_init = true;
|
||||||
static LegacyResourceManager() {
|
ExtensionManager.Init(rootPath);
|
||||||
foreach (var asm in AppDomain.CurrentDomain.GetAssemblies()) {
|
|
||||||
foreach (var type in asm.GetTypes()) {
|
|
||||||
if (!type.IsSubclassOf(typeof(ExtensionInterface))) continue;
|
|
||||||
var ext = (ExtensionInterface)Activator.CreateInstance(type);
|
|
||||||
try {
|
|
||||||
var cs = ext.GetResourceConverters();
|
|
||||||
if (cs != null) {
|
|
||||||
foreach (var c in cs) {
|
|
||||||
var fs = c.GetSupportedFormats();
|
|
||||||
if (fs == null) continue;
|
|
||||||
foreach (var f in fs) {
|
|
||||||
if (f == null) continue;
|
|
||||||
if (!converters.ContainsKey(f))
|
|
||||||
converters.Add(f, new List<ResourceConverter> { c });
|
|
||||||
else converters[f].Add(c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var fs2 = ext.GetResourceFinders();
|
|
||||||
if (fs2 != null) {
|
|
||||||
foreach (var f in fs2) {
|
|
||||||
var name = f.Name;
|
|
||||||
var path = f.GetRootPath();
|
|
||||||
if (name != null && path != null)
|
|
||||||
localRes.Add(name, path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Logger.Log("main", 1, "Resource", "Loaded extension {0}", ReflectionHelper.GetNamespaceQualifiedName(type));
|
|
||||||
}
|
|
||||||
catch (Exception ex) {
|
|
||||||
Logger.Log("main", 4, "Resource", "Failed to initialize extension {0}: {1}", ReflectionHelper.GetNamespaceQualifiedName(type), ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,14 +115,15 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
|
|
||||||
public bool ImportItemFrom(string path) {
|
public bool ImportItemFrom(string path) {
|
||||||
var file = new FileInfo(path);
|
var file = new FileInfo(path);
|
||||||
if (!converters.ContainsKey(file.Extension)) return false;
|
IEnumerable<ResourceConverter> converters;
|
||||||
foreach (var converter in converters[file.Extension]) {
|
if (!ExtensionManager.TryGetConverters(file.Extension, out converters)) return false;
|
||||||
|
foreach (var converter in converters) {
|
||||||
IEnumerable<Resource> resources = null;
|
IEnumerable<Resource> resources = null;
|
||||||
try {
|
try {
|
||||||
resources = converter.ConvertFrom(file);
|
resources = converter.ConvertFrom(file);
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
LogAndPopup(4, ex.Message);
|
LogAndPopupExtra(4, ex, "Failed to import resource: {0}", ex.Message);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
foreach (var res in resources) {
|
foreach (var res in resources) {
|
||||||
@@ -168,7 +135,7 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
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 + "/.json")) {
|
using (var writer = new StreamWriter(dir.FullName + "/.json")) {
|
||||||
writer.Write(JsonConvert.SerializeObject(tres.Main, Game.GlobalJsonSerializerSettings));
|
writer.Write(JsonConvert.SerializeObject(ConvertChartData(tres.Main), Game.GlobalJsonSerializerSettings));
|
||||||
}
|
}
|
||||||
using (var writer = new StreamWriter(dir.FullName + "/.umgc")) {
|
using (var writer = new StreamWriter(dir.FullName + "/.umgc")) {
|
||||||
tres.Meta.data = "";
|
tres.Meta.data = "";
|
||||||
@@ -219,12 +186,89 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
Popup.Create(msg);
|
Popup.Create(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string[] GetSupportedFormats() {
|
void LogAndPopupExtra(int level, object extraLog, string format, params object[] args) {
|
||||||
return converters.Keys.ToArray();
|
var msg = string.Format(format, args);
|
||||||
|
Logger.Log("main", level, "Resource", "{0}\n{1}", msg, extraLog);
|
||||||
|
Popup.Create(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dictionary<string, string> GetPresetPaths() {
|
public string[] GetSupportedFormats() {
|
||||||
return localRes;
|
return ExtensionManager.GetSupportedFormats().ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public IReadOnlyDictionary<string, string> GetPresetPaths() {
|
||||||
|
return ExtensionManager.GetLocalResourcePaths();
|
||||||
|
}
|
||||||
|
|
||||||
|
static Chart ConvertChartData(ChartData i) {
|
||||||
|
return new Chart {
|
||||||
|
endtime = ConvertBeatTime(i.endtime),
|
||||||
|
format = i.format,
|
||||||
|
groups = ConvertGroups(i.groups),
|
||||||
|
motions = ConvertMotions(i.motions),
|
||||||
|
ruleset = i.ruleset,
|
||||||
|
sigs = ConvertSignatures(i.sigs),
|
||||||
|
sounds = ConvertSounds(i.sounds),
|
||||||
|
time = ConvertBeatTime(i.time),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
static BeatTime? ConvertBeatTime(Extension.BeatTime? value) {
|
||||||
|
if (value == null) return null;
|
||||||
|
return new BeatTime(value.Value.b, value.Value.n, value.Value.d);
|
||||||
|
}
|
||||||
|
static List<Chart.Group> ConvertGroups(List<ChartData.Group> l) {
|
||||||
|
return l.Select(i => new Chart.Group {
|
||||||
|
endtime = ConvertBeatTime(i.endtime),
|
||||||
|
motions = ConvertMotions(i.motions),
|
||||||
|
notes = ConvertNotes(i.notes),
|
||||||
|
time = ConvertBeatTime(i.time),
|
||||||
|
tracks = ConvertTracks(i.tracks),
|
||||||
|
}).ToList();
|
||||||
|
}
|
||||||
|
static List<Chart.Judge> ConvertJudges(List<ChartData.Judge> l) {
|
||||||
|
return l.Select(i => new Chart.Judge {
|
||||||
|
endtime = ConvertBeatTime(i.endtime),
|
||||||
|
name = i.name,
|
||||||
|
time = ConvertBeatTime(i.time),
|
||||||
|
}).ToList();
|
||||||
|
}
|
||||||
|
static List<Chart.Motion> ConvertMotions(List<ChartData.Motion> l) {
|
||||||
|
return l.Select(i => new Chart.Motion {
|
||||||
|
endtime = ConvertBeatTime(i.endtime),
|
||||||
|
motion = i.motion,
|
||||||
|
sumfix = i.sumfix,
|
||||||
|
time = ConvertBeatTime(i.time),
|
||||||
|
}).ToList();
|
||||||
|
}
|
||||||
|
static List<Chart.Note> ConvertNotes(List<ChartData.Note> l) {
|
||||||
|
return l.Select(i => new Chart.Note {
|
||||||
|
endtime = ConvertBeatTime(i.endtime),
|
||||||
|
judges = ConvertJudges(i.judges),
|
||||||
|
motions = ConvertMotions(i.motions),
|
||||||
|
time = ConvertBeatTime(i.time),
|
||||||
|
}).ToList();
|
||||||
|
}
|
||||||
|
static List<Chart.Signature> ConvertSignatures(List<ChartData.Signature> l) {
|
||||||
|
return l.Select(i => new Chart.Signature {
|
||||||
|
endtime = ConvertBeatTime(i.endtime),
|
||||||
|
tempo = i.tempo,
|
||||||
|
time = ConvertBeatTime(i.time),
|
||||||
|
}).ToList();
|
||||||
|
}
|
||||||
|
static List<Chart.Sound> ConvertSounds(List<ChartData.Sound> l) {
|
||||||
|
return l.Select(i => new Chart.Sound {
|
||||||
|
endtime = ConvertBeatTime(i.endtime),
|
||||||
|
id = i.id,
|
||||||
|
offset = i.offset,
|
||||||
|
time = ConvertBeatTime(i.time),
|
||||||
|
}).ToList();
|
||||||
|
}
|
||||||
|
static List<Chart.Track> ConvertTracks(List<ChartData.Track> l) {
|
||||||
|
return l.Select(i => new Chart.Track {
|
||||||
|
endtime = ConvertBeatTime(i.endtime),
|
||||||
|
motions = ConvertMotions(i.motions),
|
||||||
|
time = ConvertBeatTime(i.time),
|
||||||
|
}).ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
namespace Cryville.Crtr.Browsing {
|
|
||||||
public abstract class LocalResourceFinder {
|
|
||||||
public abstract string Name { get; }
|
|
||||||
public abstract string GetRootPath();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -9,11 +9,11 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
public override object Value {
|
public override object Value {
|
||||||
get {
|
get {
|
||||||
float s_value = GetDisplayValue();
|
float s_value = GetDisplayValue();
|
||||||
return IntegerMode ? (object)(int)s_value : (object)s_value;
|
return IntegerMode ? (int)s_value : (object)s_value;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if (value is double) m_value = (double)value;
|
if (value is double) m_value = (double)value;
|
||||||
else m_value = IntegerMode ? (double)(int)value : (double)(float)value;
|
else m_value = IntegerMode ? (int)value : (double)(float)value;
|
||||||
float s_value = GetDisplayValue();
|
float s_value = GetDisplayValue();
|
||||||
m_text.text = s_value.ToString();
|
m_text.text = s_value.ToString();
|
||||||
if (Range != null && MaxStep == 0) {
|
if (Range != null && MaxStep == 0) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
using Cryville.Common.Unity.UI;
|
using Cryville.Common.Unity.UI;
|
||||||
using Cryville.Crtr.Config;
|
using Cryville.Crtr.Config;
|
||||||
using Newtonsoft.Json;
|
using Cryville.Crtr.Extension;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
@@ -94,24 +94,4 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
public AsyncDelivery<Texture2D> Cover { get; set; }
|
public AsyncDelivery<Texture2D> Cover { get; set; }
|
||||||
public ChartMeta Meta { get; set; }
|
public ChartMeta Meta { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma warning disable IDE1006
|
|
||||||
public class MetaInfo {
|
|
||||||
public string name { get; set; }
|
|
||||||
public string author { 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 int note_count { get; set; }
|
|
||||||
public string cover { get; set; }
|
|
||||||
}
|
|
||||||
#pragma warning restore IDE1006
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,79 +0,0 @@
|
|||||||
using Cryville.Common;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace Cryville.Crtr.Browsing {
|
|
||||||
public abstract class ResourceConverter {
|
|
||||||
public abstract string[] GetSupportedFormats();
|
|
||||||
public abstract IEnumerable<Resource> ConvertFrom(FileInfo file);
|
|
||||||
}
|
|
||||||
public abstract class Resource {
|
|
||||||
protected Resource(string name) {
|
|
||||||
Name = StringUtils.EscapeFileName(name);
|
|
||||||
}
|
|
||||||
public string Name { get; private set; }
|
|
||||||
public abstract bool Valid { get; }
|
|
||||||
public override string ToString() {
|
|
||||||
return string.Format("{0} ({1})", Name, ReflectionHelper.GetSimpleName(GetType()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class RawChartResource : Resource {
|
|
||||||
public RawChartResource(string name, Chart main, ChartMeta meta) : base(name) {
|
|
||||||
Main = main; Meta = meta;
|
|
||||||
}
|
|
||||||
public Chart Main { get; private set; }
|
|
||||||
public ChartMeta Meta { get; private set; }
|
|
||||||
public override bool Valid { get { return true; } }
|
|
||||||
}
|
|
||||||
public abstract class FileResource : Resource {
|
|
||||||
public FileResource(string name, FileInfo master) : base(name) {
|
|
||||||
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)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 2546fb1d514348842a14a03531be192d
|
|
||||||
timeCreated: 1637982768
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
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) };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,6 +6,7 @@ using System.ComponentModel;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using UnsafeIL;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr {
|
||||||
[JsonConverter(typeof(BeatTimeConverter))]
|
[JsonConverter(typeof(BeatTimeConverter))]
|
||||||
@@ -154,6 +155,10 @@ namespace Cryville.Crtr {
|
|||||||
protected ChartEvent() {
|
protected ChartEvent() {
|
||||||
PropSrcs = new Dictionary<int, PropSrc>();
|
PropSrcs = new Dictionary<int, PropSrc>();
|
||||||
PropOps = new Dictionary<int, PropOp>();
|
PropOps = new Dictionary<int, PropOp>();
|
||||||
|
SubmitPropSrc("event", new PropSrc.Float(() => {
|
||||||
|
int hash = GetHashCode();
|
||||||
|
return Unsafe.As<int, float>(ref hash);
|
||||||
|
}));
|
||||||
SubmitPropSrc("long", new PropSrc.Boolean(() => IsLong));
|
SubmitPropSrc("long", new PropSrc.Boolean(() => IsLong));
|
||||||
SubmitPropSrc("time", new PropSrc.BeatTime(() => time.Value));
|
SubmitPropSrc("time", new PropSrc.BeatTime(() => time.Value));
|
||||||
SubmitPropSrc("endtime", new PropSrc.BeatTime(() => endtime.Value));
|
SubmitPropSrc("endtime", new PropSrc.BeatTime(() => endtime.Value));
|
||||||
@@ -320,7 +325,7 @@ namespace Cryville.Crtr {
|
|||||||
else {
|
else {
|
||||||
AbsoluteValue = Vector.Construct(registry.Type, m.Groups[11].Value);
|
AbsoluteValue = Vector.Construct(registry.Type, m.Groups[11].Value);
|
||||||
}
|
}
|
||||||
SubmitPropSrc("value", VectorSrc.Construct(() => {
|
SubmitPropSrc("value", new VectorSrc(() => {
|
||||||
if (RelativeNode != null) return RelativeNode.Value;
|
if (RelativeNode != null) return RelativeNode.Value;
|
||||||
else return AbsoluteValue;
|
else return AbsoluteValue;
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Cryville.Crtr {
|
|||||||
#region Fields
|
#region Fields
|
||||||
Chart chart;
|
Chart chart;
|
||||||
Skin skin;
|
Skin skin;
|
||||||
PdtSkin pskin;
|
public static PdtSkin pskin;
|
||||||
Ruleset ruleset;
|
Ruleset ruleset;
|
||||||
PdtRuleset pruleset;
|
PdtRuleset pruleset;
|
||||||
Dictionary<string, Texture2D> texs;
|
Dictionary<string, Texture2D> texs;
|
||||||
@@ -175,16 +175,21 @@ namespace Cryville.Crtr {
|
|||||||
string url = texLoader.url;
|
string url = texLoader.url;
|
||||||
string name = StringUtils.TrimExt(url.Substring(url.LastIndexOfAny(new char[] {'/', '\\'}) + 1));
|
string name = StringUtils.TrimExt(url.Substring(url.LastIndexOfAny(new char[] {'/', '\\'}) + 1));
|
||||||
#if UNITY_5_4_OR_NEWER
|
#if UNITY_5_4_OR_NEWER
|
||||||
if (texHandler.isDone) {
|
if (texLoader.isDone) {
|
||||||
var tex = texHandler.texture;
|
if (texHandler.isDone) {
|
||||||
tex.wrapMode = TextureWrapMode.Clamp;
|
var tex = texHandler.texture;
|
||||||
if (frames.ContainsKey(name)) {
|
tex.wrapMode = TextureWrapMode.Clamp;
|
||||||
Logger.Log("main", 3, "Load/Prehandle", "Duplicated texture name: {0}", name);
|
if (frames.ContainsKey(name)) {
|
||||||
|
Logger.Log("main", 3, "Load/Prehandle", "Duplicated texture name: {0}", name);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
frames.Add(name, new SpriteFrame(tex));
|
||||||
|
}
|
||||||
|
texs.Add(name, tex);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
frames.Add(name, new SpriteFrame(tex));
|
Logger.Log("main", 4, "Load/Prehandle", "Unable to load texture: {0}", name);
|
||||||
}
|
}
|
||||||
texs.Add(name, tex);
|
|
||||||
texLoader.Dispose();
|
texLoader.Dispose();
|
||||||
texHandler.Dispose();
|
texHandler.Dispose();
|
||||||
texLoader = null;
|
texLoader = null;
|
||||||
@@ -468,6 +473,8 @@ namespace Cryville.Crtr {
|
|||||||
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;
|
||||||
|
cbus.ForwardByTime(startOffset);
|
||||||
|
bbus.ForwardByTime(startOffset);
|
||||||
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) {
|
if (Settings.Default.ClearLogOnPlay) {
|
||||||
@@ -478,7 +485,6 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
Game.AudioSequencer.Playing = true;
|
Game.AudioSequencer.Playing = true;
|
||||||
atime0 = Game.AudioClient.BufferPosition;
|
atime0 = Game.AudioClient.BufferPosition;
|
||||||
Thread.Sleep((int)((atime0 - Game.AudioClient.Position) * 1000));
|
|
||||||
inputProxy.SyncTime(cbus.Time);
|
inputProxy.SyncTime(cbus.Time);
|
||||||
started = true;
|
started = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,15 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Components {
|
namespace Cryville.Crtr.Components {
|
||||||
|
[DisallowMultipleComponent]
|
||||||
public abstract class MeshBase : SkinComponent {
|
public abstract class MeshBase : SkinComponent {
|
||||||
public MeshBase() {
|
public MeshBase() {
|
||||||
|
SubmitProperty("color", new PropOp.Color(v => Color = v));
|
||||||
|
SubmitProperty("opacity", new PropOp.Float(v => {
|
||||||
|
var c = Color;
|
||||||
|
c.a *= v;
|
||||||
|
Color = c;
|
||||||
|
}));
|
||||||
SubmitProperty("zindex", new PropOp.Integer(v => ZIndex = (short)v));
|
SubmitProperty("zindex", new PropOp.Integer(v => ZIndex = (short)v));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,12 +35,32 @@ namespace Cryville.Crtr.Components {
|
|||||||
mat.renderQueue = _zindex;
|
mat.renderQueue = _zindex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Color _color = Color.white;
|
||||||
|
public Color Color {
|
||||||
|
get { return _color; }
|
||||||
|
set {
|
||||||
|
_color = value;
|
||||||
|
UpdateColor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected void UpdateColor() {
|
||||||
|
if (!mesh.Initialized) return;
|
||||||
|
foreach (var mat in materials) {
|
||||||
|
mat.color = _color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnDestroy() {
|
protected override void OnDestroy() {
|
||||||
if (materials != null)
|
DestroyMaterials();
|
||||||
foreach (var mat in materials) {
|
|
||||||
Material.Destroy(mat);
|
|
||||||
}
|
|
||||||
mesh.Destroy();
|
mesh.Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void DestroyMaterials() {
|
||||||
|
if (materials == null) return;
|
||||||
|
foreach (var mat in materials) {
|
||||||
|
Material.Destroy(mat);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ namespace Cryville.Crtr.Components {
|
|||||||
public op_set_shape(PolygonSGO self) : base(1) {
|
public op_set_shape(PolygonSGO self) : base(1) {
|
||||||
_self = self;
|
_self = self;
|
||||||
}
|
}
|
||||||
protected unsafe override void Execute() {
|
protected override unsafe void Execute() {
|
||||||
var o = GetOperand(0);
|
var o = GetOperand(0);
|
||||||
if (o.Type != PdtInternalType.Vector) throw new ArgumentException("Not a vector");
|
if (o.Type != PdtInternalType.Vector) throw new ArgumentException("Not a vector");
|
||||||
_self._shapeLength = (o.Length - sizeof(int)) / sizeof(Vector2);
|
_self._shapeLength = (o.Length - sizeof(int)) / sizeof(Vector2);
|
||||||
@@ -107,7 +107,7 @@ namespace Cryville.Crtr.Components {
|
|||||||
base.Init();
|
base.Init();
|
||||||
mesh.Init(transform);
|
mesh.Init(transform);
|
||||||
|
|
||||||
mesh.Renderer.materials = materials = new Material[] {
|
mesh.Renderer.sharedMaterials = materials = new Material[] {
|
||||||
MeshWrapper.NewMaterial(),
|
MeshWrapper.NewMaterial(),
|
||||||
MeshWrapper.NewMaterial(),
|
MeshWrapper.NewMaterial(),
|
||||||
MeshWrapper.NewMaterial(),
|
MeshWrapper.NewMaterial(),
|
||||||
|
|||||||
@@ -1,5 +1,89 @@
|
|||||||
namespace Cryville.Crtr.Components {
|
using Cryville.Common;
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
using Logger = Cryville.Common.Logger;
|
||||||
|
|
||||||
|
namespace Cryville.Crtr.Components {
|
||||||
public class SkinAnimation : SkinComponent {
|
public class SkinAnimation : SkinComponent {
|
||||||
|
public SkinAnimation() {
|
||||||
|
SubmitProperty("name", new PropOp.Identifier(v => Name = v));
|
||||||
|
SubmitProperty("duration", new PropOp.Float(v => Duration = v));
|
||||||
|
SubmitProperty("iteration", new PropOp.Float(v => Iteration = v));
|
||||||
|
SubmitProperty("direction", new PropOp.Enum<AnimationDirection>(v => Direction = v, v => (AnimationDirection)v));
|
||||||
|
SubmitProperty("delay", new PropOp.Float(v => Delay = v));
|
||||||
|
Iteration = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
SkinContext _skinContext;
|
||||||
|
Transform _writeTransform;
|
||||||
|
|
||||||
|
AnimationSpan _anim;
|
||||||
|
int _name;
|
||||||
|
public int Name {
|
||||||
|
set {
|
||||||
|
if (_name == value) return;
|
||||||
|
_name = value;
|
||||||
|
if (value == 0) {
|
||||||
|
_anim = null;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var id = new Identifier(value);
|
||||||
|
AnimationSpan anim;
|
||||||
|
if (!ChartPlayer.pskin.animations.TryGetValue(id, out anim)) {
|
||||||
|
Logger.Log("main", 4, "Skin", "Animation {0} not found", id.Name);
|
||||||
|
_anim = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_anim = anim;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public float Duration { get; private set; }
|
||||||
|
public float Iteration { get; private set; }
|
||||||
|
public AnimationDirection Direction { get; private set; }
|
||||||
|
public float Delay { get; private set; }
|
||||||
|
|
||||||
|
double _startTime;
|
||||||
|
|
||||||
|
public override void Init() {
|
||||||
|
_skinContext = new SkinContext(transform);
|
||||||
|
}
|
||||||
|
public override void Rewind(double time, Transform target) {
|
||||||
|
_startTime = time;
|
||||||
|
if (target == null) target = transform;
|
||||||
|
_writeTransform = target;
|
||||||
|
}
|
||||||
|
public override void Tick(SkinContainer c, double time) {
|
||||||
|
float _rtime = (float)(time - _startTime - Delay) / Duration;
|
||||||
|
if (_rtime < 0) _rtime = 0;
|
||||||
|
else if (_rtime > Iteration) {
|
||||||
|
if (Direction.HasFlag(AnimationDirection.alternate)) {
|
||||||
|
_rtime = Iteration % 2;
|
||||||
|
if (_rtime > 1) _rtime = 2 - _rtime;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_rtime = Iteration % 1;
|
||||||
|
if (_rtime == 0) _rtime = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (Direction.HasFlag(AnimationDirection.alternate)) {
|
||||||
|
_rtime %= 2;
|
||||||
|
if (_rtime > 1) _rtime = 2 - _rtime;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_rtime %= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Direction.HasFlag(AnimationDirection.reverse)) _rtime = 1 - _rtime;
|
||||||
|
if (_anim != null) c.MatchAnimation(_anim, _rtime, new RuntimeSkinContext(_skinContext, _writeTransform));
|
||||||
|
}
|
||||||
protected override void OnDestroy() { }
|
protected override void OnDestroy() { }
|
||||||
}
|
}
|
||||||
|
[Flags]
|
||||||
|
public enum AnimationDirection {
|
||||||
|
normal = 0,
|
||||||
|
reverse = 1,
|
||||||
|
alternate = 2,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ namespace Cryville.Crtr.Components {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Init() { }
|
public virtual void Init() { }
|
||||||
|
public virtual void Rewind(double time, Transform target) { }
|
||||||
|
public virtual void Tick(SkinContainer c, double time) { }
|
||||||
protected abstract void OnDestroy();
|
protected abstract void OnDestroy();
|
||||||
}
|
}
|
||||||
public struct SkinProperty {
|
public struct SkinProperty {
|
||||||
|
|||||||
@@ -88,8 +88,9 @@ namespace Cryville.Crtr.Components {
|
|||||||
|
|
||||||
protected void InternalInit(string meshName = "quad") {
|
protected void InternalInit(string meshName = "quad") {
|
||||||
mesh.Init(transform);
|
mesh.Init(transform);
|
||||||
mesh.Renderer.materials = materials = new Material[] { MeshWrapper.NewMaterial() };
|
mesh.Renderer.sharedMaterials = materials = new Material[] { MeshWrapper.NewMaterial() };
|
||||||
mesh.Mesh = GenericResources.Meshes[meshName];
|
mesh.Mesh = GenericResources.Meshes[meshName];
|
||||||
|
UpdateColor();
|
||||||
UpdateScale();
|
UpdateScale();
|
||||||
UpdateZIndex();
|
UpdateZIndex();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace Cryville.Crtr.Components {
|
|||||||
SubmitProperty("frames", new PropOp.StringArray(v => Frames = v));
|
SubmitProperty("frames", new PropOp.StringArray(v => Frames = v));
|
||||||
SubmitProperty("index", new PropOp.Integer(v => Index = v));
|
SubmitProperty("index", new PropOp.Integer(v => Index = v));
|
||||||
SubmitProperty("fit", new PropOp.Enum<FitMode>(v => Fit = v, v => (FitMode)v));
|
SubmitProperty("fit", new PropOp.Enum<FitMode>(v => Fit = v, v => (FitMode)v));
|
||||||
SubmitProperty("opacity", new PropOp.Float(v => Opacity = v));
|
SubmitProperty("shader", new PropOp.String(v => Shader = v));
|
||||||
}
|
}
|
||||||
|
|
||||||
static Vector2[] _origuv;
|
static Vector2[] _origuv;
|
||||||
@@ -122,9 +122,21 @@ namespace Cryville.Crtr.Components {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mesh.Renderer.enabled = true;
|
mesh.Renderer.enabled = true;
|
||||||
mesh.Renderer.material.mainTexture = frame.Frame.Texture;
|
mesh.Renderer.sharedMaterial.mainTexture = frame.Frame.Texture;
|
||||||
UpdateUV();
|
UpdateUV();
|
||||||
UpdateScale();
|
UpdateScale();
|
||||||
|
}
|
||||||
|
Shader m_shader;
|
||||||
|
public string Shader {
|
||||||
|
set {
|
||||||
|
m_shader = GenericResources.Shaders[value];
|
||||||
|
UpdateShader();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void UpdateShader() {
|
||||||
|
if (!mesh.Initialized) return;
|
||||||
|
if (m_shader == null) m_shader = GenericResources.Shaders["default"];
|
||||||
|
mesh.Renderer.sharedMaterial.shader = m_shader;
|
||||||
UpdateZIndex();
|
UpdateZIndex();
|
||||||
}
|
}
|
||||||
readonly Vector2[] _uvs = new Vector2[4];
|
readonly Vector2[] _uvs = new Vector2[4];
|
||||||
@@ -138,21 +150,6 @@ namespace Cryville.Crtr.Components {
|
|||||||
mesh.Mesh.uv = _uvs;
|
mesh.Mesh.uv = _uvs;
|
||||||
}
|
}
|
||||||
|
|
||||||
float _opacity = 1;
|
|
||||||
public float Opacity {
|
|
||||||
get { return _opacity; }
|
|
||||||
set {
|
|
||||||
_opacity = value;
|
|
||||||
UpdateOpacity();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
protected void UpdateOpacity() {
|
|
||||||
if (!mesh.Initialized) return;
|
|
||||||
var c = mesh.Renderer.material.color;
|
|
||||||
c.a = _opacity;
|
|
||||||
mesh.Renderer.material.color = c;
|
|
||||||
}
|
|
||||||
|
|
||||||
private FitMode m_fit = FitMode.height;
|
private FitMode m_fit = FitMode.height;
|
||||||
public FitMode Fit {
|
public FitMode Fit {
|
||||||
get { return m_fit; }
|
get { return m_fit; }
|
||||||
@@ -185,7 +182,7 @@ namespace Cryville.Crtr.Components {
|
|||||||
public override void Init() {
|
public override void Init() {
|
||||||
InternalInit();
|
InternalInit();
|
||||||
OnFrameUpdate();
|
OnFrameUpdate();
|
||||||
UpdateOpacity();
|
UpdateShader();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,22 +2,7 @@
|
|||||||
|
|
||||||
namespace Cryville.Crtr.Components {
|
namespace Cryville.Crtr.Components {
|
||||||
public class SpriteRect : SpriteBase {
|
public class SpriteRect : SpriteBase {
|
||||||
public SpriteRect() {
|
public SpriteRect() { }
|
||||||
SubmitProperty("color", new PropOp.Color(v => Color = v));
|
|
||||||
}
|
|
||||||
|
|
||||||
Color _color;
|
|
||||||
public Color Color {
|
|
||||||
get { return _color; }
|
|
||||||
set {
|
|
||||||
_color = value;
|
|
||||||
OnColorUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void OnColorUpdate() {
|
|
||||||
if (!mesh.Initialized) return;
|
|
||||||
mesh.Renderer.material.SetColor("_Color", _color);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override Vector3 BaseScale {
|
protected override Vector3 BaseScale {
|
||||||
get { return Vector3.one; }
|
get { return Vector3.one; }
|
||||||
@@ -25,7 +10,6 @@ namespace Cryville.Crtr.Components {
|
|||||||
|
|
||||||
public override void Init() {
|
public override void Init() {
|
||||||
InternalInit();
|
InternalInit();
|
||||||
OnColorUpdate();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ namespace Cryville.Crtr.Components {
|
|||||||
SubmitProperty("border", new PropOp.Vector2(v => Border = v));
|
SubmitProperty("border", new PropOp.Vector2(v => Border = v));
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly static Dictionary<float, int> uvrefl
|
static readonly Dictionary<float, int> uvrefl
|
||||||
= new Dictionary<float, int>() {
|
= new Dictionary<float, int>() {
|
||||||
{-0.5f, 0}, {-0.4f, 1}, {0.4f, 2}, {0.5f, 3},
|
{-0.5f, 0}, {-0.4f, 1}, {0.4f, 2}, {0.5f, 3},
|
||||||
};
|
};
|
||||||
static Vector2[] _origuv;
|
static Vector2[] _origuv;
|
||||||
protected new static Vector2[] OriginalUV {
|
protected static new Vector2[] OriginalUV {
|
||||||
get {
|
get {
|
||||||
if (_origuv == null) {
|
if (_origuv == null) {
|
||||||
var m = GenericResources.Meshes["quad_scale3h"];
|
var m = GenericResources.Meshes["quad_scale3h"];
|
||||||
@@ -84,7 +84,6 @@ namespace Cryville.Crtr.Components {
|
|||||||
public override void Init() {
|
public override void Init() {
|
||||||
InternalInit("quad_scale3h");
|
InternalInit("quad_scale3h");
|
||||||
OnFrameUpdate();
|
OnFrameUpdate();
|
||||||
UpdateOpacity();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ namespace Cryville.Crtr.Components {
|
|||||||
SubmitProperty("value", new PropOp.TargetString(() => Value));
|
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));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma warning disable IDE1006
|
#pragma warning disable IDE1006
|
||||||
@@ -20,7 +19,7 @@ namespace Cryville.Crtr.Components {
|
|||||||
public op_set_frames(SpriteText self) : base(2) {
|
public op_set_frames(SpriteText self) : base(2) {
|
||||||
_self = self;
|
_self = self;
|
||||||
}
|
}
|
||||||
protected unsafe override void Execute() {
|
protected override unsafe void Execute() {
|
||||||
var keys = GetOperand(0).AsString();
|
var keys = GetOperand(0).AsString();
|
||||||
var values = GetOperand(1);
|
var values = GetOperand(1);
|
||||||
int arrtype; int len;
|
int arrtype; int len;
|
||||||
@@ -47,7 +46,7 @@ namespace Cryville.Crtr.Components {
|
|||||||
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(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly TargetString m_value = new TargetString();
|
readonly TargetString m_value = new TargetString();
|
||||||
@@ -78,7 +77,11 @@ namespace Cryville.Crtr.Components {
|
|||||||
meshes.Clear();
|
meshes.Clear();
|
||||||
verts.Clear();
|
verts.Clear();
|
||||||
uvs.Clear();
|
uvs.Clear();
|
||||||
|
DestroyMaterials();
|
||||||
|
materials = new Material[m_frames.Count];
|
||||||
|
int i = 0;
|
||||||
foreach (var f in m_frames) {
|
foreach (var f in m_frames) {
|
||||||
|
if (SpriteInfo.IsNullOrEmpty(f.Value)) continue;
|
||||||
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 for text component");
|
else if (frameHeight != f.Value.Rect.height) throw new Exception("Inconsistent frame height for text component");
|
||||||
var tex = f.Value.Frame.Texture;
|
var tex = f.Value.Frame.Texture;
|
||||||
@@ -86,14 +89,17 @@ namespace Cryville.Crtr.Components {
|
|||||||
var m = new MeshWrapper();
|
var m = new MeshWrapper();
|
||||||
m.Init(mesh.MeshTransform);
|
m.Init(mesh.MeshTransform);
|
||||||
m.Mesh = new Mesh();
|
m.Mesh = new Mesh();
|
||||||
m.Renderer.material = MeshWrapper.NewMaterial(); // TODO Destroy or add to `materials`
|
var mat = MeshWrapper.NewMaterial();
|
||||||
m.Renderer.material.mainTexture = tex;
|
mat.mainTexture = tex;
|
||||||
|
m.Renderer.sharedMaterial = materials[i++] = mat;
|
||||||
meshes.Add(tex, m);
|
meshes.Add(tex, m);
|
||||||
verts.Add(tex, new List<Vector3>());
|
verts.Add(tex, new List<Vector3>());
|
||||||
uvs.Add(tex, new List<Vector2>());
|
uvs.Add(tex, new List<Vector2>());
|
||||||
tris.Add(tex, new List<int>());
|
tris.Add(tex, new List<int>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
UpdateColor();
|
||||||
|
UpdateScale();
|
||||||
}
|
}
|
||||||
|
|
||||||
float sum_x;
|
float sum_x;
|
||||||
@@ -158,23 +164,6 @@ namespace Cryville.Crtr.Components {
|
|||||||
get { return new Vector2(-0.5f, -0.5f); }
|
get { return new Vector2(-0.5f, -0.5f); }
|
||||||
}
|
}
|
||||||
|
|
||||||
float _opacity = 1;
|
|
||||||
public float Opacity {
|
|
||||||
get { return _opacity; }
|
|
||||||
set {
|
|
||||||
_opacity = value;
|
|
||||||
UpdateOpacity();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void UpdateOpacity() {
|
|
||||||
if (!mesh.Initialized) return;
|
|
||||||
foreach (var m in meshes) {
|
|
||||||
var c = m.Value.Renderer.material.color;
|
|
||||||
c.a = _opacity;
|
|
||||||
m.Value.Renderer.material.color = c;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Init() {
|
public override void Init() {
|
||||||
InternalInit();
|
InternalInit();
|
||||||
UpdateFrames();
|
UpdateFrames();
|
||||||
|
|||||||
@@ -93,10 +93,10 @@ namespace Cryville.Crtr.Config {
|
|||||||
var tsrc = src.Value;
|
var tsrc = src.Value;
|
||||||
bool flag = false;
|
bool flag = false;
|
||||||
if (proxy.IsUsed(tsrc)) {
|
if (proxy.IsUsed(tsrc)) {
|
||||||
text.text += " (Used)";
|
text.text += " <size=9>(Used)</size>";
|
||||||
}
|
}
|
||||||
else if (tsrc.Handler.GetDimension(src.Value.Type) < m_configScene.ruleset.Root.inputs[_sel].dim) {
|
else if (tsrc.Handler.GetDimension(src.Value.Type) < m_configScene.ruleset.Root.inputs[_sel].dim) {
|
||||||
text.text += " (Not Applicable)";
|
text.text += " <size=9>(Not Applicable)</size>";
|
||||||
}
|
}
|
||||||
else flag = true;
|
else flag = true;
|
||||||
btn.interactable = flag;
|
btn.interactable = flag;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user