Commit 8dfbb50c authored by Chunchi Che's avatar Chunchi Che

render cemetery

parent 233d4409
Pipeline #18138 passed with stages
in 3 minutes and 12 seconds
import * as BABYLON from "@babylonjs/core";
import * as CONFIG from "./config";
export default (scene: BABYLON.Scene) => {
// 墓地
const cemetery = BABYLON.MeshBuilder.CreateBox(
"cemetery",
CONFIG.CemeterySlotShape()
);
// 位置
cemetery.position = new BABYLON.Vector3(3.2, 0.5, -2.0);
// 旋转
cemetery.rotation = CONFIG.CemeterySlotRotation();
// 材质
const cemeteryMaterial = new BABYLON.StandardMaterial(
"cemeteryMaterial",
scene
);
cemeteryMaterial.diffuseColor = CONFIG.CemeteryColor();
cemetery.material = cemeteryMaterial;
};
......@@ -17,12 +17,18 @@ export const DeckSlotShape = () => {
export const ExtraDeckSlotShape = () => {
return { width: 0.8, height: 1, depth: 0.2 };
};
export const CemeterySlotShape = () => {
return { width: 0.8, height: 1, depth: 0.2 };
};
export const CardSlotRotation = () => {
return new BABYLON.Vector3(1.5, 0, 0);
};
export const DeckSlotRotation = () => {
return new BABYLON.Vector3(1.5, 0, 0);
};
export const CemeterySlotRotation = () => {
return new BABYLON.Vector3(1.5, 0, 0);
};
// 手牌
export const HandShape = () => {
......@@ -56,3 +62,8 @@ export const DeckColor = () => {
export const ExtraDeckColor = () => {
return BABYLON.Color3.Purple();
};
// 墓地
export const CemeteryColor = () => {
return BABYLON.Color3.Teal();
};
......@@ -13,6 +13,7 @@ import renderMonsters from "./monsters";
import renderExtraMonsters from "./extraMonsters";
import renderMagics from "./magics";
import renderDeck from "./deck";
import renderCemetery from "./cemetery";
import * as CONFIG from "./config";
import { CardMeta } from "../../../api/cards";
......@@ -73,6 +74,9 @@ export default class SimpleDuelPlateImpl implements IDuelPlate {
// 创建卡组
renderDeck(scene);
// 创建墓地
renderCemetery(scene);
// 创建地板
const ground = BABYLON.MeshBuilder.CreateGround(
"ground",
......
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