"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ShowBabylonInspectorPM = void 0;
const core_1 = require("@vived/core");
const BabylonEntity_1 = require("../Entities/BabylonEntity");
class ShowBabylonInspectorPM extends core_1.AppObjectPM {
    vmsAreEqual(a, b) {
        return a === b;
    }
    constructor(appObject) {
        super(appObject, ShowBabylonInspectorPM.type);
        this.onBabylonChange = () => {
            if (!this.babylon)
                return;
            this.doUpdateView(this.babylon.showInspector);
        };
        this.babylon = appObject.getComponent(BabylonEntity_1.BabylonEntity.type);
        if (!this.babylon) {
            this.warn("ShowBabylonInspectorPM has been added to something without a BabylonEntity");
            return;
        }
        this.babylon.addChangeObserver(this.onBabylonChange);
        this.onBabylonChange();
    }
}
exports.ShowBabylonInspectorPM = ShowBabylonInspectorPM;
ShowBabylonInspectorPM.type = "ShowBabylonInspectorPM";
//# sourceMappingURL=ShowBabylonInspectorPM.js.map