diff --git a/mini-game-assets/models/ui/double_dot.glb b/mini-game-assets/models/ui/double_dot.glb new file mode 100644 index 0000000..956963d Binary files /dev/null and b/mini-game-assets/models/ui/double_dot.glb differ diff --git a/src/ui/timer.ts b/src/ui/timer.ts index 6ad8f37..d820de3 100644 --- a/src/ui/timer.ts +++ b/src/ui/timer.ts @@ -8,6 +8,7 @@ export class Timer3D { root: Entity seconds: Counter3D minutes?: Counter3D + dots: Entity constructor( transform: TransformTypeWithOptionals, @@ -19,7 +20,7 @@ export class Timer3D { const { engine, tweenSystem, - components: { Transform, Tween } + components: { Transform, Tween, GltfContainer, VisibilityComponent } } = getSDK() this.root = engine.addEntity() Transform.create(this.root, transform) @@ -35,6 +36,8 @@ export class Timer3D { id * 100 ) this.seconds.setNumber(0) + this.dots = engine.addEntity() + VisibilityComponent.createOrReplace(this.dots) if (sections > 1) { this.minutes = new Counter3D( @@ -48,6 +51,12 @@ export class Timer3D { id * 100 + 1 ) this.minutes.setNumber(0) + Transform.createOrReplace(this.dots, { + parent: this.root, + position: Vector3.create(2 * spacing - 0.85, 0, 0), + scale: Vector3.create(1.7, 1.7, 1.7) + }) + GltfContainer.createOrReplace(this.dots, { src: 'mini-game-assets/models/ui/double_dot.glb' }) } engine.addSystem(() => { @@ -93,15 +102,23 @@ export class Timer3D { } } hide() { + const { + components: { VisibilityComponent } + } = getSDK() this.seconds.hide() if (this.minutes) { this.minutes.hide() } + VisibilityComponent.getMutable(this.dots).visible = false } show() { + const { + components: { VisibilityComponent } + } = getSDK() this.seconds.show() if (this.minutes) { this.minutes.show() + VisibilityComponent.getMutable(this.dots).visible = true } } }