Add model & behavior archive function #44
@ -31,6 +31,7 @@ function randomColor(unNormal: boolean = false) {
|
|||||||
|
|
||||||
interface IStatusEvent {
|
interface IStatusEvent {
|
||||||
fileSave: void;
|
fileSave: void;
|
||||||
|
fileLoad: void;
|
||||||
renderLoop: number;
|
renderLoop: number;
|
||||||
physicsLoop: number;
|
physicsLoop: number;
|
||||||
mouseModChange: void;
|
mouseModChange: void;
|
||||||
@ -146,6 +147,18 @@ class Status extends Emitter<IStatusEvent> {
|
|||||||
|
|
||||||
// 映射文件状态改变事件
|
// 映射文件状态改变事件
|
||||||
this.archive.on("fileSave", () => this.emit("fileSave"));
|
this.archive.on("fileSave", () => this.emit("fileSave"));
|
||||||
|
|
||||||
|
// 处理存档加载事件
|
||||||
|
this.archive.on("fileLoad", () => {
|
||||||
|
|
||||||
|
// 触发对象修改
|
||||||
|
this.emit("objectChange");
|
||||||
|
this.emit("labelChange");
|
||||||
|
this.emit("behaviorChange");
|
||||||
|
|
||||||
|
// 映射
|
||||||
|
this.emit("fileLoad");
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public bindRenderer(renderer: AbstractRenderer) {
|
public bindRenderer(renderer: AbstractRenderer) {
|
||||||
|
@ -55,8 +55,10 @@ class SimulatorDesktop extends Component {
|
|||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
(window as any).setting = this.setting;
|
(window as any).LT = {
|
||||||
(window as any).status = this.status;
|
status: this.status,
|
||||||
|
setting: this.setting
|
||||||
|
};
|
||||||
|
|
||||||
this.electron = {} as ISimulatorAPI;
|
this.electron = {} as ISimulatorAPI;
|
||||||
if ((window as any).API) {
|
if ((window as any).API) {
|
||||||
|
@ -76,7 +76,7 @@ class SimulatorWeb extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 鱼群模型测试
|
// 鱼群模型测试
|
||||||
if (true) {
|
if (false) {
|
||||||
let fish1 = this.status.newGroup();
|
let fish1 = this.status.newGroup();
|
||||||
let fish2 = this.status.newGroup();
|
let fish2 = this.status.newGroup();
|
||||||
let shark = this.status.newGroup();
|
let shark = this.status.newGroup();
|
||||||
|
Loading…
Reference in New Issue
Block a user