You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
4.0 KiB
TypeScript

import { Drone_Event } from "./define/Event";
import { IDroneInfo, IDroneLocationInfo } from "./define/Interface";
import BaseComp from "./external/BaseComp";
const { ccclass, property } = cc._decorator;
@ccclass
export default class TestFakeData extends BaseComp {
protected onLoad(): void {
console.log('ken666::TestFakeData::onLoad()')
cc.tween(new cc.Node())
.delay(3)
.call(() => {
let data: Array<IDroneInfo> = [
{
droneName: '無人機A',
sort: 0,
id: 'Fly-A'
},
{
droneName: '無人機F',
sort: 5,
id: 'Fly-F'
},
{
droneName: '無人機E',
sort: 4,
id: 'Fly-E'
},
{
droneName: '無人機D',
sort: 3,
id: 'Fly-D'
},
{
droneName: '無人機H',
sort: 7,
id: 'Fly-H'
},
{
droneName: '無人機G',
sort: 6,
id: 'Fly-G'
},
{
droneName: '無人機B',
sort: 1,
id: 'Fly-B'
},
{
droneName: '無人機C',
sort: 2,
id: 'Fly-C'
},
]
console.log('ken666::delay3 send Drone_Event.DRONE_LIST')
this.emit(Drone_Event.DRONE_LIST, data)
})
.start()
cc.tween(new cc.Node())
.delay(1)
.call(() => {
let data: Array<IDroneLocationInfo> = [
{
id: 'Fly-A',
bettery: 10,
locationN: `12'34'56.7""`,
locationE: `98'76'54.0123""`
},
{
id: 'Fly-B',
bettery: 87,
locationN: `64'31'3.14""`,
locationE: `55'66'11""`
},
{
id: 'Fly-C',
bettery: 49,
locationN: `72'38'18.2""`,
locationE: `47'10'2.01""`
},
{
id: 'Fly-D',
bettery: 51,
locationN: `25'68'54.1""`,
locationE: `12'14'74""`
},
{
id: 'Fly-E',
bettery: 50,
locationN: `19'85'12.14""`,
locationE: `7'4'12.14""`
},
{
id: 'Fly-F',
bettery: 100,
locationN: `91'20'3.1""`,
locationE: `700'600'5.2""`
},
{
id: 'Fly-G',
bettery: 0,
locationN: `10'20'3.0""`,
locationE: `4'5'9.99""`
},
{
id: 'Fly-H',
bettery: 1,
locationN: `8'7'8.7""`,
locationE: `3'3'1.2""`
},
]
console.log('ken666::delay3 send Drone_Event.DRONE_DETAIL')
this.emit(Drone_Event.DRONE_DETAIL, data)
})
.start()
}
}