start flexible movement
This commit is contained in:
@@ -15,6 +15,7 @@ export class StructureInstance {
|
||||
verifier = void 0;
|
||||
verificationRenderer = void 0;
|
||||
materials = void 0;
|
||||
flexMovingPlayerId = void 0;
|
||||
|
||||
constructor(instanceName, structureId) {
|
||||
this.structure = new Structure(structureId);
|
||||
@@ -245,6 +246,23 @@ export class StructureInstance {
|
||||
this.setLayer(this.options.currentLayer - 1);
|
||||
}
|
||||
|
||||
startFlexibleMove(player) {
|
||||
this.flexMovingPlayerId = player.id;
|
||||
this.disable();
|
||||
// create flex movement outliner
|
||||
}
|
||||
|
||||
stopFlexibleMove(finalLocation) {
|
||||
// disable flex movement outliner
|
||||
this.move(this.getDimension(), finalLocation);
|
||||
this.enable();
|
||||
this.flexMovingPlayerId = void 0;
|
||||
}
|
||||
|
||||
isFlexibleMoving() {
|
||||
return this.flexMovingPlayerId !== void 0;
|
||||
}
|
||||
|
||||
disableInstanceWhenNoPlayersOnline() {
|
||||
// This prevents a memory leak when no players are online.
|
||||
world.beforeEvents.playerLeave.subscribe(event => {
|
||||
|
||||
Reference in New Issue
Block a user