animation, gathering, deposit, ui
This commit is contained in:
@@ -3,13 +3,16 @@ import { ThreeC } from "../ThreeC";
|
||||
import { PhysicsBody, PhysicsLayer } from "../PhysicsC";
|
||||
import { PhysicsTriggerC } from "./PhysicsTriggerC";
|
||||
import { PropC } from "./PropC";
|
||||
import { findDamageStateLayers } from "./PropDamageLayers";
|
||||
import { resolvePropType } from "../Resources/PropDropTable";
|
||||
|
||||
import { InteractiveZoneC } from "./InteractiveZoneC";
|
||||
|
||||
const MAP_PHYSICS_LAYERS = ["Colliders", "Lootable"];
|
||||
const GATHER_TRIGGER_PADDING = 0.2;
|
||||
const GATHER_TRIGGER_PADDING = 0.5;
|
||||
|
||||
export class Map {
|
||||
static Init() {
|
||||
static init() {
|
||||
const mapObject = ThreeC.getObject("map");
|
||||
if (!mapObject) {
|
||||
console.warn("Map model resource not found: map");
|
||||
@@ -22,6 +25,7 @@ export class Map {
|
||||
|
||||
PhysicsTriggerC.init();
|
||||
this.buildPhysics(mapObject);
|
||||
InteractiveZoneC.init(mapObject);
|
||||
}
|
||||
|
||||
private static buildPhysics(mapObject: Object3D) {
|
||||
@@ -55,7 +59,10 @@ export class Map {
|
||||
|
||||
private static setupLootableObject(lootableObject: Object3D) {
|
||||
const propType = resolvePropType(lootableObject.name);
|
||||
const prop = new PropC(lootableObject, propType);
|
||||
const damageLayers = findDamageStateLayers(lootableObject);
|
||||
const maxHealth = damageLayers.length > 0 ? damageLayers.length : 1;
|
||||
const prop = new PropC(lootableObject, propType, maxHealth);
|
||||
prop.initDamageLayers(damageLayers);
|
||||
const colliderMesh = this.findMesh(lootableObject, (name) => name.includes("collider"));
|
||||
const visualMeshes = this.getVisualMeshes(lootableObject);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user