12345678910111213141516171819202122232425262728 |
- import * as RE from "rogue-engine";
- import { Object3D } from "three";
- export default class MeshGrid extends RE.Component {
- @RE.props.list.prefab() allModels: RE.Prefab[] = [];
- awake() {
- let x = 0;
- let z = 0;
- if (this.allModels.length > 0) {
- this.allModels.forEach(prefab => {
- let model = prefab.instantiate(RE.App.currentScene);
- model.position.set(x + 0.5 * x, 0, z + 0.5 * z);
- x++;
- if (x == 6) {
- x = 0;
- z++;
- }
- });
- }
- }
- start() {}
- update() {}
- }
- RE.registerComponent(MeshGrid);
|