436fd004-bc32-4758-be17-d5b4b6ca8dbb.js
2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"use strict";
cc._RF.push(module, '436fdAEvDJHWL4X1bS2yo27', 'BlockSkillBombView');
// scripts/prefabs/BlockSkillBombView.ts
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.BlockSkillBombView = void 0;
var Global_1 = require("../Global");
var BattleConst_1 = require("../kernel/battle/BattleConst");
var GlobalNode_1 = require("../kernel/GlobalNode");
var BlockSkillViewBase_1 = require("./BlockSkillViewBase");
var BlockSkillBombView = /** @class */ (function (_super) {
__extends(BlockSkillBombView, _super);
function BlockSkillBombView(owner, mapView) {
var _this = _super.call(this, owner, mapView) || this;
_this._spIdleNode = cc.instantiate(mapView.prefabCollection.getChildByName('skillSpine').getChildByName('game_bomb01'));
_this._spBoomNode = cc.instantiate(mapView.prefabCollection.getChildByName('skillSpine').getChildByName('game_boom01'));
_this.onPositionChange(_this._owner.owner.pixelPos.x, _this._owner.owner.pixelPos.y);
_this._spBoomNode.active = false;
_this._spIdleNode.active = true;
mapView.effectLayer.addChild(_this._spBoomNode);
mapView.effectLayer.addChild(_this._spIdleNode);
_this._spIdleNode.getComponent(sp.Skeleton).setAnimation(0, 'animation', true);
return _this;
}
BlockSkillBombView.prototype.onPositionChange = function (x, y) {
this._spBoomNode.setPosition(x, y);
this._spIdleNode.setPosition(x, y);
};
BlockSkillBombView.prototype.onDead = function () {
var _this = this;
_super.prototype.onDead.call(this);
this._spIdleNode.destroy();
this._spBoomNode.active = true;
this._spBoomNode.getComponent(sp.Skeleton).setCompleteListener(function () {
_this._spBoomNode.destroy();
});
this._spBoomNode.getComponent(sp.Skeleton).setAnimation(0, 'animation', false);
//震屏
BattleConst_1.getGlobalNode().emit(Global_1.GlobalEvent.SHAKE, true);
BattleConst_1.getGlobalNode().getComponent(GlobalNode_1.default).scheduleOnce(function () { BattleConst_1.getGlobalNode().emit(Global_1.GlobalEvent.SHAKE, false); }, 0.3); //0.5秒后关闭
};
return BlockSkillBombView;
}(BlockSkillViewBase_1.BlcokSkillViewBase));
exports.BlockSkillBombView = BlockSkillBombView;
cc._RF.pop();