Code cleanup.
This commit is contained in:
@@ -9,11 +9,11 @@ namespace Cryville.Crtr.Browsing {
|
||||
public override object Value {
|
||||
get {
|
||||
float s_value = GetDisplayValue();
|
||||
return IntegerMode ? (object)(int)s_value : (object)s_value;
|
||||
return IntegerMode ? (int)s_value : (object)s_value;
|
||||
}
|
||||
set {
|
||||
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();
|
||||
m_text.text = s_value.ToString();
|
||||
if (Range != null && MaxStep == 0) {
|
||||
|
@@ -72,7 +72,7 @@ namespace Cryville.Crtr.Components {
|
||||
public op_set_shape(PolygonSGO self) : base(1) {
|
||||
_self = self;
|
||||
}
|
||||
protected unsafe override void Execute() {
|
||||
protected override unsafe void Execute() {
|
||||
var o = GetOperand(0);
|
||||
if (o.Type != PdtInternalType.Vector) throw new ArgumentException("Not a vector");
|
||||
_self._shapeLength = (o.Length - sizeof(int)) / sizeof(Vector2);
|
||||
|
@@ -8,12 +8,12 @@ namespace Cryville.Crtr.Components {
|
||||
SubmitProperty("border", new PropOp.Vector2(v => Border = v));
|
||||
}
|
||||
|
||||
readonly static Dictionary<float, int> uvrefl
|
||||
static readonly Dictionary<float, int> uvrefl
|
||||
= new Dictionary<float, int>() {
|
||||
{-0.5f, 0}, {-0.4f, 1}, {0.4f, 2}, {0.5f, 3},
|
||||
};
|
||||
static Vector2[] _origuv;
|
||||
protected new static Vector2[] OriginalUV {
|
||||
protected static new Vector2[] OriginalUV {
|
||||
get {
|
||||
if (_origuv == null) {
|
||||
var m = GenericResources.Meshes["quad_scale3h"];
|
||||
|
@@ -19,7 +19,7 @@ namespace Cryville.Crtr.Components {
|
||||
public op_set_frames(SpriteText self) : base(2) {
|
||||
_self = self;
|
||||
}
|
||||
protected unsafe override void Execute() {
|
||||
protected override unsafe void Execute() {
|
||||
var keys = GetOperand(0).AsString();
|
||||
var values = GetOperand(1);
|
||||
int arrtype; int len;
|
||||
|
@@ -82,9 +82,9 @@ namespace Cryville.Crtr.Event {
|
||||
Anchor a_cur;
|
||||
Anchor a_head;
|
||||
Anchor a_tail;
|
||||
readonly static int _a_cur = IdentifierManager.SharedInstance.Request("cur");
|
||||
readonly static int _a_head = IdentifierManager.SharedInstance.Request("head");
|
||||
readonly static int _a_tail = IdentifierManager.SharedInstance.Request("tail");
|
||||
static readonly int _a_cur = IdentifierManager.SharedInstance.Request("cur");
|
||||
static readonly int _a_head = IdentifierManager.SharedInstance.Request("head");
|
||||
static readonly int _a_tail = IdentifierManager.SharedInstance.Request("tail");
|
||||
double atime_head;
|
||||
double atime_tail;
|
||||
public Anchor RegisterAnchor(int name, bool dyn = false, int propSrcCount = 0) {
|
||||
|
@@ -24,7 +24,7 @@ namespace Cryville.Crtr {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
public readonly static string FileProtocolPrefix
|
||||
public static readonly string FileProtocolPrefix
|
||||
#if UNITY_STANDALONE_WIN
|
||||
= "file:///";
|
||||
#elif UNITY_ANDROID
|
||||
@@ -37,9 +37,9 @@ namespace Cryville.Crtr {
|
||||
public static SimpleSequencerSource AudioSequencer;
|
||||
public static SimpleSequencerSession AudioSession;
|
||||
public static InputManager InputManager;
|
||||
public readonly static NetworkTaskWorker NetworkTaskWorker = new NetworkTaskWorker();
|
||||
public static readonly NetworkTaskWorker NetworkTaskWorker = new NetworkTaskWorker();
|
||||
|
||||
public readonly static JsonSerializerSettings GlobalJsonSerializerSettings
|
||||
public static readonly JsonSerializerSettings GlobalJsonSerializerSettings
|
||||
= new JsonSerializerSettings() {
|
||||
DefaultValueHandling = DefaultValueHandling.Ignore,
|
||||
};
|
||||
|
@@ -360,7 +360,7 @@ namespace Cryville.Crtr {
|
||||
public abstract void LerpWith(Vector start, float lerpedTime, ref Vector result);
|
||||
public abstract float DelerpWith(Vector start, Vector value);
|
||||
public abstract bool IsZero();
|
||||
public override abstract string ToString();
|
||||
public abstract override string ToString();
|
||||
public abstract unsafe void ToArray(float* arr);
|
||||
|
||||
public Vector Clone() {
|
||||
@@ -610,8 +610,8 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
}
|
||||
}
|
||||
w = aw ? rw : (float?)null;
|
||||
h = ah ? rh : (float?)null;
|
||||
w = aw ? rw : null;
|
||||
h = ah ? rh : null;
|
||||
}
|
||||
|
||||
public static VecPtComp Parse(string s) {
|
||||
@@ -968,7 +968,7 @@ namespace Cryville.Crtr {
|
||||
public class VectorOp : PropOp {
|
||||
readonly Action<float[]> _cb;
|
||||
public VectorOp(Action<float[]> cb) { _cb = cb; }
|
||||
protected unsafe override void Execute() {
|
||||
protected override unsafe void Execute() {
|
||||
var op = GetOperand(0);
|
||||
float[] values;
|
||||
if (op.Type == PdtInternalType.Number) {
|
||||
|
@@ -644,7 +644,7 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
unsafe static class oputil {
|
||||
static unsafe class oputil {
|
||||
public static float AsNumber(PropSrc src) {
|
||||
if (src == null) throw new ArgumentNullException("src");
|
||||
int type; byte[] value;
|
||||
|
@@ -63,7 +63,7 @@ namespace Cryville.Crtr {
|
||||
public class StringArray : PropOp {
|
||||
readonly Action<string[]> _cb;
|
||||
public StringArray(Action<string[]> cb) { _cb = cb; }
|
||||
protected unsafe override void Execute() {
|
||||
protected override unsafe void Execute() {
|
||||
var op = GetOperand(0);
|
||||
int arrtype; int len;
|
||||
op.GetArraySuffix(out arrtype, out len);
|
||||
@@ -100,7 +100,7 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
}
|
||||
public class Enum<T> : PropOp {
|
||||
readonly static Dictionary<int, int> _cache = new Dictionary<int, int>();
|
||||
static readonly Dictionary<int, int> _cache = new Dictionary<int, int>();
|
||||
readonly Action<T> _cb;
|
||||
readonly Func<int, T> _caster;
|
||||
static Enum() {
|
||||
|
Reference in New Issue
Block a user