@@ -114,6 +114,47 @@ class MetaData {
114114 add (" type" , Type .getClassName (Type .getClass (variable )));
115115 add (" pointer" , PointerTools .pointer (variable ));
116116
117+ // Special function which will take 2 objects, one a bunch of fields for a start value, and one for an end value.
118+ // This will create a tween for the object, and also automatically null-check itself, so nothing breaks.
119+ // add("tween", function(start:Dynamic, end:Dynamic, duration:Float, ?ease:FlxEase):Void {
120+ // if (variable != null) {
121+ // FlxTween.num(start, start, end, duration, {
122+ // ease: ease,
123+ // onUpdate: function(progress:Float):Void {
124+ // if (variable != null) {
125+ // for (key in Reflect.fields(variable)) {
126+ // var value = Reflect.field(variable, key);
127+ // if (value != null) {
128+ // if (Std.is(value, Float) || Std.is(value, Int)) {
129+ // var startValue = Reflect.field(start, key);
130+ // var endValue = Reflect.field(end, key);
131+ // if (startValue != null && endValue != null) {
132+ // var interpolated = startValue + (endValue - startValue) * progress;
133+ // if (Std.is(value, Int)) {
134+ // Reflect.setField(variable, key, Std.int(interpolated));
135+ // } else {
136+ // Reflect.setField(variable, key, interpolated);
137+ // }
138+ // }
139+ // }
140+ // }
141+ // }
142+ // }
143+ // },
144+ // onComplete: function(tween:FlxTween):Void {
145+ // if (variable != null) {
146+ // for (key in Reflect.fields(variable)) {
147+ // var value = Reflect.field(variable, key);
148+ // if (value != null) {
149+ // metadata(value);
150+ // }
151+ // }
152+ // }
153+ // }
154+ // });
155+ // }
156+ // });
157+
117158 }
118159
119160 private static function cleanup (): Void {
0 commit comments