Content_Clear.js 926 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. HammerPrefab: {
  5. default: null,
  6. type: cc.Prefab,
  7. },
  8. SpawnPoint: {
  9. default: null,
  10. type: cc.Node,
  11. },
  12. },
  13. // LIFE-CYCLE CALLBACKS:
  14. // onLoad () {},
  15. // start() {
  16. // },
  17. onCreateHammer() {
  18. let highwayTemp = cc.instantiate(this.HammerPrefab);
  19. let tempPos = this.SpawnPoint.convertToNodeSpace(GlobalD.game.MainCamera.node);
  20. let CanvasPos = GlobalD.game.Canvas.position;
  21. highwayTemp.setPosition(tempPos.x + CanvasPos.x, tempPos.y + CanvasPos.y);
  22. highwayTemp.parent = this.SpawnPoint;
  23. // cc.log('onButtonEvent_Building_Close');
  24. //收起菜单
  25. GlobalD.game._ManageUIScript.onButtonEvent_Building_Close();
  26. // //收起菜单
  27. // GlobalD.game._ManageUIScript.onHideMenu();
  28. },
  29. });