Merge pull request #2357 from QuantumCoderQC/fix-random-color

random color node fix
This commit is contained in:
Lubos Lenco 2021-10-08 10:27:07 +02:00 committed by GitHub
commit 0fadefab69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,18 +4,17 @@ import iron.math.Vec4;
class RandomColorNode extends LogicNode {
var v = new Vec4();
public function new(tree: LogicTree) {
super(tree);
}
override function get(from: Int): Dynamic {
var r = Math.random();
var g = Math.random();
var b = Math.random();
// var a = Math.random();
v.set(r, g, b);
var v = new Vec4(r, g, b);
return v;
}
}