1234567 |
- {
- "code": "import { SettingController, SoundType } from \"../../GameLogic/SettingController\";\r\nexport default class ImageRunTime extends Laya.Image {\r\n constructor() {\r\n super();\r\n this.scaleTime = 80;\r\n this.clickId = false;\r\n this.on(Laya.Event.MOUSE_DOWN, this, this.scaleSmall);\r\n this.on(Laya.Event.MOUSE_OVER, this, this.overs);\r\n this.on(Laya.Event.MOUSE_UP, this, this.scaleBig);\r\n this.on(Laya.Event.MOUSE_OUT, this, this.mouseout);\r\n }\r\n scaleBig(e) {\r\n if (!this.clickId)\r\n return;\r\n this.clickId = false;\r\n SettingController.Instance.PlaySound(SoundType.click);\r\n this.alpha = 1;\r\n if (this.CZ) {\r\n this.CZ();\r\n }\r\n }\r\n overs() {\r\n this.alpha = 0.7;\r\n }\r\n mouseout() {\r\n this.alpha = 1;\r\n }\r\n scaleSmall(e) {\r\n this.clickId = true;\r\n }\r\n onDestroy() {\r\n this.ClearRunTime();\r\n }\r\n ClearRunTime() {\r\n this.off(Laya.Event.MOUSE_DOWN, this, this.scaleSmall);\r\n this.off(Laya.Event.MOUSE_UP, this, this.scaleBig);\r\n this.off(Laya.Event.MOUSE_OUT, this, this.mouseout);\r\n this.CZ = null;\r\n }\r\n}\r\n",
- "references": [
- "D:/GitProject/GunGang/gungang_laya/gungang/src/GameLogic/SettingController.ts"
- ]
- }
|