Commit 563705f3 authored by Chunchi Che's avatar Chunchi Che

optimize chaining animation

parent 429fe1e0
...@@ -32,7 +32,7 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => { ...@@ -32,7 +32,7 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
// 临时办法,这里延迟500ms // 临时办法,这里延迟500ms
// 长期:需要实现动画序列,一个动画完成后才执行下一个动画 // 长期:需要实现动画序列,一个动画完成后才执行下一个动画
await sleep(1000); await sleep(1500);
} else { } else {
console.warn(`<Chaining>target from ${location} is null`); console.warn(`<Chaining>target from ${location} is null`);
} }
......
...@@ -64,6 +64,7 @@ export const Card: FC<{ idx: number }> = React.memo(({ idx }) => { ...@@ -64,6 +64,7 @@ export const Card: FC<{ idx: number }> = React.memo(({ idx }) => {
} }
}; };
// 这里后期应该去掉?
useEffect(() => { useEffect(() => {
move(state.location.zone); move(state.location.zone);
}, []); }, []);
......
import { config } from "@react-spring/web";
import { ygopro } from "@/api"; import { ygopro } from "@/api";
import { type CardType, matStore } from "@/stores"; import { type CardType, matStore } from "@/stores";
...@@ -19,7 +21,7 @@ export const focus = async (props: { card: CardType; api: SpringApi }) => { ...@@ -19,7 +21,7 @@ export const focus = async (props: { card: CardType; api: SpringApi }) => {
}); });
await asyncStart(api)({ y: current.y, ry: current.ry, rz: current.rz }); await asyncStart(api)({ y: current.y, ry: current.ry, rz: current.rz });
} else { } else {
await asyncStart(api)({ z: 200 }); await asyncStart(api)({ z: 200, config: config.gentle });
await asyncStart(api)({ z: current.z }); await asyncStart(api)({ z: current.z, config: config.default });
} }
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment