Commit cd0de481 authored by Chunchi Che's avatar Chunchi Che

Merge branch 'feat/hands' into 'main'

update hands

See merge request mycard/Neos!25
parents 73863a6f 8ad1ec59
Pipeline #18175 passed with stages
in 2 minutes and 33 seconds
......@@ -47,7 +47,10 @@ export const Floating = 0.02;
// 手牌
export const HandShape = () => {
return { width: 0.5, height: 0.75 };
return { width: 0.8, height: 1 };
};
export const HandRotation = () => {
return new BABYLON.Vector3(1, 0, 0);
};
export const HandColor = () => {
return BABYLON.Color3.White();
......
......@@ -5,7 +5,7 @@ import { CardMeta } from "../../../api/cards";
export default (hands: CardMeta[], scene: BABYLON.Scene) => {
const groundShape = CONFIG.GroundShape();
const handShape = CONFIG.HandShape();
const gap = groundShape.width / hands.length;
const gap = groundShape.width / (hands.length - 1);
const left = -(groundShape.width / 2);
hands.forEach((item, idx, _) => {
const hand = BABYLON.MeshBuilder.CreatePlane(
......@@ -19,6 +19,7 @@ export default (hands: CardMeta[], scene: BABYLON.Scene) => {
handShape.height / 2,
-(groundShape.height / 2) - 1
);
hand.rotation = CONFIG.HandRotation();
// 材质
const handMaterial = new BABYLON.StandardMaterial("handMaterial", scene);
// 材质贴纸
......
......@@ -31,7 +31,7 @@ export default class SimpleDuelPlateImpl implements IDuelPlate {
// 默认的手牌Selector,返回五个code为-1的Card。
const defaultHandsSelector = (_: RootState) => {
return [];
return new Array(5).fill({ id: 10000, data: {}, text: {} });
};
const hands = useAppSelector(this.handsSelector || defaultHandsSelector);
......
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