Handle trigger and event zone

This commit is contained in:
Ketchetwahmeegwun T. Southall 2022-01-30 03:22:46 -08:00
parent c32fdba2f1
commit 16caafa366

View File

@ -71,7 +71,8 @@ export class SegmentDecoration {
export class SegmentZone { export class SegmentZone {
uuid: string uuid: string
points: [number, number][] = [] points: [number, number][] = []
type: 'solid'|'fluid' type: 'solid'|'fluid'|'trigger'
event: string = ''
constructor(o: any) { constructor(o: any) {
this.uuid = o.uuid this.uuid = o.uuid
this.points = o.points.map((v: any) => { this.points = o.points.map((v: any) => {
@ -79,6 +80,9 @@ export class SegmentZone {
}) })
if (o.data.type === 'fluid') { if (o.data.type === 'fluid') {
this.type = o.data.type this.type = o.data.type
} else if (o.data.type === 'trigger') {
this.type = 'trigger'
this.event = o.data.event
} else { } else {
this.type = 'solid' this.type = 'solid'
} }