| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- cc.Class({
- extends: cc.Component,
- properties: {
- HammerPrefab: {
- default: null,
- type: cc.Prefab,
- },
- SpawnPoint: {
- default: null,
- type: cc.Node,
- },
- },
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {},
- // start() {
- // },
- onCreateHammer() {
- let highwayTemp = cc.instantiate(this.HammerPrefab);
- let tempPos = this.SpawnPoint.convertToNodeSpace(GlobalD.game.MainCamera.node);
- let CanvasPos = GlobalD.game.Canvas.position;
- highwayTemp.setPosition(tempPos.x + CanvasPos.x, tempPos.y + CanvasPos.y);
- highwayTemp.parent = this.SpawnPoint;
- // cc.log('onButtonEvent_Building_Close');
- //收起菜单
- GlobalD.game._ManageUIScript.onButtonEvent_Building_Close();
- // //收起菜单
- // GlobalD.game._ManageUIScript.onHideMenu();
- },
- });
|