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