烟感设备调整
This commit is contained in:
parent
f4812c7187
commit
dee2b5ca7f
|
@ -1,8 +1,8 @@
|
||||||
import { GraphicData, JlGraphic, JlGraphicTemplate } from 'jl-graphic';
|
import { GraphicData, JlGraphic, JlGraphicTemplate } from 'jl-graphic';
|
||||||
import { Assets, Sprite, Spritesheet, Texture } from 'pixi.js';
|
import { Assets, Sprite, Spritesheet, Texture } from 'pixi.js';
|
||||||
// import { iscsGraphicData } from 'src/protos/iscs_graphic_data';
|
// import { iscsGraphicData } from 'src/protos/iscs_graphic_data';
|
||||||
import SmokeDetectorJson from './SmokeDetector.json';
|
import FasDeviceJson from '../pndDevice/PngDevice.json';
|
||||||
import SmokeDetectorAsset from './SmokeDetector.png';
|
import FasDeviceAssets from '../pndDevice/FasDevice.png';
|
||||||
|
|
||||||
export interface ISmokeDetectorData extends GraphicData {
|
export interface ISmokeDetectorData extends GraphicData {
|
||||||
get code(): string;
|
get code(): string;
|
||||||
|
@ -11,6 +11,11 @@ export interface ISmokeDetectorData extends GraphicData {
|
||||||
|
|
||||||
interface SmokeDetectorTextures {
|
interface SmokeDetectorTextures {
|
||||||
normal: Texture;
|
normal: Texture;
|
||||||
|
fireAlarm: Texture;
|
||||||
|
isolate: Texture;
|
||||||
|
fault: Texture;
|
||||||
|
forewarning: Texture;
|
||||||
|
interruption: Texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SmokeDetector extends JlGraphic {
|
export class SmokeDetector extends JlGraphic {
|
||||||
|
@ -52,11 +57,16 @@ export class SmokeDetectorTemplate extends JlGraphicTemplate<SmokeDetector> {
|
||||||
throw new Error('资源未加载/加载失败');
|
throw new Error('资源未加载/加载失败');
|
||||||
}
|
}
|
||||||
async loadAssets(): Promise<SmokeDetectorTextures> {
|
async loadAssets(): Promise<SmokeDetectorTextures> {
|
||||||
const texture = await Assets.load(SmokeDetectorAsset);
|
const texture = await Assets.load(FasDeviceAssets);
|
||||||
const smokeDetectorSheet = new Spritesheet(texture, SmokeDetectorJson);
|
const smokeDetectorSheet = new Spritesheet(texture, FasDeviceJson);
|
||||||
const result = await smokeDetectorSheet.parse();
|
const result = await smokeDetectorSheet.parse();
|
||||||
this.smokeDetectorTextures = {
|
this.smokeDetectorTextures = {
|
||||||
normal: result['normal.png'],
|
normal: result['smokeDetectorNormal.png'],
|
||||||
|
fireAlarm: result['smokeDetectorFireAlarm.png'],
|
||||||
|
isolate: result['smokeDetectorIsolate.png'],
|
||||||
|
fault: result['smokeDetectorFault.png'],
|
||||||
|
forewarning: result['smokeDetectorForewarning.png'],
|
||||||
|
interruption: result['smokeDetectorInterruption.png'],
|
||||||
};
|
};
|
||||||
return this.smokeDetectorTextures as SmokeDetectorTextures;
|
return this.smokeDetectorTextures as SmokeDetectorTextures;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue