Skip to content

Commit 05f6fe0

Browse files
fix: precipitation speed
1 parent 26a8e28 commit 05f6fe0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/core/staging/Precipitation.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { useLoop, useTexture } from '@tresjs/core'
3-
import { shallowRef, toRefs, watchEffect } from 'vue'
3+
import { shallowRef, toRefs, watch, watchEffect } from 'vue'
44
import type { TresColor } from '@tresjs/core'
55
import type { Texture } from 'three'
66
@@ -167,8 +167,12 @@ const setSpeed = () => {
167167
setSpeed()
168168
setPosition()
169169
170-
watchEffect(() => {
170+
watch((speed), () => {
171171
setSpeed()
172+
})
173+
174+
watchEffect(() => {
175+
if (speed.value) { return }
172176
setPosition()
173177
})
174178

0 commit comments

Comments
 (0)