# CocosEngine2.x **Repository Path**: starryplay/cocos-engine-2x ## Basic Information - **Project Name**: CocosEngine2.x - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-27 - **Last Updated**: 2025-02-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CocosCreator 2.4.13 自定义引擎 ## 使用方式 ### 1.下载此项目到本地 ### 2.打开Creator 编辑器 #### ① 点击菜单栏的 文件 -> 设置 ![image](./images/1.png) #### ② 点击 设置 -> 原生开发环境 ![image](./images/2.png) #### ③ 点击 引擎路径 ![image](./images/3.png) #### ④ 选择刚刚下载的引擎存放目录 ![image](./images/4.png) #### ⑤ 点击 确定,重启creator编辑器 ## 修改`creator.d.ts` ### 针对按钮组件添加了点击间隔功能 - 需要在`creator.d.ts`文件中添加以下代码 ```typescript // 添加以下代码 export class Button extends Component implements GraySpriteState { //省略之前代码 //添加以下代码, 方便Button类能访问改属性 clickInterval: number; } ``` ### 使用方式 ```typescript //获取到你的按钮组件 const button = this.node.getComponent(cc.Button); //设置点击间隔 button.clickInterval = 2; //设置点击间隔为2秒 ```