the-world-engine
Version:
three.js based, unity like game engine for browser
28 lines (27 loc) • 544 B
JavaScript
import { ZaxisSortable } from "./ZaxisSortable";
export class ZaxisSorter extends ZaxisSortable {
disallowMultipleComponent=true;
Za=0;
tu=true;
start() {
this.update();
if (!this.tu) return;
this.destroy();
}
update() {
const t = this.transform.position;
t.z = -t.y + this.Za;
}
get offset() {
return this.Za;
}
set offset(t) {
this.Za = t;
}
get runOnce() {
return this.tu;
}
set runOnce(t) {
this.tu = t;
}
}