const { id, x, y, file, } = box; return ( <VrButton key={id} onClick={() => this.handleHit(box)} onLongClick={() => this.handleHit(box, weapons.ROCKET)} longClickDelayMS={SPECIAL_WEAPON_DELAY} > <CustomModel source={asset(file || 'box/box.gltf')} material={BOX_MATERIAL} style={{ transform: [{ translate: [x, y, 0], }, { scale: [0.03, 0.03, 0.03], }], }} /> </VrButton> ); } handleHit = (box, weapon = weapons.CANNONBALL) => { const { id, x, y } = box; const { boxes, explosionPosition } = this.state; NativeModules.ShotBridge.emitShot(); const { updatedBoxes, boxesToRemove, } = getUpdatedBoxes(boxes, id, weapon); this.setState({ boxes: updatedBoxes, soundPlayState: 'play', explosionPosition: explosionPosition.clone().set(x, y, -5), showExplosion: true, }, () => this.afterHitUpdate(boxesToRemove)); };