"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const godot_1 = require("godot");
const godot_annotations_1 = require("godot.annotations");
const player_1 = __importDefault(require("./player"));
const message_bus_1 = __importDefault(require("./message_bus"));
class CameraTrigger extends godot_1.Area3D {
    _ready() {
        this._camera = this.get_node(this.camera);
    }
    _on_body_entered(body) {
        var _a;
        if (body instanceof player_1.default) {
            (_a = this._camera) === null || _a === void 0 ? void 0 : _a.make_current();
            console.log(message_bus_1.default.instance.active_camera_changed);
            message_bus_1.default.instance.active_camera_changed.emit(this._camera);
        }
    }
}
exports.default = CameraTrigger;
__decorate([
    (0, godot_annotations_1.export_)(godot_1.Variant.Type.TYPE_NODE_PATH)
], CameraTrigger.prototype, "camera", void 0);
//# sourceMappingURL=camera_trigger.js.map