├── doc ├── Plugin │ ├── PlugTableView.md │ ├── PlugProgressBar.md │ └── PlugTableViewCell.md ├── Home.md └── Behavior │ ├── ui │ ├── BhvZIndex.md │ ├── BhvPopAnimate.md │ ├── BhvRollNumber.md │ ├── BhvTextTimer.md │ ├── BhvEventSender.md │ ├── BhvPin.md │ ├── BhvLayoutCircle.md │ ├── BhvFrameIndex.md │ ├── BhvAutoSizeFill.md │ ├── BhvFrameAnimation.md │ └── BhvTextTyping.md │ ├── movement │ ├── BhvRotate.md │ ├── BhvBullet.md │ ├── BhvCar.md │ ├── BhvCircle.md │ ├── BhvDirection8.md │ ├── BhvChains.md │ ├── BhvShake.md │ └── BhvSine.md │ ├── general │ ├── BhvTimer.md │ ├── BhvFade.md │ ├── BhvLine.md │ ├── BhvSightSensor.md │ ├── BhvAutoDestroy.md │ ├── BhvSendEvent.md │ └── BhvCameraExtra.md │ ├── input │ ├── BhvDragDrop.md │ └── BhvDropArea.md │ └── logic │ └── BhvFSM.md ├── project.json ├── assets ├── Texture │ ├── icon.png │ ├── icon000.png │ ├── icon001.png │ ├── icon002.png │ ├── icon003.png │ ├── icon_shop.png │ ├── icon_warn.png │ ├── icon_delete.png │ ├── line_texture.png │ ├── circle_texture.png │ ├── line_texture _full.png │ ├── result_chest_light.png │ ├── icon.png.meta │ ├── icon000.png.meta │ ├── icon001.png.meta │ ├── icon002.png.meta │ ├── icon003.png.meta │ ├── icon_shop.png.meta │ ├── icon_warn.png.meta │ ├── icon_delete.png.meta │ ├── line_texture.png.meta │ ├── circle_texture.png.meta │ ├── line_texture _full.png.meta │ └── result_chest_light.png.meta ├── Scene.meta ├── Test.meta ├── Behavior.meta ├── Plugin.meta ├── Plugin │ ├── ui.meta │ ├── base.meta │ ├── demo.meta │ ├── effect.meta │ ├── input.meta │ ├── window.meta │ ├── ui │ │ ├── PopTalkBox.prefab.meta │ │ ├── TestCell.prefab.meta │ │ ├── PlugPreloader.prefab.meta │ │ ├── PlugProgressBar.prefab.meta │ │ ├── PlugTableView.prefab.meta │ │ ├── TestCell.ts.meta │ │ ├── TestMenu.ts.meta │ │ ├── PlugPreloader.ts.meta │ │ ├── PlugTableView.ts.meta │ │ ├── PlugProgressBar.ts.meta │ │ ├── PlugTableViewCell.ts.meta │ │ ├── PlugPreloader.ts │ │ ├── TestCell.ts │ │ ├── TestMenu.ts │ │ ├── PlugProgressBar.ts │ │ └── PlugTableViewCell.ts │ ├── base │ │ └── BarNumberLeft.prefab.meta │ ├── demo │ │ ├── BoundWrapLoop.prefab.meta │ │ └── DemoDropList.prefab.meta │ ├── window │ │ └── PopTalkBox.prefab.meta │ ├── effect │ │ └── RotateCoinEffect.prefab.meta │ └── input │ │ ├── BhvKeyboard.ts.meta │ │ └── BhvTouchInput.ts.meta ├── Prefab.meta ├── Scene │ ├── FSM.meta │ ├── ui.meta │ ├── DragDrop.meta │ ├── input.meta │ ├── movement.meta │ ├── PlatformJump.meta │ ├── input │ │ ├── DragDrop.meta │ │ ├── DemoDragDrop.fire.meta │ │ ├── DemoDropArea.fire.meta │ │ ├── DemoKeyBoard.fire.meta │ │ ├── DemoKeyBoard.ts.meta │ │ ├── DragDrop │ │ │ ├── DragCopy.ts.meta │ │ │ ├── CellItemSlot.ts.meta │ │ │ └── DragCopy.ts │ │ └── DemoKeyBoard.ts │ ├── DemoChains.fire.meta │ ├── DemoPin.fire.meta │ ├── DemoShake.fire.meta │ ├── DemoSine.fire.meta │ ├── ui │ │ ├── DemoPin.fire.meta │ │ ├── DemoAtlasFrame.fire.meta │ │ ├── DemoRollNumber.fire.meta │ │ ├── DemoValueSnyc.fire.meta │ │ └── DemoAtlasFrame.fire │ ├── DemoDropArea.fire.meta │ ├── DemoFollower.fire.meta │ ├── DemoRollNumber.fire.meta │ ├── DemoValueSnyc.fire.meta │ ├── FSM │ │ ├── DemoFSM.fire.meta │ │ ├── DemoFSM.ts.meta │ │ └── DemoFSM.ts │ ├── movement │ │ ├── DemoBullet.fire.meta │ │ ├── DemoCar.fire.meta │ │ ├── DemoCircle.fire.meta │ │ ├── DemoShake.fire.meta │ │ ├── DemoSine.fire.meta │ │ ├── DemoAreaTransfer.fire.meta │ │ ├── DemoDirection8.fire.meta │ │ └── DemoFollower.fire.meta │ ├── DragDrop │ │ ├── DemoDragDrop.fire.meta │ │ ├── DragCopy.ts.meta │ │ ├── CellItemSlot.ts.meta │ │ └── DragCopy.ts │ └── PlatformJump │ │ ├── DemoPlatform.fire.meta │ │ ├── PlaformJumpCtrl.ts.meta │ │ └── PlaformJumpCtrl.ts ├── Script.meta ├── Texture.meta ├── resources.meta ├── Behavior │ ├── demo.meta │ ├── input.meta │ ├── logic.meta │ ├── ui.meta │ ├── animate.meta │ ├── general.meta │ ├── movement.meta │ ├── ui │ │ ├── BhvPin.ts.meta │ │ ├── BhvAutoFrame.ts.meta │ │ ├── BhvTextTimer.ts.meta │ │ ├── BhvValueSnyc.ts.meta │ │ ├── BhvZIndex.ts.meta │ │ ├── BhvAtlasFrame.ts.meta │ │ ├── BhvAutoSizeFill.ts.meta │ │ ├── BhvColorIndex.ts.meta │ │ ├── BhvEventSender.ts.meta │ │ ├── BhvFrameIndex.ts.meta │ │ ├── BhvGroupToggle.ts.meta │ │ ├── BhvLayoutCircle.ts.meta │ │ ├── BhvProgressLimit.ts.meta │ │ ├── BhvRollCustom.ts.meta │ │ ├── BhvRollNumber.ts.meta │ │ ├── BhvTextTyping.ts.meta │ │ ├── BhvZIndex.ts │ │ ├── BhvAutoSizeFill.ts │ │ ├── BhvColorIndex.ts │ │ ├── BhvLayoutCircle.ts │ │ ├── BhvFrameIndex.ts │ │ ├── BhvAtlasFrame.ts │ │ ├── BhvProgressLimit.ts │ │ ├── BhvValueSnyc.ts │ │ ├── BhvGroupToggle.ts │ │ └── BhvAutoFrame.ts │ ├── general │ │ ├── BhvFade.ts.meta │ │ ├── BhvLine.ts.meta │ │ ├── BhvWrap.ts.meta │ │ ├── BhvBoundary.ts.meta │ │ ├── BhvTimer.ts.meta │ │ ├── BhvAfterImage.ts.meta │ │ ├── BhvAudioSource.ts.meta │ │ ├── BhvAutoDestroy.ts.meta │ │ ├── BhvAutoEmitter.ts.meta │ │ ├── BhvBoundLayout.ts.meta │ │ ├── BhvCameraExtra.ts.meta │ │ ├── BhvSightSensor.ts.meta │ │ ├── BhvAutoEmitter.ts │ │ ├── BhvLine.ts │ │ ├── BhvFade.ts │ │ ├── BhvBoundLayout.ts │ │ ├── BhvAfterImage.ts │ │ ├── BhvAudioSource.ts │ │ ├── BhvAutoDestroy.ts │ │ └── BhvWrap.ts │ ├── logic │ │ ├── BhvFSM.ts.meta │ │ ├── BhvTimer.ts.meta │ │ ├── BhvEmitter.ts.meta │ │ ├── BhvEventSender.ts.meta │ │ ├── BhvValueSnyc.ts.meta │ │ ├── BhvEmitter.ts │ │ └── BhvValueSnyc.ts │ ├── movement │ │ ├── BhvCar.ts.meta │ │ ├── BhvBullet.ts.meta │ │ ├── BhvCircle.ts.meta │ │ ├── BhvMoveTo.ts.meta │ │ ├── BhvPlatform.ts.meta │ │ ├── BhvRotate.ts.meta │ │ ├── BhvRotateTo.ts.meta │ │ ├── BhvShake.ts.meta │ │ ├── BhvSine.ts.meta │ │ ├── BhvSnake.ts.meta │ │ ├── BhvAreaTransfer.ts.meta │ │ ├── BhvDirection8.ts.meta │ │ ├── BhvRotate.ts │ │ ├── BhvAreaTransfer.ts │ │ ├── BhvCircle.ts │ │ ├── BhvRotateTo.ts │ │ ├── BhvSnake.ts │ │ └── BhvShake.ts │ ├── animate │ │ ├── BhvEaseTween.ts.meta │ │ ├── BhvIconFlyTo.ts.meta │ │ ├── commonTween.ts.meta │ │ ├── BhvGroupTween.ts.meta │ │ ├── BhvPopAnimate.ts.meta │ │ ├── BhvSwitchPage.ts.meta │ │ ├── BhvAnimationHelper.ts.meta │ │ ├── BhvAnimationHelper.ts │ │ └── BhvGroupTween.ts │ ├── demo │ │ ├── BhvAfterImage.ts.meta │ │ └── BhvAfterImage.ts │ └── input │ │ ├── BhvButtonGroup.ts.meta │ │ ├── BhvDragDrop.ts.meta │ │ ├── BhvDropArea.ts.meta │ │ ├── BhvInputArea.ts.meta │ │ ├── BhvKeyboard.ts.meta │ │ ├── BhvTouchInput.ts.meta │ │ └── BhvInputArea.ts ├── Script │ ├── Data.meta │ ├── Global.meta │ ├── Data │ │ ├── DataManager.ts.meta │ │ ├── SceneManager.ts.meta │ │ ├── SoundManager.ts.meta │ │ ├── UserSaveData.ts.meta │ │ ├── DataInterface.ts.meta │ │ ├── SpriteManager.ts.meta │ │ ├── SpriteManager.ts │ │ └── SceneManager.ts │ └── Global │ │ └── StateMachine.ts.meta ├── Test │ ├── PlatformJump.meta │ ├── DemoChains.fire.meta │ ├── DemoSpring.fire.meta │ ├── PlatformJump │ │ ├── DemoPlatform.fire.meta │ │ ├── PlaformJumpCtrl.ts.meta │ │ └── PlaformJumpCtrl.ts │ ├── BhvSnake.ts.meta │ ├── BhvSpring.ts.meta │ ├── BhvChainGroup.ts.meta │ ├── BhvChainGroup2.ts.meta │ ├── BhvFollower.ts.meta │ ├── BhvJumpDrop.ts.meta │ ├── BhvPlatform.ts.meta │ ├── BhvSpringGroup.ts.meta │ ├── BhvJumpDrop.ts │ ├── BhvFollower.ts │ ├── BhvChainGroup.ts │ ├── BhvSpring.ts │ ├── BhvChainGroup2.ts │ ├── BhvSnake.ts │ └── BhvSpringGroup.ts └── Prefab │ ├── GodModeMenu.prefab.meta │ ├── GodModeMenu.ts.meta │ └── GodModeMenu.ts ├── jsconfig.json ├── README.md ├── settings └── project.json ├── LICENSE └── .gitignore /doc/Plugin/PlugTableView.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/Home.md: -------------------------------------------------------------------------------- 1 | 具体使用方法的更新文档 2 | 3 | -------------------------------------------------------------------------------- /doc/Plugin/PlugProgressBar.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/Plugin/PlugTableViewCell.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /project.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine": "cocos-creator-js", 3 | "packages": "packages" 4 | } -------------------------------------------------------------------------------- /assets/Texture/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wsssheep/cc_easy_script/HEAD/assets/Texture/icon.png -------------------------------------------------------------------------------- /assets/Texture/icon000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wsssheep/cc_easy_script/HEAD/assets/Texture/icon000.png -------------------------------------------------------------------------------- /assets/Texture/icon001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wsssheep/cc_easy_script/HEAD/assets/Texture/icon001.png -------------------------------------------------------------------------------- /assets/Texture/icon002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wsssheep/cc_easy_script/HEAD/assets/Texture/icon002.png -------------------------------------------------------------------------------- /assets/Texture/icon003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wsssheep/cc_easy_script/HEAD/assets/Texture/icon003.png -------------------------------------------------------------------------------- /assets/Texture/icon_shop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wsssheep/cc_easy_script/HEAD/assets/Texture/icon_shop.png -------------------------------------------------------------------------------- /assets/Texture/icon_warn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wsssheep/cc_easy_script/HEAD/assets/Texture/icon_warn.png -------------------------------------------------------------------------------- /assets/Texture/icon_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wsssheep/cc_easy_script/HEAD/assets/Texture/icon_delete.png -------------------------------------------------------------------------------- /assets/Texture/line_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wsssheep/cc_easy_script/HEAD/assets/Texture/line_texture.png -------------------------------------------------------------------------------- /assets/Texture/circle_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wsssheep/cc_easy_script/HEAD/assets/Texture/circle_texture.png -------------------------------------------------------------------------------- /assets/Texture/line_texture _full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wsssheep/cc_easy_script/HEAD/assets/Texture/line_texture _full.png -------------------------------------------------------------------------------- /assets/Texture/result_chest_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wsssheep/cc_easy_script/HEAD/assets/Texture/result_chest_light.png -------------------------------------------------------------------------------- /assets/Scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "c46d5583-6d29-4780-9fd5-3b42ce7c96b9", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Test.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "73abb00e-4cb9-4801-9e0d-ce3e2355657a", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Behavior.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "fd040efe-dd00-4811-b83e-45f8ce488131", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Plugin.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "2d88583f-7591-4127-b981-6d20b394b1e9", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Plugin/ui.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "37142bbb-800b-4ca2-bdbb-1160266a0c13", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "472dcb4d-8119-4e48-96df-d92d51eda6d6", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/FSM.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "eae0eac7-5440-4e0d-87e3-058367997c6d", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/ui.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "068217e1-90ce-4329-9632-8efbe9ab7b69", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Script.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "659579d6-5db1-40e0-afdf-20f44532bed4", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Texture.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "980dfc4d-169b-4023-936c-9f28d286dabf", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/resources.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "96d77259-30bc-4c72-a811-3d145c82a4ea", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Behavior/demo.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "0e12b1c5-ee21-4050-9a81-26be86e0d05c", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Behavior/input.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "df7e5081-1a00-47fd-b724-dc9913d5ceb1", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Behavior/logic.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "a6253e48-a108-4748-8d85-c5225923d6e6", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Behavior/ui.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "1f123d96-60be-4daf-be6c-9e652e02d01f", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Plugin/base.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "a40c6e06-e011-4508-940f-c63aacc06a35", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Plugin/demo.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "3ae4e9f5-88a6-4347-be43-351894f7d0f5", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Plugin/effect.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "7fb9b186-10e9-4254-9cd0-032cb90f2f05", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Plugin/input.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "04215f4a-d824-4d55-89c3-15630a56311b", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Plugin/window.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "daca8657-867c-4c79-b529-c256794f4077", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/DragDrop.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "5be2a198-a517-433f-a94c-f40261f76ecc", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/input.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "86a6df75-c5b9-4db4-b9ba-6ab987bc7524", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/movement.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "a96f9c27-77b3-4168-aaf1-cccb55fa2d10", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Script/Data.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "33b54cc8-eca0-4334-85fe-53c0663f26bc", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Script/Global.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "1440164a-256a-41b3-b0f4-5125f4860f13", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Behavior/animate.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "9ebaa357-de86-4f73-9d4e-701508416523", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Behavior/general.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "16e47d50-fdbf-4889-8a78-fbab3399a25f", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Behavior/movement.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "f42e24a7-99e5-4aac-a9aa-6976dc282ab8", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/PlatformJump.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "34f98b83-23c0-47dc-bc34-5c3a66eb42bf", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/input/DragDrop.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "ce5e788b-bf76-4502-8ae1-a506dda6d7f9", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Test/PlatformJump.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "5f08364c-bc4a-4195-a2a9-270d21fc2df4", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /doc/Behavior/ui/BhvZIndex.md: -------------------------------------------------------------------------------- 1 | Bhv ZIndex 2 | 3 | ### 介绍 4 | 5 | 调整组件Z轴顺序。 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /doc/Behavior/movement/BhvRotate.md: -------------------------------------------------------------------------------- 1 | Bhv Rotate 2 | 3 | ### 介绍 4 | 5 | 自动旋转行为。 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /assets/Scene/DemoChains.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "326034b4-bf0a-4df9-b0cd-c597288f0192", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/DemoPin.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "6ffafe8c-89ed-4633-b76f-4fcc6b77d89f", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/DemoShake.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "f567eff5-2bf3-4477-ab00-d718a1e88339", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/DemoSine.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "2da9cf8d-70de-4603-bef0-4c46ce897f35", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/ui/DemoPin.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "2eef3ca1-92c6-4dc0-960b-db4675df96e3", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Test/DemoChains.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "c313a967-fcfd-47e2-95d6-1cc486b65b12", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Test/DemoSpring.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "c7dc87e2-d0da-44c5-92a6-8e622a5ffb74", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /doc/Behavior/general/BhvTimer.md: -------------------------------------------------------------------------------- 1 | Bhv Timer 2 | 3 | ### 介绍 4 | 5 | 计时器,循环间隔调用的计时器。 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /doc/Behavior/movement/BhvBullet.md: -------------------------------------------------------------------------------- 1 | Bhv Bullet 2 | 3 | ### 介绍 4 | 5 | 子弹行为。不断前进的子弹。 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /doc/Behavior/movement/BhvCar.md: -------------------------------------------------------------------------------- 1 | Bhv Car 2 | 3 | ### 介绍 4 | 5 | 车行为,漂移,加速,秋名山车神。 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /doc/Behavior/movement/BhvCircle.md: -------------------------------------------------------------------------------- 1 | Bhv Circle 2 | 3 | ### 介绍 4 | 5 | 固定坐标,围绕圆周运动。 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /doc/Behavior/movement/BhvDirection8.md: -------------------------------------------------------------------------------- 1 | Bhv Direction8 2 | 3 | ### 介绍 4 | 5 | 8方向运动 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /doc/Behavior/ui/BhvPopAnimate.md: -------------------------------------------------------------------------------- 1 | Bhv PopAnimate 2 | 3 | ### 介绍 4 | 5 | 开箱即用的快捷弹窗动画。 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /assets/Scene/DemoDropArea.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "908d0b95-fd3e-44da-b807-a81edeb4020e", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/DemoFollower.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "b4a47618-8371-4ee0-aad9-e13a6fd6469c", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/DemoRollNumber.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "fd668d57-dbd6-4875-83b1-a169b09ec718", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/DemoValueSnyc.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "8220dd4f-ab15-414b-bb8a-1aa563adaad8", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/FSM/DemoFSM.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "3be44d3e-a600-44c3-bf1a-b759da0d8c4d", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /doc/Behavior/input/BhvDragDrop.md: -------------------------------------------------------------------------------- 1 | Bhv DragDrop 2 | 3 | ### 介绍 4 | 5 | 方便的对节点进行拖拽放置的行为 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /doc/Behavior/movement/BhvChains.md: -------------------------------------------------------------------------------- 1 | Bhv Chains 2 | 3 | ### 介绍 4 | 5 | 锁链行为,将节点关系链接在一起 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /assets/Plugin/ui/PopTalkBox.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "35195d20-c589-4bcb-b012-8fa82666d5de", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Plugin/ui/TestCell.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "1431dde9-59ef-4010-bbf4-c8c572413e77", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Prefab/GodModeMenu.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "ba77e82a-edb5-4b1a-9cdd-7eee122b40c1", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/input/DemoDragDrop.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "2241520d-e581-40a6-b1be-6649338814cf", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/input/DemoDropArea.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "0df77782-578f-46cb-9ab9-03c131a9024f", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/input/DemoKeyBoard.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "7f8d243a-a35e-4c1f-b126-a0adaf6aafa5", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/movement/DemoBullet.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "1145dee7-ad72-437a-a2a0-05e20d5dc888", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/movement/DemoCar.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "32c7e310-1349-42dc-b859-dafdb2cfe53f", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/movement/DemoCircle.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "f3e3fc92-a1be-4bd7-9671-e47b36a5167c", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/movement/DemoShake.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "4a51c532-c0b8-4ffe-b0fa-bbe717fcdfb6", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/movement/DemoSine.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "56ac74e7-bb87-46de-b3e4-0962b1a28ee0", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/ui/DemoAtlasFrame.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "e3aabe00-6e41-4f73-9126-ed99576d748b", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/ui/DemoRollNumber.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "88de4dd5-b69e-4174-83e9-a5e6a6d74a54", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/ui/DemoValueSnyc.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "fdc58a51-667b-4687-bd76-3e6909a16386", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /doc/Behavior/general/BhvFade.md: -------------------------------------------------------------------------------- 1 | Bhv Fade 2 | 3 | ### 介绍 4 | 5 | 自动不透明度变化(后期可以被 autoDestroy代替) 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /assets/Plugin/base/BarNumberLeft.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "a0b27c8d-a871-4601-8874-d8d614234744", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Plugin/demo/BoundWrapLoop.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "fa507f28-a323-410c-8b80-22e4b155d832", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Plugin/demo/DemoDropList.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "c361e778-7d53-49e2-99ab-6f8111854cbf", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Plugin/ui/PlugPreloader.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "fb320f7b-d538-4021-b27c-2b2f4803e7ab", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Plugin/ui/PlugProgressBar.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "4fa72704-e955-4736-9180-f8a5b20fdd48", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Plugin/ui/PlugTableView.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "08897971-4318-4359-a2d9-e147b0b09642", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Plugin/window/PopTalkBox.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "6a6cb8f3-98b3-4723-b5df-e2a9c2aafcf4", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/DragDrop/DemoDragDrop.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "42eaf9d7-670d-484b-b410-2e9ed1c8ff38", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/PlatformJump/DemoPlatform.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "54cf1972-bcee-47f5-85fe-0485a9969caf", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/movement/DemoAreaTransfer.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "1aa62337-cd30-4aa1-8925-1ffdc5f4b40d", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/movement/DemoDirection8.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "79a05a67-97e6-412d-9ebf-c82919e55efc", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scene/movement/DemoFollower.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "370e0176-0dda-4ec9-9aa2-3eaf069a8cac", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Test/PlatformJump/DemoPlatform.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "8f040f1d-d2d9-448f-bf41-e092a79489fd", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /doc/Behavior/general/BhvLine.md: -------------------------------------------------------------------------------- 1 | Bhv Line 2 | 3 | ### 介绍 4 | 5 | 自动连线,将该节点宽度缩放,连接到两个顶点。适合连线题 之类的使用 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /doc/Behavior/ui/BhvRollNumber.md: -------------------------------------------------------------------------------- 1 | Bhv Roll Number 2 | 3 | ### 介绍 4 | 5 | 自动进行数字的滚动,并且反应内容到文本内容上。 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /doc/Behavior/ui/BhvTextTimer.md: -------------------------------------------------------------------------------- 1 | Bhv Text Timer 2 | 3 | ### 介绍 4 | 5 | 显示倒计时的文本内容。当倒计时完成也会发送消息通知更新。 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /assets/Plugin/effect/RotateCoinEffect.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "286be446-e0e5-43a2-a0a7-402445340529", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /doc/Behavior/general/BhvSightSensor.md: -------------------------------------------------------------------------------- 1 | Bhv SightSensor 2 | 3 | ### 介绍 4 | 5 | 视野判断,判断目标节点是否在视野节点范围内。 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /doc/Behavior/movement/BhvShake.md: -------------------------------------------------------------------------------- 1 | Bhv Shake 2 | 3 | ### 介绍 4 | 5 | 节点震动,可以挂在摄像机上 使摄像机震动,也可以挂在节点上使节点震动 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /doc/Behavior/input/BhvDropArea.md: -------------------------------------------------------------------------------- 1 | Bhv DropArea 2 | 3 | ### 介绍 4 | 5 | 拖拽丢入区域,用于检查拖拽的节点是否投入了此节点的区域内。一般可以作为装备框使用。 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /doc/Behavior/ui/BhvEventSender.md: -------------------------------------------------------------------------------- 1 | Bhv Event Sender 2 | 3 | ### 介绍 4 | 5 | 事件传播器。用于解决不在一个节点,或者节点距离关系较远的情况。方便事件的传播。 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /doc/Behavior/ui/BhvPin.md: -------------------------------------------------------------------------------- 1 | Bhv Pin 2 | 3 | ### 介绍 4 | 5 | 绑定节点关系,如果你想要将两个节点位置绑定在一起。解决渲染批次问题,又需要绑定两个节点的关系时,可以考虑使用该组件。 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /doc/Behavior/ui/BhvLayoutCircle.md: -------------------------------------------------------------------------------- 1 | Bhv Layout Circle 2 | 3 | ### 介绍 4 | 5 | 圆形布局,可以将绑定该组件的节点的 子节点 按照圆形布局排列。适合制作轮盘UI的布局,环绕旋转的僚机等等。 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /assets/Test/BhvSnake.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "efa0634f-895c-4348-8be8-4f13e1e1998a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Test/BhvSpring.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "74e257cf-8556-4428-942e-cd701182c1e5", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /doc/Behavior/ui/BhvFrameIndex.md: -------------------------------------------------------------------------------- 1 | Bhv Frame Index 2 | 3 | ### 介绍 4 | 5 | 图片帧改变。绑定该组件后,可以添加对应的图片到 组件所属的 帧图数组中。然后通过改变改变索引值 或者名字的情况下,自动变更图片。 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvPin.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "deedd61b-fb9f-4d23-bff2-6faa7d099168", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Plugin/ui/TestCell.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "b25dd2df-b6b4-442d-a505-ab11fce14512", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Plugin/ui/TestMenu.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "680927e0-c175-4832-b966-f0fb97d40d18", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Prefab/GodModeMenu.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "6c293d0f-d9de-4c2a-820b-6061ac00935f", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scene/FSM/DemoFSM.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "3e8b0d1a-ea46-4e41-9b1f-10404443e1cb", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Test/BhvChainGroup.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "d8fe128b-e6bf-4749-94ed-30f5f4a63f06", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Test/BhvChainGroup2.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "93f0959f-5856-4f8c-a1d8-209dd4c48a3a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Test/BhvFollower.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "f3e8df16-4f8d-4d12-9c80-249e86190341", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Test/BhvJumpDrop.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "f8a3b4f4-5014-44a1-b8f0-a1a43301de12", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Test/BhvPlatform.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "118f23c3-f7a1-408f-ac38-a190797f2bbe", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Test/BhvSpringGroup.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "d2165ac1-1593-4827-929f-9543669644f1", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/general/BhvFade.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "069fd830-9753-4b99-8fce-e84ee0371864", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/general/BhvLine.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "722eed99-4f6b-4180-8c24-21f33492a837", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/general/BhvWrap.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "ff4e79eb-4b3c-47e6-83a5-7c6df89fd5eb", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/logic/BhvFSM.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "0b15e783-0f31-43c1-b982-8dbb9e5c20fd", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/logic/BhvTimer.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "378a287b-584b-4844-a751-2532f41e6fc1", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvCar.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "f0a4c64c-609a-40ef-ba09-549e7760f12c", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvAutoFrame.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "ba104d04-6a7e-4aee-8d2f-98f0aa96cfbd", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvTextTimer.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "3e49f34c-5d20-46c3-adc1-08b55bf36c0d", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvValueSnyc.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "eb806fad-aac2-4634-b094-066c7e5a669d", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvZIndex.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "fe5f1e85-0ab1-41e7-b89e-140df7ba50c5", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Plugin/input/BhvKeyboard.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "9eca5bfa-9e4e-4a64-83bd-95515b2d0bd2", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Plugin/ui/PlugPreloader.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "76301a43-e54b-4493-b644-bf5bb1e371e0", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Plugin/ui/PlugTableView.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "0e1946a4-27cb-4b37-aa53-657e8d138941", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scene/DragDrop/DragCopy.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "d196dc72-64d1-4b7a-9fdb-1fbb75bf5f4a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scene/input/DemoKeyBoard.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "b36dc840-b647-4835-a0b6-bfba04b4ecbe", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Script/Data/DataManager.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "24ec009c-5c2d-4567-8e46-d0bb8f63e7f9", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Script/Data/SceneManager.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "18bb1cb8-258f-49ea-a4e2-6df6f4df469d", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Script/Data/SoundManager.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "334a418b-7580-4322-a9d7-98595e21d0fa", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Script/Data/UserSaveData.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "505346d9-e106-446f-a90d-35866e356daa", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /doc/Behavior/ui/BhvAutoSizeFill.md: -------------------------------------------------------------------------------- 1 | Bhv Auto Size Fill 2 | 3 | ### 介绍 4 | 5 | 自动尺寸填充,和 cocos creator 提供的 UI weight 组件类似,你可以通过添加该组件,将节点尺寸填充。比如气泡对话框。 6 | 7 | ### 更新 8 | 9 | - 0.1 todo 10 | 11 | ### 编辑器 12 | 13 | - todo 14 | 15 | ### 用法 16 | 17 | - todo -------------------------------------------------------------------------------- /assets/Behavior/animate/BhvEaseTween.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "6332b37d-112e-497e-a06c-9db595866b06", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/animate/BhvIconFlyTo.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "49beda42-c483-42e3-8915-ae18dc61fa48", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/animate/commonTween.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "de884c4c-0db1-49f6-8110-e5d77027e255", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/demo/BhvAfterImage.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "fb5d0aa2-7001-4a9e-bcc3-41ae9ab29e32", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/general/BhvBoundary.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "e28cffef-7ae8-4840-85a6-6a66878cb2ee", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/general/BhvTimer.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "0b05e64e-2faf-479e-a7bf-78abf8132e30", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/input/BhvButtonGroup.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "2709afd6-7f6d-451c-a7ab-2024343f7fb8", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/input/BhvDragDrop.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "68d8d231-72a8-412f-b442-51c05ccb458e", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/input/BhvDropArea.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "267fe9e1-2c77-406a-9b43-bf98f668947e", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/input/BhvInputArea.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "2816d914-0588-445e-89e8-62a36c4845ed", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/input/BhvKeyboard.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "d2eba2c2-de4f-49ed-9da6-b762b341e6b0", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/input/BhvTouchInput.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "1a4c87f9-19d1-4127-b54a-fa0c2b94314e", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/logic/BhvEmitter.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "c2878a87-b6d8-40a3-81b8-c45fbaa6378f", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/logic/BhvEventSender.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "7b99b48c-a1d9-45ff-b67d-647e808ea82b", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/logic/BhvValueSnyc.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "b1a84262-c5e5-4a21-92ce-196f663ec134", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvBullet.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "3482c72a-d8ad-4394-af6a-d762a991b4fd", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvCircle.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "4e97d54a-ff9f-42d8-b1b4-049cc0142424", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvMoveTo.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "28ebf1a0-1bfb-4f85-89a0-45d7500e2147", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvPlatform.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "4db055cf-3dc2-41d2-b627-e576ec766761", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvRotate.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "b6d472fa-554f-4b68-b841-19a00a3d4316", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvRotateTo.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "4fd2ec32-303c-4863-b495-001f68ed92dd", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvShake.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "387a7d12-baa1-4cdb-8e52-2fcde3fa1ac8", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvSine.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "d3ea8179-ba19-4fcd-972a-8356eb0ad5e5", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvSnake.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "2af2c901-d436-4060-af9d-e485d2151d51", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvAtlasFrame.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "af1ad116-15c0-4809-b1a5-f8f227b3c2d9", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvAutoSizeFill.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "1d56552c-2d1d-4572-93c3-0bf5f2a28e33", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvColorIndex.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "ef718b16-ffba-4e2a-b52a-e3693fdbb534", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvEventSender.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "9be09e23-1f63-4c20-b4a6-fcd1e1de069b", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvFrameIndex.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "c238ec1f-2765-499d-9f06-6fc610b394ec", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvGroupToggle.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "15c78499-b801-4070-8e29-0fdd202199af", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvLayoutCircle.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "4b4b18ac-7d68-4cea-b608-0831f3064f8d", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvProgressLimit.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "ea0c6070-424b-4edd-b9e0-721e9b02f9d2", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvRollCustom.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "71fcf3bd-ea0f-4178-b6e5-31acb1e5d494", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvRollNumber.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "72d13770-986f-4b4b-8824-2614ae029dc5", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvTextTyping.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "57aa251b-de64-44bd-becc-96c51063bec2", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Plugin/input/BhvTouchInput.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "548a3e17-129c-4a8b-97a4-52c64ba26ad4", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Plugin/ui/PlugProgressBar.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "f517dc7e-6bf8-4e06-8afa-8f7ae18a80d7", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Plugin/ui/PlugTableViewCell.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "a6bba10e-8454-403e-bf22-1f667b5333a1", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scene/DragDrop/CellItemSlot.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "c8b955cb-e09d-4e82-a909-8019d61e5f2e", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scene/input/DragDrop/DragCopy.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "d4481776-e688-476d-8f8f-0c24d06407fe", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Script/Data/DataInterface.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "3ae4783d-5821-4891-9c84-0e1d7676f7e6", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Script/Data/SpriteManager.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "82d9c0ea-ad21-4264-879d-716b212f1f1d", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Script/Global/StateMachine.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "0d00bf06-0c85-4399-abab-37afb3c27f6d", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /doc/Behavior/ui/BhvFrameAnimation.md: -------------------------------------------------------------------------------- 1 | Bhv Frame Animation 2 | 3 | ### 介绍 4 | 5 | 快速制作帧动画,可以在编辑器里拖放制作简单的帧动画,而不必使用 cocos creator 自带的动画编辑器。 6 | 7 | ### 更新 8 | 9 | - 10 | 11 | 0.1 todo 12 | 13 | ### 编辑器 14 | 15 | - todo 16 | 17 | ### 用法 18 | 19 | - todo -------------------------------------------------------------------------------- /assets/Behavior/animate/BhvGroupTween.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "2e7fd7db-9677-420d-a8cb-f5e09754da3a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/animate/BhvPopAnimate.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "37b27939-1933-4934-98db-39445789982a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/animate/BhvSwitchPage.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "b3d08de4-9dca-433e-a573-b4cb62aba0ce", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/general/BhvAfterImage.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "d5d8d7f8-8d9b-4520-80c0-f0957472cb6b", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/general/BhvAudioSource.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "5c464f3f-dac3-4a22-9ea9-4e7ed1c3ff7d", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/general/BhvAutoDestroy.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "1c3798a1-6b8c-4d03-9422-a1e2c0938352", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/general/BhvAutoEmitter.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "29b24bf4-a161-40d6-a4ec-81e60418f98c", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/general/BhvBoundLayout.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "007dbb71-96e8-49aa-a914-110a8ab88c97", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/general/BhvCameraExtra.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "73411ccd-eae1-4034-8614-85dac13ef2af", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/general/BhvSightSensor.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "fb6a63c0-ddba-469e-b1c0-b801b3c30c0d", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvAreaTransfer.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "ca4d181e-ebcb-4b32-beb3-d7f9d55ecaca", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvDirection8.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "8176d5ec-27a9-4ec5-850d-41967a1f943a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scene/PlatformJump/PlaformJumpCtrl.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "72912834-f434-4480-a3e6-9b2de96255ae", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scene/input/DragDrop/CellItemSlot.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "3bbeb001-b439-4a96-8db2-555ed2153fa2", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Test/PlatformJump/PlaformJumpCtrl.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "01f54cab-f175-4ece-9a28-7c4c07cef61f", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /doc/Behavior/general/BhvAutoDestroy.md: -------------------------------------------------------------------------------- 1 | ## Bhv Auto Destroy 2 | 3 | ### 介绍 4 | 5 | 自动销毁组件,挂载该组件的节点可以在某些情况自动被销毁。 6 | 7 | ### 更新 8 | 9 | - 0.1 基本功能,根据时间、距离或者信号销毁对象 10 | - 0.2 加入自动销毁时动画 11 | - 0.3 自动销毁时选择移出节点而不是 destroy,需要用cc.director 监听 12 | 13 | ### 属性 14 | 15 | -------------------------------------------------------------------------------- /assets/Behavior/animate/BhvAnimationHelper.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "d2d7a012-b539-4331-909d-610d43bee5fc", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /doc/Behavior/general/BhvSendEvent.md: -------------------------------------------------------------------------------- 1 | ## Bhv Event Sender 2 | 3 | ### 介绍 4 | 5 | 事件发送器,把绑定该组件的节点的相关事件自动传递给特定的目标。 6 | 7 | cocos creator 默认的事件发送机制,在节点传递很容易使用。但是有些情况下,你在父节点绑定了脚本组件,但是为了获取子节点碰撞事件、点击事件,你还要再挂一个新的脚本。这增加了管理的复杂度。该组件是为了解决这个问题。 8 | 9 | ### 更新 10 | 11 | - 0.1 基本功能完成 12 | 13 | ### 编辑器 14 | 15 | 16 | 17 | ### 用法 -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "experimentalDecorators": true 6 | }, 7 | "exclude": [ 8 | "node_modules", 9 | ".vscode", 10 | "library", 11 | "local", 12 | "settings", 13 | "temp" 14 | ] 15 | } -------------------------------------------------------------------------------- /assets/Scene/ui/DemoAtlasFrame.fire: -------------------------------------------------------------------------------- 1 | [{"__type__":"cc.SceneAsset","scene":{"__id__":1}},{"__type__":"cc.Scene","_children":[{"__id__":2}]},{"__type__":"cc.Node","_name":"Canvas","_parent":{"__id__":1},"_children":[],"_components":[{"__id__":3}]},{"__type__":"cc.Canvas","node":{"__id__":2},"_fitWidth":false,"_fitHeight":true,"_designResolution":{"__type__":"cc.Size","width":960,"height":640}}] -------------------------------------------------------------------------------- /doc/Behavior/ui/BhvTextTyping.md: -------------------------------------------------------------------------------- 1 | Bhv Text Typing 2 | 3 | ### 介绍 4 | 5 | 文本打字机功能。可以自己拓展。暂不支持富文本,只支持普通label组件 6 | 7 | ### 更新 8 | 9 | - 0.1- 基本打字的功能实现 10 | - todo 富文本打字功能 11 | - todo 支持打字转义符号 12 | 13 | ### 编辑器 14 | 15 | - todo 16 | 17 | ### 用法 18 | 19 | - run(text, time,startIndex) 20 | 21 | ```typescript 22 | let textTyping = this.node.getComponent(BhvTextTyping); 23 | textTyping.run('需要打字的文本',0.1); 24 | textTyping.run('文本打字文本打字文本打字',0.1,3);//startIndex,从第3个字符开始打字跳过前面的 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /assets/Behavior/general/BhvAutoEmitter.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-11-20 18:49:45 4 | * @LastEditTime: 2019-12-09 14:48:13 5 | * @LastEditors: wss 6 | */ 7 | 8 | const {ccclass, property} = cc._decorator; 9 | 10 | /** 11 | * 自动发射器 [v0.0.0] 12 | * 配置好发射内容后,可以自动发射一些东西 13 | * 比如发射子弹、创建新的敌人 14 | * 支持从对象池中中创建 15 | */ 16 | @ccclass 17 | export default class BhvAutoEmitter extends cc.Component { 18 | 19 | 20 | // LIFE-CYCLE CALLBACKS: 21 | 22 | // onLoad () {} 23 | 24 | start () { 25 | 26 | } 27 | 28 | // update (dt) {} 29 | } 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | "稳定更新中" 2 | _______________________________ 3 | 4 | ### CC EASY SCRIPT / CC 快速构建组件集 5 | 6 | 版本 V0.1.0 7 | 8 | 本项目基于 Cocos Creator 2.0.10 版本 9 | 10 | 该项目可以为中小型游戏开发提供大量的可复用组件脚本,提高开发效率,并且降低新人使用Creator的难度。 11 | 12 | 最后更新日期:2019/12/9 13 | 14 | #### 版本号 15 | 插件版本格式为 [v x.y.z] 16 | - x = 大版本号,0为测试版API接口不稳定,可能会经常重构,1为正式版 主体API功能不会再发生变化 17 | - y = 插件增加新功能,但是会兼容原接口和编辑器暴露的字段 18 | - z = bug 修复后会增加的版本号,但是不增加和删减任何功能和编辑器暴露的字段 19 | 20 | #### 目前进度 21 | 22 | - 重新分类,整理和规划组件功能,并且整理文档 23 | 24 | #### 后续计划 25 | 26 | + 推出 Creator 3D 版本组件 27 | + 升级项目到 creator 2.2.x 28 | 29 | _______________________________ 30 | 31 | -------------------------------------------------------------------------------- /settings/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "start-scene": "current", 3 | "group-list": [ 4 | "default" 5 | ], 6 | "collision-matrix": [ 7 | [ 8 | true 9 | ] 10 | ], 11 | "excluded-modules": [], 12 | "design-resolution-width": 960, 13 | "design-resolution-height": 640, 14 | "fit-width": false, 15 | "fit-height": true, 16 | "use-project-simulator-setting": false, 17 | "simulator-orientation": false, 18 | "use-customize-simulator": false, 19 | "simulator-resolution": { 20 | "width": 960, 21 | "height": 640 22 | }, 23 | "last-module-event-record-time": 0, 24 | "assets-sort-type": "name", 25 | "facebook": { 26 | "enable": false, 27 | "appID": "", 28 | "live": { 29 | "enable": false 30 | }, 31 | "audience": { 32 | "enable": false 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /assets/Texture/icon.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "175fe41f-e449-4ade-a345-018b88edacdd", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "icon": { 10 | "ver": "1.0.4", 11 | "uuid": "982a6d88-f666-42ea-850d-ed310072aa2b", 12 | "rawTextureUuid": "175fe41f-e449-4ade-a345-018b88edacdd", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 64, 21 | "height": 64, 22 | "rawWidth": 64, 23 | "rawHeight": 64, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/icon000.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "675f9140-20f2-4330-8834-4a73b92af6ab", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "icon000": { 10 | "ver": "1.0.4", 11 | "uuid": "cba9842e-97fa-45c9-9c45-3cbb19b2c36a", 12 | "rawTextureUuid": "675f9140-20f2-4330-8834-4a73b92af6ab", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 64, 21 | "height": 64, 22 | "rawWidth": 64, 23 | "rawHeight": 64, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/icon001.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "6e49fa97-8dd7-4dba-9d5a-fcf551d178da", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "icon001": { 10 | "ver": "1.0.4", 11 | "uuid": "6bdb61a4-10b2-443c-94c0-03b28378a39f", 12 | "rawTextureUuid": "6e49fa97-8dd7-4dba-9d5a-fcf551d178da", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 64, 21 | "height": 64, 22 | "rawWidth": 64, 23 | "rawHeight": 64, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/icon002.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "68c8bab2-e54d-490c-b085-8420c8672fb3", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "icon002": { 10 | "ver": "1.0.4", 11 | "uuid": "076388ff-3cc4-4086-a9da-57129c348741", 12 | "rawTextureUuid": "68c8bab2-e54d-490c-b085-8420c8672fb3", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 64, 21 | "height": 64, 22 | "rawWidth": 64, 23 | "rawHeight": 64, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/icon003.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "61a97f74-a41a-4715-b675-9aecfb748f16", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "icon003": { 10 | "ver": "1.0.4", 11 | "uuid": "d76aa008-cde6-4e34-ab6c-44336f6f10e9", 12 | "rawTextureUuid": "61a97f74-a41a-4715-b675-9aecfb748f16", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 64, 21 | "height": 64, 22 | "rawWidth": 64, 23 | "rawHeight": 64, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/icon_shop.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "ced02df3-61ab-4a57-ba16-8cc909e69d23", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "icon_shop": { 10 | "ver": "1.0.4", 11 | "uuid": "822f6f7b-b2c5-437d-a17e-ec720ea611f4", 12 | "rawTextureUuid": "ced02df3-61ab-4a57-ba16-8cc909e69d23", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0.5, 18 | "trimX": 0, 19 | "trimY": 5, 20 | "width": 48, 21 | "height": 37, 22 | "rawWidth": 48, 23 | "rawHeight": 48, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/icon_warn.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "07b1e511-d5e8-4571-a881-ead33bf3971d", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "icon_warn": { 10 | "ver": "1.0.4", 11 | "uuid": "deb50d8f-c3af-482f-8336-d98a0d45bbe8", 12 | "rawTextureUuid": "07b1e511-d5e8-4571-a881-ead33bf3971d", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 48, 21 | "height": 48, 22 | "rawWidth": 48, 23 | "rawHeight": 48, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/icon_delete.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "c64c93e4-dec6-4d27-bb83-50cadc28ca40", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "icon_delete": { 10 | "ver": "1.0.4", 11 | "uuid": "6710b474-be36-447c-955a-2dbda584f911", 12 | "rawTextureUuid": "c64c93e4-dec6-4d27-bb83-50cadc28ca40", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 3, 19 | "trimY": 0, 20 | "width": 42, 21 | "height": 48, 22 | "rawWidth": 48, 23 | "rawHeight": 48, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/line_texture.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "93ecdf2c-7d0a-456e-928a-f51bf28a2cfa", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "line_texture": { 10 | "ver": "1.0.4", 11 | "uuid": "0c49b938-de03-46ba-8013-e15daa125bd9", 12 | "rawTextureUuid": "93ecdf2c-7d0a-456e-928a-f51bf28a2cfa", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 30, 21 | "height": 4, 22 | "rawWidth": 30, 23 | "rawHeight": 4, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 3, 27 | "borderRight": 4, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/circle_texture.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "e8bddc4d-ce9b-4d59-b2ff-d90f1fd8c51d", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "circle_texture": { 10 | "ver": "1.0.4", 11 | "uuid": "a051bd9b-d2fd-4145-a9dd-0faf988b324f", 12 | "rawTextureUuid": "e8bddc4d-ce9b-4d59-b2ff-d90f1fd8c51d", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 64, 21 | "height": 64, 22 | "rawWidth": 64, 23 | "rawHeight": 64, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/line_texture _full.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "f175c365-e375-4510-955b-aa9c1000efde", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "line_texture _full": { 10 | "ver": "1.0.4", 11 | "uuid": "d3cd1168-bbb2-4d8d-a777-e89769855e27", 12 | "rawTextureUuid": "f175c365-e375-4510-955b-aa9c1000efde", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 30, 21 | "height": 4, 22 | "rawWidth": 30, 23 | "rawHeight": 4, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Texture/result_chest_light.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "1869a801-d106-4484-bfd9-f7b9726683f2", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "result_chest_light": { 10 | "ver": "1.0.4", 11 | "uuid": "6c823c2c-45f5-4b19-8bf1-9dbfbc1b99e8", 12 | "rawTextureUuid": "1869a801-d106-4484-bfd9-f7b9726683f2", 13 | "trimType": "auto", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 110, 21 | "height": 110, 22 | "rawWidth": 110, 23 | "rawHeight": 110, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Test/BhvJumpDrop.ts: -------------------------------------------------------------------------------- 1 | // Learn TypeScript: 2 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/typescript.html 3 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html 4 | // Learn Attribute: 5 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 6 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html 7 | // Learn life-cycle callbacks: 8 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 9 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 10 | 11 | const {ccclass, property} = cc._decorator; 12 | 13 | @ccclass 14 | export default class NewClass extends cc.Component { 15 | 16 | @property(cc.Label) 17 | label: cc.Label = null; 18 | 19 | @property 20 | text: string = 'hello'; 21 | 22 | // LIFE-CYCLE CALLBACKS: 23 | 24 | // onLoad () {} 25 | 26 | start () { 27 | 28 | } 29 | 30 | // update (dt) {} 31 | } 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 ovs sheep 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /assets/Script/Data/SpriteManager.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-02-01 21:36:53 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-02-16 21:00:30 6 | */ 7 | 8 | /** 加载资源的路径,有资源加载需要写在这里 */ 9 | let spritePath = { 10 | /**车辆帧图片 */cars:'pic/car_body/car', 11 | /**贴纸帧图片 */stickers:'pic/car_sticker/sticker', 12 | /**赛道主题背景 */themeBG:'pic/theme_bg/bg', 13 | /**小地图图片 */miniMap:'pic/minimap/map', 14 | } 15 | 16 | /** 17 | * SpriteFrame 管理器,管理spriteFrame 加载等 18 | */ 19 | class SpriteManager { 20 | constructor(){ 21 | 22 | } 23 | 24 | /** 路径 */ 25 | path = spritePath; 26 | 27 | /** 28 | * 直接设置对应路径资源的sprite资源 29 | * @param node - 对象 30 | * @param path - 路径 31 | * @param name - 名字(可以省略,会直接通过路径查找) 32 | */ 33 | set(node:cc.Node,path:string = "",name:string|number= ""){ 34 | let stickerFrame = node.getComponent(cc.Sprite); 35 | cc.loader.loadRes(path+name, (e,img)=>{ 36 | stickerFrame.spriteFrame = new cc.SpriteFrame(img); 37 | }); 38 | 39 | } 40 | } 41 | 42 | 43 | export let spriteManager = new SpriteManager(); 44 | -------------------------------------------------------------------------------- /assets/Test/BhvFollower.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-05-03 21:55:19 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-05-03 22:52:34 6 | */ 7 | 8 | 9 | //跟随模式 10 | 11 | const {ccclass, property} = cc._decorator; 12 | 13 | @ccclass 14 | export default class BhvFollower extends cc.Component { 15 | 16 | segLength = 64; //关节长度 17 | 18 | @property(cc.Node) 19 | parent:cc.Node = null; 20 | 21 | onload() { 22 | 23 | } 24 | 25 | update(dt) { 26 | if(this.parent == null)return; 27 | this.dragSegment(this.parent.x, this.parent.y); 28 | } 29 | 30 | dragSegment(xin, yin) { 31 | const dx = xin - this.node.x; 32 | const dy = yin - this.node.y; 33 | const angle = Math.atan2(dy, dx); 34 | let x = xin - Math.cos(angle) * this.segLength; 35 | let y = yin - Math.sin(angle) * this.segLength; 36 | this.node.x = x; 37 | this.node.y = y; 38 | this.node.rotation = cc.misc.radiansToDegrees(angle); 39 | //segment(x[i], y[i], angle); 40 | } 41 | 42 | 43 | // update (dt) {} 44 | } 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /assets/Test/PlatformJump/PlaformJumpCtrl.ts: -------------------------------------------------------------------------------- 1 | // Learn TypeScript: 2 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html 3 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html 4 | // Learn Attribute: 5 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 6 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html 7 | // Learn life-cycle callbacks: 8 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 9 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 10 | 11 | const {ccclass, property} = cc._decorator; 12 | 13 | @ccclass 14 | export default class NewClass extends cc.Component { 15 | 16 | 17 | 18 | // LIFE-CYCLE CALLBACKS: 19 | 20 | onLoad () { 21 | var manager = cc.director.getCollisionManager(); 22 | manager.enabled = true; 23 | manager.enabledDebugDraw = true; 24 | manager.enabledDrawBoundingBox = true; 25 | 26 | } 27 | 28 | start () { 29 | 30 | } 31 | 32 | // update (dt) {} 33 | } 34 | -------------------------------------------------------------------------------- /assets/Scene/PlatformJump/PlaformJumpCtrl.ts: -------------------------------------------------------------------------------- 1 | // Learn TypeScript: 2 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html 3 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html 4 | // Learn Attribute: 5 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 6 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html 7 | // Learn life-cycle callbacks: 8 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 9 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 10 | 11 | const {ccclass, property} = cc._decorator; 12 | 13 | @ccclass 14 | export default class NewClass extends cc.Component { 15 | 16 | 17 | 18 | // LIFE-CYCLE CALLBACKS: 19 | 20 | onLoad () { 21 | var manager = cc.director.getCollisionManager(); 22 | manager.enabled = true; 23 | manager.enabledDebugDraw = true; 24 | manager.enabledDrawBoundingBox = true; 25 | 26 | } 27 | 28 | start () { 29 | 30 | } 31 | 32 | // update (dt) {} 33 | } 34 | -------------------------------------------------------------------------------- /assets/Plugin/ui/PlugPreloader.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | const {ccclass, property} = cc._decorator; 4 | 5 | /** 6 | * 处理加载条的泛用脚本 7 | */ 8 | @ccclass 9 | export default class PlugPreloader extends cc.Component { 10 | 11 | @property(cc.Label) 12 | progressLabel: cc.Label = null; 13 | 14 | @property(cc.ProgressBar) 15 | progressBar:cc.ProgressBar = null; 16 | 17 | @property(cc.Label) 18 | loadingLabel:cc.Label = null; 19 | 20 | @property 21 | directorEvent:string = 'Preloader:Progress'; 22 | 23 | @property({ 24 | tooltip:'加载条完成是否自动关闭?' 25 | }) 26 | finishedClose:boolean = true; 27 | 28 | onLoad(){ 29 | 30 | } 31 | 32 | onEnable(){ 33 | cc.director.on(this.directorEvent,this.onProgress,this); 34 | } 35 | 36 | onDisable(){ 37 | cc.director.off(this.directorEvent,this.onProgress,this); 38 | 39 | } 40 | 41 | onProgress(cur,total,finished){ 42 | if(finished===true){ 43 | this.destroy(); 44 | } 45 | 46 | if(this.progressLabel)this.progressLabel.string = Math.floor(cur/total *100).toString()+'%'; 47 | if(this.progressBar)this.progressBar.progress = finished?1:(cur/total); 48 | } 49 | 50 | 51 | 52 | // update (dt) {} 53 | } 54 | -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvZIndex.ts: -------------------------------------------------------------------------------- 1 | // Learn TypeScript: 2 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/typescript.html 3 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html 4 | // Learn Attribute: 5 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 6 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html 7 | // Learn life-cycle callbacks: 8 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 9 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 10 | 11 | const {ccclass, property, executeInEditMode, menu} = cc._decorator; 12 | 13 | /** 14 | * 强制提升UI的 Z轴顺序 15 | */ 16 | @ccclass 17 | @executeInEditMode 18 | @menu("添加特殊行为/UI/Z INDEX (层级顺序)") 19 | export default class BhvZIndex extends cc.Component { 20 | 21 | // LIFE-CYCLE CALLBACKS: 22 | 23 | // onLoad () {} 24 | 25 | @property({ 26 | type:cc.Integer, 27 | }) 28 | zIndex:number = 0; 29 | 30 | onLoad() { 31 | this.node.zIndex = this.zIndex; 32 | }; 33 | 34 | update (dt) { 35 | if(CC_EDITOR)this.node.zIndex = this.zIndex; 36 | }; 37 | } 38 | 39 | -------------------------------------------------------------------------------- /assets/Scene/DragDrop/DragCopy.ts: -------------------------------------------------------------------------------- 1 | // Learn TypeScript: 2 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/typescript.html 3 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html 4 | // Learn Attribute: 5 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 6 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html 7 | // Learn life-cycle callbacks: 8 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 9 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 10 | 11 | const {ccclass, property} = cc._decorator; 12 | 13 | @ccclass 14 | export default class DragCopy extends cc.Component { 15 | 16 | @property(cc.Prefab) 17 | prefab:cc.Prefab = null; 18 | 19 | _node:cc.Node; 20 | // LIFE-CYCLE CALLBACKS: 21 | 22 | // onLoad () {} 23 | 24 | onEnable(){ 25 | this.node.on(cc.Node.EventType.TOUCH_START,this.onDragStart,this); 26 | } 27 | 28 | onDragStart(event:cc.Event.EventTouch){ 29 | 30 | let node = cc.instantiate(this.prefab); 31 | this._node = node; 32 | this.node.getParent().addChild(node); 33 | node.x = this.node.x; 34 | node.y = this.node.y; 35 | 36 | } 37 | 38 | 39 | 40 | // update (dt) {} 41 | } 42 | -------------------------------------------------------------------------------- /assets/Scene/input/DragDrop/DragCopy.ts: -------------------------------------------------------------------------------- 1 | // Learn TypeScript: 2 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/typescript.html 3 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html 4 | // Learn Attribute: 5 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 6 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html 7 | // Learn life-cycle callbacks: 8 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 9 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 10 | 11 | const {ccclass, property} = cc._decorator; 12 | 13 | @ccclass 14 | export default class DragCopy extends cc.Component { 15 | 16 | @property(cc.Prefab) 17 | prefab:cc.Prefab = null; 18 | 19 | _node:cc.Node; 20 | // LIFE-CYCLE CALLBACKS: 21 | 22 | // onLoad () {} 23 | 24 | onEnable(){ 25 | this.node.on(cc.Node.EventType.TOUCH_START,this.onDragStart,this); 26 | } 27 | 28 | onDragStart(event:cc.Event.EventTouch){ 29 | 30 | let node = cc.instantiate(this.prefab); 31 | this._node = node; 32 | this.node.getParent().addChild(node); 33 | node.x = this.node.x; 34 | node.y = this.node.y; 35 | 36 | } 37 | 38 | 39 | 40 | // update (dt) {} 41 | } 42 | -------------------------------------------------------------------------------- /doc/Behavior/movement/BhvSine.md: -------------------------------------------------------------------------------- 1 | Bhv Sine 2 | 3 | ### 介绍 4 | 5 | 自主进行循环往复的三角函数运动,适合任何循环运动或者表现。 6 | 7 | ### 更新 8 | 9 | - 0.1 - 支持 2D Sine 功能 10 | - todo1 - 支持3D节点的属性 11 | 12 | ### 编辑器 13 | 14 | - Movement - 以何种属性进行sine周期运动 15 | 16 | ```typescript 17 | enum MOVEMENT { 18 | horizontal,//垂直(x坐标) 19 | vertical,//水平(y坐标) 20 | scale,//缩放值 21 | scaleX, 22 | scaleY, 23 | rotation, 24 | opacity, 25 | skewX, 26 | skewY, 27 | forward, 28 | value, //自定义的值 29 | } 30 | ``` 31 | 32 | - Wave - 函数的波形 33 | 34 | ```typescript 35 | enum WAVE { 36 | sine, //sine 函数图像,适合来回平滑摇摆 37 | triangle,//三角形的函数波形,线性 38 | sawtooth, //从一个值平滑过渡到另外一个值,适合单向循环 39 | reverseSawtooth, //sawtooth的反向运动 40 | square //方型图像,从一个值快速切换到另外一个值,中间没有过渡 41 | } 42 | ``` 43 | 44 | - Period - 函数周期,周期越短函数运行速度越快,代表了多少秒能完成一个周期性的运动 45 | 46 | - PeriodRandom - 周期随机,启动时使Period 随机增加减少,使不同对象表现不同 47 | 48 | - PeriodOffset- 周期偏移,运行前使得函数图像位置发生偏移,可以做出队列依次运动的结果 49 | 50 | - PeriodOffsetRandom - 周期偏移随机值,使周期偏移值 随机增加或者减少 51 | 52 | - Magnitude - 波动数值范围,选择了以何种属性进行sine周期运动,Magnitude就是改变的值的范围 53 | 54 | - MagnitudeRandom - 波动数值范围随机,使得波动值随机增加或者减少 55 | 56 | ### 用法 57 | 58 | - 编辑器用法: 中直接挂在需要 sine 运动的节点上,改变不同的参数,会进行对应的运动。 59 | 60 | - 自定义属性用法: Movement 选择 value模式后,可以通过以下方式获取sine运行的值 61 | 62 | ```typescript 63 | let value = this.node.getComponent(BhvSine).value; 64 | this.node.opacity = value * 50 + 150; //透明度以sine 函数变化 65 | ``` 66 | 67 | -------------------------------------------------------------------------------- /assets/Plugin/ui/TestCell.ts: -------------------------------------------------------------------------------- 1 | import PlugTableViewCell from "./PlugTableViewCell"; 2 | 3 | // Learn TypeScript: 4 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/typescript.html 5 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html 6 | // Learn Attribute: 7 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 8 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html 9 | // Learn life-cycle callbacks: 10 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 11 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 12 | 13 | const {ccclass, property} = cc._decorator; 14 | 15 | @ccclass 16 | export default class TestCell extends PlugTableViewCell { 17 | private _target; 18 | private _data; 19 | 20 | @property(cc.Label) 21 | private index = null; 22 | 23 | @property(cc.Label) 24 | private group = null; 25 | 26 | init (index, data, reload, group) { 27 | if (index >= data.array.length) { 28 | this.index.string = '越界'; 29 | this.group.string = group.toString(); 30 | return; 31 | } 32 | 33 | this._target = data.target; 34 | this._data = data.array[index]; 35 | this.index.string = index; 36 | this.group.string = group.toString(); 37 | } 38 | 39 | 40 | clicked () { 41 | this._target.show('下标:' + this.index.string + ',组:' + this.group.string); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /assets/Prefab/GodModeMenu.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-04-10 00:32:03 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-04-10 00:32:03 6 | */ 7 | 8 | import { dataManager } from './../Script/Data/DataManager'; 9 | 10 | const {ccclass, property} = cc._decorator; 11 | 12 | /** 13 | * 上帝模式窗口,一般用于快速游戏测试一些内容 14 | */ 15 | @ccclass 16 | export default class GodModeMenu extends cc.Component { 17 | 18 | // LIFE-CYCLE CALLBACKS: 19 | 20 | // onLoad () {} 21 | 22 | start () { 23 | CC_DEV 24 | } 25 | 26 | onButtonDown(e,type:string){ 27 | switch (type) { 28 | case 'init_data': 29 | dataManager.initUserData(); 30 | break; 31 | case 'add_diamond': 32 | dataManager.userData.diamond +=100; 33 | break; 34 | case 'add_diamond_max': 35 | dataManager.userData.diamond +=99999; 36 | break; 37 | case 'add_crash': 38 | dataManager.userData.gold +=1000; 39 | break; 40 | case 'add_crash_max': 41 | dataManager.userData.gold +=999999; 42 | break; 43 | case 'car_unlock': // 获得所有车辆 44 | break; 45 | case 'car_lock': //移除所有车辆 46 | break; 47 | case 'level_unlock': // 获得所有车辆 48 | break; 49 | case 'level_lock': //移除所有车辆 50 | break; 51 | default: 52 | break; 53 | } 54 | } 55 | 56 | // update (dt) {} 57 | } 58 | -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvAutoSizeFill.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-06-22 16:14:37 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-06-22 16:14:57 6 | */ 7 | 8 | 9 | const {ccclass, property, menu,executeInEditMode} = cc._decorator; 10 | 11 | /** 12 | * !废弃, 使用cc.Weight 可以完美代替此插件 13 | * 自动尺寸填充 ver1.0, 14 | * 可以无视节点顺序,默认以父对象为尺寸参照填充 15 | * 一般用于气泡对话框的制作 16 | */ 17 | @ccclass 18 | @executeInEditMode 19 | @menu("添加特殊行为/UI/Auto Size Fill (内容适配)") 20 | export default class BhvAutoSizeFill extends cc.Component { 21 | 22 | 23 | @property({ 24 | type:cc.Node, 25 | tooltip:'指定当前节点的填充目标,可以是任意节点。' 26 | }) 27 | target:cc.Node = null; 28 | 29 | @property({ 30 | tooltip:'宽高的偏移值 X Y ' 31 | }) 32 | offset:cc.Vec2 = cc.v2(0,0); 33 | 34 | // LIFE-CYCLE CALLBACKS: 35 | 36 | onLoad () { 37 | if(this.target == null){ 38 | this.target = this.node.getParent(); 39 | } 40 | this.onSizeChange(); 41 | } 42 | 43 | onEnable(){ 44 | if(this.target)this.target.on('size-changed',this.onSizeChange,this); 45 | } 46 | 47 | onDisable(){ 48 | if(this.target)this.target.off('size-changed',this.onSizeChange,this); 49 | } 50 | 51 | onSizeChange(){ 52 | if(!this.target)return; 53 | let offsetX = this.offset.x; 54 | let offsetY = this.offset.y; 55 | //this.node.setContentSize(cc.size(,)); 56 | this.node.width = this.target.width+offsetX; 57 | this.node.height = this.target.height+offsetY; 58 | } 59 | 60 | 61 | // update (dt) {} 62 | } 63 | -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvColorIndex.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-06-22 15:27:55 4 | * @LastEditTime: 2019-12-09 15:08:01 5 | * @LastEditors: wss 6 | */ 7 | 8 | const {ccclass, property,executeInEditMode,menu} = cc._decorator; 9 | 10 | /** 11 | * 颜色序号 [v1.0.0] 12 | * 通过改变序号来改变节点的颜色状态 13 | * todo 增加切换颜色时的动画过渡效果 14 | */ 15 | @ccclass 16 | @executeInEditMode 17 | @menu("添加特殊行为/UI/Color Index (颜色序号)") 18 | export default class BhvColorIndex extends cc.Component { 19 | 20 | @property([cc.Color]) 21 | colors:cc.Color[] = [cc.color(255,255,255)] 22 | 23 | 24 | @property 25 | transitionColor:boolean = false; 26 | 27 | @property({ 28 | visible:function(){return this.transitionColor === true} 29 | }) 30 | transitionTime:number = 0.3; 31 | 32 | 33 | get index(){ 34 | return this._index; 35 | } 36 | @property({ 37 | tooltip:'当前显示的颜色', 38 | type:cc.Integer 39 | }) 40 | set index(value:number){ 41 | if (value < 0) return; 42 | this._index = value % this.colors.length; 43 | //设置 Sprite 组件的spriteFrame属性,变换图片 44 | this.changeColor(this._index); 45 | } 46 | @property 47 | private _index:number = 0; 48 | 49 | changeColor(index){ 50 | let color = this.colors[index]; 51 | if(!color)return; 52 | if(this.transitionColor){ 53 | this.node.runAction(cc.tintTo(this.transitionTime,color.getR(),color.getG(),color.getB())); 54 | }else{ 55 | this.node.color = color; 56 | } 57 | 58 | } 59 | 60 | // update (dt) {} 61 | } 62 | -------------------------------------------------------------------------------- /doc/Behavior/general/BhvCameraExtra.md: -------------------------------------------------------------------------------- 1 | Bhv Camera Extra 2 | 3 | ### 介绍 4 | 5 | 可以拓展cc 相机的基本能力,额外实现相机移动跟随、dead zone、屏幕闪烁、震动、缩放、旋转 功能 6 | 7 | ### 更新 8 | 9 | - 0.1 基本功能实现 10 | 11 | ### 编辑器 12 | 13 | - Debug: 绘制摄像机的位置信息 14 | - Target: 设置摄像机跟随的目标节点 15 | - Follow Type: 跟随的类型,不同跟随类型的 dead zone 不同 dead zone的区域指镜头不会跟随范围。打开debug绘图就可以得知当前的 dead zone区域大小 16 | - ENABLE_ROTATE 是否激活相机的旋转功能, 官方未支持,使用方式为旋转 17 | - Rotate Nodes: [ENABLE_ROTATE]激活后出现,控制需要旋转的节点,进行旋转,通常是游戏图层。尽量保持较少节点旋转,否则特别消耗性能 18 | - ENABLE_FX: 是否激活相机的特效(震动、闪烁) 19 | - Round Px: 保证相机运动的坐标点为整数 像素 20 | 21 | ### 用法 22 | 23 | - 相机移动 24 | 25 | ```typescript 26 | let camera = this.node.getComponent('BhvCameraExtra'); 27 | camera.x = 15; 28 | camera.y = 20; 29 | ``` 30 | 31 | - 相机跟随 32 | 33 | ```typescript 34 | //跟随一个对象 35 | camera.follow(target,style,lerpX,lerpY); 36 | //停止跟随对象 37 | camera.unFollow(); 38 | ``` 39 | 40 | - 相机聚焦 41 | 42 | ```typescript 43 | //摄像机焦点移动到某节点上 44 | camera.focusOn(); 45 | //立即将相机聚焦到某个位置上 46 | camera.focusOnXY(pos); 47 | //相机摇晃 48 | camera.shake(0.05,0.5,true,0,true); 49 | //相机闪烁 50 | camera.flash(cc.color(255, 255, 255), 0.5,false,255); 51 | ``` 52 | 53 | - 相机摇晃 和闪烁 54 | 55 | ```typescript 56 | //相机摇晃 57 | camera.shake(0.05,0.5);//强度,时间 58 | camera.shake(0.05,0.5,true,0,true); 59 | //相机闪烁 60 | camera.flash(cc.color(255, 255, 255), 0.5);//颜色,时间 61 | camera.flash(cc.color(255, 255, 255), 0.5,false,255); 62 | ``` 63 | 64 | - 自由运镜, 自由控制相机变化,可以实现复杂的镜头操作 65 | 66 | 支持属性: 移动位置、颜色变化、镜头缩放、镜头旋转(需要挂载旋转layer)、不透明度 67 | 68 | ```typescript 69 | //使用 cc.Action 动作系统,直接操作相机进行你希望的移动 70 | let action = new cc.Action(anyAction); 71 | camera.run(action) 72 | ``` 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /assets/Behavior/logic/BhvEmitter.ts: -------------------------------------------------------------------------------- 1 | 2 | const {ccclass, property,menu} = cc._decorator; 3 | 4 | /** 5 | * 发射器,暂时实现的基本功能 6 | * todo 0.1 - 控制节点生成的朝向/初始化事件 7 | * todo 0.2 - 控制随机生成的方式 8 | * todo 0.3 - 和间隔发射器组合使用,源源不断产生怪物 9 | * todo 0.4 - 使用对象池优化(提供) 10 | */ 11 | @ccclass 12 | @menu("添加特殊行为/Logic/Emitter(发射器)") 13 | export default class BhvEmitter extends cc.Component { 14 | 15 | @property(cc.Prefab) 16 | prefab: cc.Prefab = null; 17 | 18 | @property({ 19 | type:cc.Node, 20 | tooltip:'在哪里生成该prefab' 21 | }) 22 | generatorParent:cc.Node = null; 23 | // LIFE-CYCLE CALLBACKS: 24 | 25 | // onLoad () {} 26 | 27 | /**触发条件的 emit */ 28 | onEventEmit(e){ 29 | this.createNode(); 30 | } 31 | 32 | // onEventEmitNodePos(e:cc.Event.EventTouch){ 33 | // let node = this.createNode(); 34 | // let x = e.target.x; 35 | // let y = e.target.y; 36 | // node.x = x; 37 | // node.y = y; 38 | // } 39 | 40 | // onEventEmitPos(e:cc.Event.EventTouch){ 41 | // let node = this.createNode(); 42 | // let x = e.getLocationX(); 43 | // let y = e.getLocationY(); 44 | // node.x = x; 45 | // node.y = y; 46 | // } 47 | 48 | emit(pos:cc.Vec2,rotation:number = 0){ 49 | let node = this.createNode(); 50 | node.x = pos.x; 51 | node.y = pos.y; 52 | node.rotation = rotation; 53 | } 54 | 55 | createNode():cc.Node{ 56 | let node = cc.instantiate(this.prefab); 57 | let parent = this.generatorParent||this.node; 58 | parent.addChild(node); 59 | return node; 60 | } 61 | 62 | 63 | 64 | // update (dt) {} 65 | } 66 | -------------------------------------------------------------------------------- /assets/Behavior/general/BhvLine.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-04-10 00:31:44 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-04-10 00:42:26 6 | */ 7 | 8 | const { ccclass, property, menu, disallowMultiple } = cc._decorator; 9 | 10 | /** 11 | * 连线 [v.1.0.0] 12 | * 将该对象 放置到 两个节点之间,形成连线, 可以无视节点关系 13 | */ 14 | @ccclass 15 | @menu("添加特殊行为/General/Line (连线)") 16 | @disallowMultiple 17 | export default class BhvLine extends cc.Component { 18 | 19 | @property(cc.Node) 20 | startNode: cc.Node = null; 21 | 22 | @property(cc.Node) 23 | endNode: cc.Node = null; 24 | 25 | 26 | // LIFE-CYCLE CALLBACKS: 27 | start() { 28 | if (this.startNode && this.endNode) { 29 | this.setLine(this.startNode, this.endNode); 30 | } 31 | 32 | } 33 | 34 | /**设置这条线 与 两个节点 动态连接起来 */ 35 | setLine(nodeStart: cc.Node, nodeEnd: cc.Node) { 36 | if (!this.startNode || !this.endNode) return; 37 | this.node.anchorX = 0; 38 | this.node.anchorY = 0.5; 39 | this.startNode = nodeStart; 40 | this.endNode = nodeEnd; 41 | 42 | } 43 | 44 | update() { 45 | if (!this.startNode || !this.endNode) return; 46 | var startPos: cc.Vec2 = this.startNode.convertToWorldSpaceAR(cc.Vec2.ZERO); 47 | var endPos: cc.Vec2 = this.endNode.convertToWorldSpaceAR(cc.Vec2.ZERO); 48 | var distance: number = startPos.sub(endPos).mag(); 49 | var angle: number = Math.atan2(endPos.y - startPos.y, endPos.x - startPos.x); 50 | this.node.position = this.node.getParent().convertToNodeSpaceAR(startPos); 51 | 52 | this.node.width = distance; 53 | this.node.rotation = cc.misc.radiansToDegrees(angle) * -1; 54 | 55 | 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /assets/Scene/FSM/DemoFSM.ts: -------------------------------------------------------------------------------- 1 | import BhvFSM from "../../Behavior/logic/BhvFSM"; 2 | 3 | 4 | const { ccclass, property } = cc._decorator; 5 | 6 | const STATE = { 7 | Idle: "Idle", 8 | Walk: "Walk", 9 | Run: "Run", 10 | Stop: "Stop" 11 | } 12 | 13 | @ccclass 14 | export default class DemoFSM extends BhvFSM { 15 | static STATE = STATE; 16 | 17 | @property(cc.Label) 18 | testLabel:cc.Label = null; 19 | 20 | start() { 21 | this.addStates(STATE); 22 | this.changeState(STATE.Idle); 23 | } 24 | 25 | //可以通过函数参数获得状态名,也可以通过 this.currentState 获得 26 | onIdleEnter(cur: string, pre: string) { 27 | this.changeState(STATE.Walk); 28 | } 29 | onWalkEnter() { 30 | this.testLabel.string = "开始走路!"; 31 | } 32 | onWalkUpdate() { 33 | this.testLabel.string = "走路中!时间:"+Math.floor(this.duration*10)/10+"/1.5 ms"; 34 | if (this.duration >= 1.5) { 35 | this.changeState(STATE.Run); 36 | } 37 | } 38 | 39 | onRunEnter() { 40 | this.testLabel.string = "跑起来了!"; 41 | } 42 | onRunUpdate() { 43 | this.testLabel.string = "狂奔中!时间:"+Math.floor(this.duration*10)/10+" /2ms"; 44 | if (this.duration >= 2.0) { 45 | this.changeState(STATE.Stop); 46 | } 47 | } 48 | 49 | onRunExit() { 50 | this.testLabel.string = "不跑了!"; 51 | } 52 | 53 | onStopEnter() { 54 | this.testLabel.string = "精疲力竭!休息一会"; 55 | } 56 | 57 | onStopUpdate(){ 58 | this.testLabel.string = "休息中!时间:"+Math.floor(this.duration*10)/10+"/5 ms"; 59 | if (this.duration >= 5.0) { 60 | this.testLabel.string = "休息完了!"; 61 | this.changeState(STATE.Walk); 62 | } 63 | } 64 | 65 | 66 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #///////////////////////////////////////////////////////////////////////////// 2 | # Fireball Projects 3 | #///////////////////////////////////////////////////////////////////////////// 4 | 5 | library/ 6 | temp/ 7 | local/ 8 | build/ 9 | 10 | #///////////////////////////////////////////////////////////////////////////// 11 | # Logs and databases 12 | #///////////////////////////////////////////////////////////////////////////// 13 | 14 | *.log 15 | *.sql 16 | *.sqlite 17 | 18 | #///////////////////////////////////////////////////////////////////////////// 19 | # files for debugger 20 | #///////////////////////////////////////////////////////////////////////////// 21 | 22 | *.sln 23 | *.csproj 24 | *.pidb 25 | *.unityproj 26 | *.suo 27 | 28 | #///////////////////////////////////////////////////////////////////////////// 29 | # OS generated files 30 | #///////////////////////////////////////////////////////////////////////////// 31 | 32 | .DS_Store 33 | ehthumbs.db 34 | Thumbs.db 35 | 36 | #///////////////////////////////////////////////////////////////////////////// 37 | # exvim files 38 | #///////////////////////////////////////////////////////////////////////////// 39 | 40 | *UnityVS.meta 41 | *.err 42 | *.err.meta 43 | *.exvim 44 | *.exvim.meta 45 | *.vimentry 46 | *.vimentry.meta 47 | *.vimproject 48 | *.vimproject.meta 49 | .vimfiles.*/ 50 | .exvim.*/ 51 | quick_gen_project_*_autogen.bat 52 | quick_gen_project_*_autogen.bat.meta 53 | quick_gen_project_*_autogen.sh 54 | quick_gen_project_*_autogen.sh.meta 55 | .exvim.app 56 | 57 | #///////////////////////////////////////////////////////////////////////////// 58 | # webstorm files 59 | #///////////////////////////////////////////////////////////////////////////// 60 | 61 | .idea/ 62 | 63 | #////////////////////////// 64 | # VS Code 65 | #////////////////////////// 66 | 67 | .vscode/ -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvLayoutCircle.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-04-10 23:39:26 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-04-12 20:58:13 6 | */ 7 | 8 | const {ccclass, property, menu, executeInEditMode} = cc._decorator; 9 | 10 | /** 11 | * 圆形容器(自动布局) 12 | * 自动控制节点下的子对象 呈现圆形的布局 13 | */ 14 | @ccclass 15 | @menu("添加特殊行为/UI/Layout Circle (圆布局)") 16 | @executeInEditMode 17 | export default class BhvLayoutCircle extends cc.Component { 18 | 19 | @property 20 | radius:cc.Vec2 = cc.v2(32,32); 21 | 22 | @property 23 | startAngle:number = 0; 24 | 25 | @property({ 26 | tooltip:'是否当容器内数量发生变化时才更新坐标', 27 | displayName:"Update When Count Change " 28 | }) 29 | isUpdateByCountChange:boolean = false; 30 | 31 | _preChildCount:number = 0; 32 | 33 | // LIFE-CYCLE CALLBACKS: 34 | 35 | // onLoad () {} 36 | 37 | start () { 38 | 39 | } 40 | 41 | //更新容器 42 | updateContent(){ 43 | let array = this.node.children; 44 | let startPos = this.node.position; 45 | let maxCount = this.node.childrenCount; 46 | let startAngle = this.startAngle; 47 | let divAngle = 360/maxCount; 48 | 49 | for (let i = 0; i < array.length; i++) { 50 | const e = array[i]; 51 | const a = startAngle + divAngle*i; 52 | let x = this.radius.x * Math.cos(cc.misc.degreesToRadians(a)); 53 | let y = this.radius.y * Math.sin(cc.misc.degreesToRadians(a)); 54 | e.x = x; 55 | e.y = y; 56 | 57 | } 58 | 59 | } 60 | 61 | update (dt) { 62 | if(this._preChildCount !== this.node.childrenCount || this.isUpdateByCountChange === true){ 63 | this._preChildCount = this.node.childrenCount; 64 | this.updateContent(); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /assets/Test/BhvChainGroup.ts: -------------------------------------------------------------------------------- 1 | // Learn TypeScript: 2 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/typescript.html 3 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html 4 | // Learn Attribute: 5 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 6 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html 7 | // Learn life-cycle callbacks: 8 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 9 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 10 | 11 | const {ccclass, property} = cc._decorator; 12 | 13 | @ccclass 14 | export default class BhvChains extends cc.Component { 15 | 16 | @property 17 | nodeArray:cc.Node[] = []; 18 | 19 | @property 20 | segLength = 18; 21 | // LIFE-CYCLE CALLBACKS: 22 | 23 | onLoad () { 24 | if(this.nodeArray.length<=0){ 25 | this.nodeArray = this.nodeArray.concat(this.node.children); 26 | } 27 | } 28 | 29 | start () { 30 | 31 | } 32 | 33 | update (dt) { 34 | //chain绑定 35 | if(this.nodeArray.length<=1)return; 36 | for (let i = 0; i < this.nodeArray.length - 1; i++) { 37 | this.dragSegment(i + 1, this.nodeArray[i].x, this.nodeArray[i].y); 38 | } 39 | } 40 | 41 | dragSegment(i, xin, yin) { 42 | let node = this.nodeArray[i]; 43 | const dx = xin - node.x; 44 | const dy = yin - node.y; 45 | const angle = Math.atan2(dy, dx); 46 | node.x = xin - Math.cos(angle) * this.segLength; 47 | node.y = yin - Math.sin(angle) * this.segLength; 48 | node.rotation = cc.misc.radiansToDegrees(-1*angle); 49 | //this.segment(node.x, node.y, angle); 50 | } 51 | 52 | 53 | 54 | } 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /assets/Behavior/animate/BhvAnimationHelper.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-06-22 15:19:32 4 | * @LastEditTime: 2019-12-09 14:34:05 5 | * @LastEditors: wss 6 | */ 7 | 8 | 9 | const {ccclass, property,menu,requireComponent} = cc._decorator; 10 | 11 | /** 12 | * 动画播放拓展 [v1.0.0] 13 | */ 14 | @ccclass 15 | @requireComponent(cc.Animation) 16 | @menu("添加特殊行为/Animate/Animation Helper (动画拓展)") 17 | export default class BhvAnimationHelper extends cc.Component { 18 | 19 | @property({ 20 | tooltip:'动画播放完成后,是否消除该节点' 21 | }) 22 | finishDestroy:boolean = false; 23 | 24 | private animation:cc.Animation; 25 | private originClip:cc.AnimationClip; 26 | 27 | onLoad(){ 28 | this.animation = this.node.getComponent(cc.Animation); 29 | 30 | let clip = this.animation.getClips(); 31 | this.originClip = clip[0]; 32 | this.animation.addClip(this.originClip,'animation-out');//只是为了识别离开状态动画 33 | this.originClip.wrapMode = cc.WrapMode.Normal; 34 | 35 | } 36 | 37 | onEnable(){ 38 | this.animation.on('play', this.onPlay as any, this); 39 | this.animation.on('finished', this.onFinished as any, this); 40 | } 41 | 42 | onDisable(){ 43 | this.animation.off('play', this.onPlay); 44 | this.animation.off('finished', this.onFinished); 45 | } 46 | 47 | onPlay(event,clip){ 48 | //cc.log('DEMO:',event); 49 | } 50 | 51 | onFinished(event,clip){ 52 | //标记自动销毁 53 | if(clip.name === 'animation-out'){ 54 | this.node.destroy(); 55 | } 56 | } 57 | 58 | play(){ 59 | this.originClip.wrapMode = cc.WrapMode.Normal; 60 | this.animation.play(); 61 | } 62 | 63 | reverse(){ 64 | //创建一个反向播放的动画 65 | this.originClip.wrapMode = cc.WrapMode.Reverse; 66 | this.animation.play('animation-out'); 67 | } 68 | 69 | // update (dt) {} 70 | } 71 | -------------------------------------------------------------------------------- /assets/Plugin/ui/TestMenu.ts: -------------------------------------------------------------------------------- 1 | import PlugTableView from "./PlugTableView"; 2 | 3 | // Learn TypeScript: 4 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/typescript.html 5 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html 6 | // Learn Attribute: 7 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 8 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html 9 | // Learn life-cycle callbacks: 10 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 11 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 12 | 13 | const {ccclass, property} = cc._decorator; 14 | 15 | @ccclass 16 | export default class NewClass extends cc.Component { 17 | 18 | @property(PlugTableView) 19 | tableView: cc.Node = null; 20 | 21 | // LIFE-CYCLE CALLBACKS: 22 | 23 | // onLoad () {} 24 | 25 | // use this for initialization 26 | onLoad () { 27 | } 28 | 29 | show (text) { 30 | cc.log(text); 31 | } 32 | 33 | _getdata (num) { 34 | var array = []; 35 | for (var i = 0; i < num; ++i) { 36 | var obj:any = {}; 37 | obj.name = 'a' + i; 38 | array.push(obj); 39 | } 40 | return array; 41 | } 42 | 43 | initView () { 44 | var data = this._getdata(50); 45 | this.tableView.getComponent(PlugTableView).initTableView(data.length, { array: data, target: this }); 46 | } 47 | 48 | //下一页(pageview下有效) 49 | nextPage () { 50 | this.tableView.getComponent(PlugTableView).scrollToNextPage(); 51 | } 52 | 53 | //上一页(pageview下有效) 54 | lastPage () { 55 | this.tableView.getComponent(PlugTableView).scrollToLastPage(); 56 | } 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /assets/Behavior/general/BhvFade.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-04-10 00:31:33 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-04-10 00:31:33 6 | */ 7 | 8 | const {ccclass, property,menu,disallowMultiple} = cc._decorator; 9 | 10 | /** 11 | * 即将淘汰的插件 12 | */ 13 | @ccclass 14 | @menu("添加特殊行为/General/Fade (渐隐渐显)") 15 | @disallowMultiple 16 | export default class BhvFade extends cc.Component { 17 | 18 | @property({ 19 | tooltip: "会在 start 时触发 fade 效果", 20 | }) 21 | activeAtStart:boolean = true; 22 | 23 | @property({ 24 | tooltip: "渐入时间", 25 | }) 26 | fadeInTime:number = 0; 27 | 28 | @property({ 29 | tooltip: "等待时间", 30 | }) 31 | waitTime:number = 0; 32 | 33 | @property({ 34 | tooltip:'淡出时间' 35 | }) 36 | fadeOutTime:number = 1; 37 | 38 | @property({ 39 | tooltip:'完成后是否destroy该节点' 40 | }) 41 | autoDestroy:boolean = true; 42 | 43 | // LIFE-CYCLE CALLBACKS: 44 | 45 | onLoad(){ 46 | if(this.fadeInTime>0) this.node.opacity = 0; //如果有 fade in 设置,那么初始透明度0 47 | } 48 | 49 | start () { 50 | if(this.activeAtStart)this.startFade(); 51 | } 52 | 53 | /**开始fade,按照默认配置的参数 */ 54 | startFade(){ 55 | var inTimer = this.fadeInTime||0; 56 | var waitTime = this.waitTime||0; 57 | var outTimer= this.fadeOutTime||0; 58 | this.fade(inTimer,waitTime,outTimer); 59 | } 60 | 61 | fade(from:number,wait:number,to:number){ 62 | var actList:Array = []; 63 | if(from>0)this.node.opacity = 0; 64 | 65 | if(from>0)actList.push(cc.fadeIn(from)); 66 | if(wait>0)actList.push(cc.delayTime(wait)); 67 | if(to>0)actList.push(cc.fadeOut(to)); 68 | if(to>0 && this.autoDestroy){ 69 | actList.push(cc.callFunc(this.destroy,this)); //完成动作自动销毁 70 | } 71 | 72 | var act:cc.Action = cc.sequence(actList); 73 | this.node.runAction(act); 74 | 75 | 76 | } 77 | 78 | 79 | } 80 | -------------------------------------------------------------------------------- /assets/Scene/input/DemoKeyBoard.ts: -------------------------------------------------------------------------------- 1 | import BhvKeyboard from "../../Behavior/input/BhvKeyboard"; 2 | 3 | // Learn TypeScript: 4 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html 5 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html 6 | // Learn Attribute: 7 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 8 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html 9 | // Learn life-cycle callbacks: 10 | // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 11 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 12 | 13 | const {ccclass, property} = cc._decorator; 14 | 15 | @ccclass 16 | export default class DemoKeyBoard extends cc.Component { 17 | 18 | @property(cc.Label) 19 | label: cc.Label = null; 20 | 21 | // LIFE-CYCLE CALLBACKS: 22 | 23 | // onLoad () {} 24 | 25 | onEnable(){ 26 | BhvKeyboard.AddMultKeys({ 27 | 'z':{ 28 | 'up':()=>{ 29 | cc.find('sprite_z',this.node).scale =0.8; 30 | }, 31 | 'down':()=>{ 32 | cc.find('sprite_z',this.node).scale = 1.1; 33 | } 34 | }, 35 | //可以获取按键的时间 36 | 'x':(duration:number)=>{ 37 | let scale = duration/1; 38 | if(scale>2)scale=2; 39 | cc.find('sprite_x',this.node).runAction(cc.sequence([ 40 | cc.scaleTo(0.1,1+scale*0.5,1), 41 | cc.scaleTo(0.1,1).easing(cc.easeBackOut()) 42 | ])) 43 | }, 44 | 45 | },this) 46 | } 47 | 48 | onDisable(){ 49 | BhvKeyboard.RemoveAllKeys(this); 50 | } 51 | 52 | start () { 53 | 54 | } 55 | 56 | update (dt) { 57 | //获取上一次按下的按键是哪一个 58 | this.label.string = BhvKeyboard.GetLastKeyName()+'('+ BhvKeyboard.GetLastKey()+')'; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvFrameIndex.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-04-24 15:44:01 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-04-24 15:59:43 6 | */ 7 | 8 | 9 | const {ccclass, property, executeInEditMode, requireComponent, menu} = cc._decorator; 10 | 11 | /** 12 | * [FrameIndex]帧图改变 13 | * ver 0.5.0 新功能追加,可以使用 图集模式,通过设置对象的名字模板来获取帧 14 | */ 15 | @ccclass 16 | @executeInEditMode 17 | @requireComponent(cc.Sprite) 18 | @menu("添加特殊行为/UI/Frame Index(帧图改变)") 19 | export default class BhvFrameIndex extends cc.Component { 20 | 21 | @property({ 22 | type:[cc.SpriteFrame], 23 | tooltip:'sprite将会用到帧图片', 24 | }) 25 | spriteFrames:Array = [null]; 26 | 27 | @property({ 28 | tooltip:'当前显示的帧图', 29 | type:cc.Integer 30 | }) 31 | get index(){ 32 | return this._index; 33 | } 34 | set index(value:number){ 35 | if (value < 0) return; 36 | this._index = value % this.spriteFrames.length; 37 | let sprite = this.node.getComponent(cc.Sprite); 38 | //设置 Sprite 组件的spriteFrame属性,变换图片 39 | sprite.spriteFrame = this.spriteFrames[this._index]; 40 | } 41 | @property 42 | private _index:number = 0; 43 | 44 | 45 | // LIFE-CYCLE CALLBACKS: 46 | 47 | /**通过设置帧名字来设置对象 */ 48 | public setName(name:string){ 49 | let index = this.spriteFrames.findIndex(v=>{return v.name == name}); 50 | if(index<0){cc.error('frameIndex 设置了不存在的name:',name)} 51 | this.index = index||0; 52 | 53 | } 54 | 55 | /**随机范围设置帧图片 */ 56 | public random(min?:number,max?:number){ 57 | if(!this.spriteFrames)return; 58 | let frameMax = this.spriteFrames.length; 59 | if(min ==null || min<0)min = 0; 60 | if(max == null || max >frameMax)max = frameMax; 61 | 62 | 63 | this.index = Math.floor( Math.random()* (max - min) + min ); 64 | } 65 | 66 | public next(){ 67 | this.index++; 68 | } 69 | 70 | public previous(){ 71 | this.index--; 72 | } 73 | 74 | // update (dt) {} 75 | } 76 | -------------------------------------------------------------------------------- /assets/Behavior/general/BhvBoundLayout.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-05-22 18:23:24 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-05-22 18:30:02 6 | */ 7 | 8 | 9 | const {ccclass, property,menu} = cc._decorator; 10 | 11 | /** 12 | * 边界布局 [v0.1.0] 13 | * 限制该节点的所有子节点在图层的内的边界尺寸内移动 14 | * 你可以决定是否 wrap 或者 bound 或者 接触边界自动销毁对象 15 | * 该组件不应该有静止不动的节点,如果只是针对少量节点的复杂情况请使用 BhvBoundary 行为 16 | */ 17 | @ccclass 18 | @menu("添加特殊行为/UI/Bound Layout(边界限制)") 19 | export default class BhvBoundLayout extends cc.Component { 20 | 21 | // LIFE-CYCLE CALLBACKS: 22 | 23 | // onLoad () {} 24 | 25 | @property({ 26 | tooltip:'使用包装模式,可以让节点从一边穿越到另外一边' 27 | }) 28 | wrap:boolean = false; 29 | 30 | @property({ 31 | tooltip:'接触到边界就进行自动销毁' 32 | }) 33 | outBoundDestroy:boolean = false; 34 | 35 | update (dt) { 36 | this.node.children.forEach(this.updateCheckRect,this) 37 | } 38 | 39 | updateCheckRect(node:cc.Node){ 40 | let parent = this.node; 41 | if(node.isValid||node.active === false)return; 42 | 43 | //相当于将需要绑定的目标 放入对象的 parent 里进行比较 44 | let pos = node.position; 45 | 46 | let left =(parent.width* (1-parent.anchorX)); 47 | let right = (parent.width* (-parent.anchorX)); 48 | let up = parent.height * (1-parent.anchorY); 49 | let down = parent.height * (-parent.anchorY); 50 | 51 | //left 52 | if((pos.x) > left){ 53 | node.x = this.wrap?right:left; 54 | if(this.outBoundDestroy)node.destroy(); 55 | } 56 | //right 57 | else if(( pos.x) < right){ 58 | node.x = this.wrap?left:right; 59 | if(this.outBoundDestroy)node.destroy(); 60 | } 61 | 62 | //up 63 | if((pos.y) > up){ 64 | node.y = this.wrap?down:up; 65 | if(this.outBoundDestroy)node.destroy(); 66 | } 67 | //down 68 | else if( (pos.y) this.speedMax)this.speed = this.speedMax; 86 | } 87 | if(this.direction){ 88 | this.node.rotation -= this.speed*dt; 89 | }else{ 90 | this.node.rotation += this.speed*dt; 91 | } 92 | 93 | } 94 | 95 | 96 | } 97 | -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvAreaTransfer.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-04-24 17:02:28 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-04-24 22:35:49 6 | */ 7 | 8 | 9 | const { ccclass, property, menu, disallowMultiple } = cc._decorator; 10 | 11 | /** 12 | * 区域传送者 [v0.1.0] 13 | * 绑定了这个行为的 对象 会在一个区域内随机传送 14 | * 一般用途为随机在区域出现的闪光 等效果 15 | * (一般是父节点,你也可以指定节点) 16 | */ 17 | @ccclass 18 | @menu("添加特殊行为/Movement/Area Transfer (区域随机)") 19 | @disallowMultiple 20 | export default class BhvAreaTransfer extends cc.Component { 21 | 22 | /**开始延迟闪烁时间(可以控制闪烁顺序) */ 23 | @property 24 | delayTime: number = 0; 25 | 26 | /**每次传送的间隔时间 */ 27 | @property 28 | waitTime: number = 0.5; 29 | 30 | /**传送间隔时间的取值随机范围 */ 31 | @property 32 | waitTimeRandom: number = 0; 33 | 34 | @property({ 35 | type:cc.Node, 36 | tooltip:'区域节点默认为自身父对象,如果需要引用其他节点,需要注意节点位置关系' 37 | }) 38 | private areaNode: cc.Node = null; 39 | 40 | private timer:number = 0; 41 | private targetTime:number = 0; 42 | 43 | 44 | // LIFE-CYCLE CALLBACKS: 45 | 46 | onLoad(){ 47 | this.targetTime = this.delayTime; 48 | } 49 | 50 | transPosition() { 51 | 52 | let parent = this.areaNode || this.node.getParent(); 53 | if(parent == null){console.error('Area Transfer 对象 必须有父节点')} 54 | let anchor = parent.getAnchorPoint(); 55 | let bounds = parent.getBoundingBox();//包围盒为父节点的包围盒 56 | let waitTime = this.waitTime + (Math.random() * 2 - 1) * this.waitTimeRandom; 57 | let rx = Math.random() * bounds.width - bounds.width * anchor.x; 58 | let ry = Math.random() * bounds.height - bounds.height * anchor.y; 59 | 60 | this.node.x = rx; 61 | this.node.y = ry; 62 | this.node.runAction(cc.sequence([ 63 | cc.fadeTo(waitTime*0.2, 255), 64 | cc.delayTime(waitTime*0.6), 65 | cc.fadeTo(waitTime*0.2, 0) 66 | ])); 67 | 68 | this.targetTime = waitTime; 69 | 70 | } 71 | 72 | start() { 73 | 74 | } 75 | 76 | update(dt){ 77 | if(!this.enabled)return; 78 | this.timer +=dt; 79 | if(this.timer >= this.targetTime){ 80 | this.timer = 0; 81 | this.transPosition(); 82 | } 83 | } 84 | 85 | 86 | } 87 | -------------------------------------------------------------------------------- /assets/Plugin/ui/PlugProgressBar.ts: -------------------------------------------------------------------------------- 1 | 2 | const {ccclass, property, executeInEditMode} = cc._decorator; 3 | 4 | //todo 格斗游戏中的,缓慢削减血 5 | // 功能不完善,等待处理... 6 | 7 | @ccclass 8 | @executeInEditMode 9 | export default class PlugProgressBar extends cc.ProgressBar { 10 | 11 | // LIFE-CYCLE CALLBACKS: 12 | 13 | @property(cc.Node) 14 | backBarSprite:cc.Node = null; 15 | 16 | @property({ 17 | tooltip:'线性差值' 18 | }) 19 | lerp:number = 0.1; 20 | 21 | @property({ 22 | type:[cc.Color], 23 | tooltip:'百分比改变颜色,由上到下改变颜色百分比,progress越少,颜色越少' 24 | }) 25 | percentColor:Array = [cc.color(0,255,0,255),cc.color(255,100,0,255),cc.color(255,255,0,255),cc.color(255,0,0,255)]; 26 | 27 | private _progress:number = 0; 28 | 29 | checkPercentColor(){ 30 | if(!this.percentColor)return; 31 | let max = this.percentColor.length; 32 | let cur = Math.floor( max * (1-this.progress) ); 33 | this.barSprite.node.color = this.percentColor[cur]; 34 | 35 | } 36 | 37 | update (dt) { 38 | //百分比不同,改变颜色 39 | if(this.progress != this._progress){ 40 | this.checkPercentColor(); 41 | } 42 | 43 | if(CC_EDITOR){ 44 | this.backBarSprite.width = this.backBarSprite.width; 45 | return; 46 | } 47 | 48 | //跟随血条移动 49 | if(this.backBarSprite){ 50 | let total = this.totalLength * this.progress; 51 | switch ( this.mode ) { 52 | case cc.ProgressBar.Mode.HORIZONTAL: 53 | this.backBarSprite.width = cc.misc.lerp(this.backBarSprite.width,total,this.lerp); 54 | break; 55 | case cc.ProgressBar.Mode.VERTICAL: 56 | this.backBarSprite.height = cc.misc.lerp(this.backBarSprite.height,total,this.lerp); 57 | break; 58 | case cc.ProgressBar.Mode.FILLED: 59 | this.backBarSprite.width = cc.misc.lerp(this.backBarSprite.width,total,this.lerp); 60 | this.backBarSprite.height = cc.misc.lerp(this.backBarSprite.height,total,this.lerp); 61 | break; 62 | 63 | default: 64 | break; 65 | } 66 | } 67 | 68 | this._progress = this.progress; 69 | 70 | 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvCircle.ts: -------------------------------------------------------------------------------- 1 | 2 | const { ccclass, property,menu,disallowMultiple} = cc._decorator; 3 | 4 | /**角度制,限制角度范围 */ 5 | let clamp_angle = function (a) { 6 | a %= 2 * 180; 7 | if (a < 0) a += 2 * 180; 8 | return a; 9 | }; 10 | 11 | /** 12 | * 圆周运动行为 [v1.0.0] 13 | * 控制节点以 当前所处位置,进行绕圈的圆周运动 14 | * 该行为会劫持节点坐标移动,因此不能和其他行为同时启动。 15 | */ 16 | @ccclass 17 | @menu("添加特殊行为/Movement/Circle (圆周运动)") 18 | @disallowMultiple 19 | export default class BhvCircle extends cc.Component { 20 | 21 | @property 22 | initialState:boolean = true; 23 | 24 | @property({tooltip:'圆运动速度'}) 25 | speed:number = 360; 26 | 27 | @property({tooltip:'加速度'}) 28 | accel:number = 0; 29 | 30 | @property({tooltip:'运动起始角度'}) 31 | angle:number = 50; 32 | 33 | @property({tooltip:'圆周半径'}) 34 | radius:cc.Vec2 = cc.v2(50,50); 35 | 36 | @property({tooltip:'是否以父节点而不是初始坐标为基准旋转, 初始坐标设为为(0,0)'}) 37 | rotateFromParent:boolean = false; 38 | 39 | 40 | 41 | originPos:cc.Vec2 = cc.v2(0,0); 42 | 43 | 44 | // LIFE-CYCLE CALLBACKS: 45 | 46 | start () { 47 | // set default 48 | let rad:number = cc.misc.degreesToRadians( this.angle); 49 | this.originPos.x = this.node.x;// - Math.cos(rad) * this.radius.x; 50 | this.originPos.y = this.node.y;// + Math.sin(rad) * this.radius.y; 51 | this.node.x = this.originPos.x - Math.cos(rad) * this.radius.x; 52 | this.node.y = this.originPos.x + Math.sin(rad) * this.radius.y; 53 | this.enabled = this.initialState; 54 | } 55 | 56 | update (dt:number) { 57 | if(!this.enabled)return; 58 | if (dt === 0) return; 59 | 60 | if (this.accel !== 0) 61 | this.speed += this.accel * dt; 62 | 63 | if (this.speed !== 0) 64 | { 65 | //转换弧度值运算 66 | this.angle = clamp_angle( this.angle + this.speed * dt); 67 | let rad:number = cc.misc.degreesToRadians(this.angle); 68 | if(this.rotateFromParent){ 69 | this.node.x = (Math.cos(rad) * (this.radius.x) ); 70 | this.node.y = -(Math.sin(rad) * (this.radius.y) ); 71 | }else{ 72 | this.node.x = (Math.cos(rad) * (this.radius.x) ) + this.originPos.x; 73 | this.node.y = -(Math.sin(rad) * (this.radius.y) ) + this.originPos.y; 74 | 75 | } 76 | 77 | } 78 | 79 | 80 | 81 | } 82 | 83 | /**设置运动半径 */ 84 | setRadius(vec2:cc.Vec2){ 85 | this.radius = cc.v2(vec2); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /assets/Test/BhvSpring.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-05-04 00:08:34 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-05-04 00:08:57 6 | */ 7 | 8 | 9 | const { ccclass, property } = cc._decorator; 10 | 11 | /** 12 | * 弹簧,弹性动画效果 13 | */ 14 | @ccclass 15 | export default class BhvSpring extends cc.Component { 16 | 17 | // Spring drawing constants for top bar 18 | minHeight = 100; //最下压缩高度 19 | maxHeight = 200; //极限膨胀高度 20 | 21 | // 弹性模拟参数 22 | @property 23 | mass = 0.8; // Mass 24 | 25 | @property 26 | springConstant = 0.2; // Spring constant 27 | 28 | @property 29 | damping = 0.92; // Damping 30 | 31 | @property 32 | restPos = 200; // Rest position 33 | 34 | // Spring simulation variables(变量) 35 | _position = 200; // Position 36 | _velocity = 0.0; // Velocity 37 | _acceleration = 0; // Acceleration 38 | _force = 0; // Force 39 | 40 | move:boolean = false; 41 | 42 | onLoad(){ 43 | this._position = 100; 44 | } 45 | 46 | damp(speed:number = 1){ 47 | this._velocity = speed; 48 | } 49 | 50 | onEventDamp(e,data:string = '0'){ 51 | this._velocity = parseFloat(data); 52 | } 53 | 54 | //自动刷新弹簧状态 55 | update() { 56 | if(!this.move){ 57 | this._force = -this.springConstant * (this._position - this.restPos); // f=-ky 58 | this._acceleration = this._force / this.mass; // Set the acceleration, f=ma == a=f/m 59 | this._velocity = this.damping * (this._velocity + this._acceleration); // Set the velocity 60 | this._position = this._position + this._velocity; // Updated position 61 | this.node.width = this._position; 62 | } 63 | 64 | if (Math.abs(this._velocity) < 0.1) { 65 | this._velocity = 0.0; 66 | } 67 | 68 | if (this.move) { 69 | // this._position = this.mouseY - this.springHeight / 2; 70 | // if(this._positionthis.maxHeight)this._position = this.maxHeight; 72 | 73 | } 74 | 75 | this.drawSpring(); 76 | 77 | 78 | } 79 | 80 | drawSpring() { 81 | // Draw base 82 | 83 | let baseWidth = 0.5 * this._position + -8; 84 | //rect(, , width / 2 + baseWidth, height); 85 | this.node.width = baseWidth; 86 | this.node.height = this._position; 87 | 88 | //rect(left, ps, right, ps + springHeight); 89 | } 90 | 91 | 92 | } 93 | -------------------------------------------------------------------------------- /assets/Behavior/demo/BhvAfterImage.ts: -------------------------------------------------------------------------------- 1 | const { ccclass, property } = cc._decorator; 2 | 3 | /** 4 | * 图片残影 [v0.0.1] 5 | * 残影效果(未实现) 6 | */ 7 | @ccclass 8 | export default class BhvAfterImage extends cc.Component { 9 | @property(cc.Camera) 10 | camera: cc.Camera = null; 11 | 12 | //表示当前帧的RenderTexture 13 | @property(cc.Sprite) 14 | spriteNew: cc.Sprite = null; 15 | 16 | //表示上一帧的RenderTexture 17 | @property(cc.Sprite) 18 | spriteOld: cc.Sprite = null; 19 | 20 | texture1: cc.RenderTexture; 21 | texture2: cc.RenderTexture; 22 | 23 | flag: boolean = true; 24 | public showAfterImage = false; 25 | 26 | public oldX: number = 0; 27 | public oldY: number = 0; 28 | 29 | onLoad() { 30 | //初始化渲染纹理 31 | this.texture1 = new cc.RenderTexture(); 32 | this.texture1.initWithSize(cc.winSize.width, cc.winSize.height); 33 | this.texture2 = new cc.RenderTexture(); 34 | this.texture2.initWithSize(cc.winSize.width, cc.winSize.height); 35 | this.camera = cc.Camera.findCamera(cc.find("Canvas/Cameras")); 36 | } 37 | 38 | addShadow() { 39 | if(this.camera==null)return; //未设置相机,不生效 40 | //设置相机的渲染目标 41 | if (this.flag) { 42 | this.camera.targetTexture = this.texture1; 43 | } else { 44 | this.camera.targetTexture = this.texture2; 45 | } 46 | if (this.flag) { 47 | //当前渲染目标为t1,则上一帧的缓冲为t2 48 | let spriteFrame = new cc.SpriteFrame(); 49 | spriteFrame.setTexture(this.texture2); 50 | //更新残影图片 51 | this.spriteOld.spriteFrame = spriteFrame; 52 | } else { 53 | let spriteFrame = new cc.SpriteFrame(); 54 | spriteFrame.setTexture(this.texture1); 55 | this.spriteOld.spriteFrame = spriteFrame; 56 | } 57 | this.spriteOld.node.setPosition(this.camera.node.getPosition()); 58 | //将摄像机拍摄的图像渲染到渲染纹理内 59 | this.camera.render(this.node.getParent()); 60 | 61 | if (this.flag) { 62 | //当前渲染目标为t1,则将t1显示到屏幕上 63 | let spriteFrame = new cc.SpriteFrame(); 64 | spriteFrame.setTexture(this.texture1); 65 | //更新残影图片 66 | this.spriteNew.spriteFrame = spriteFrame; 67 | } else { 68 | let spriteFrame = new cc.SpriteFrame(); 69 | spriteFrame.setTexture(this.texture2); 70 | this.spriteNew.spriteFrame = spriteFrame; 71 | } 72 | this.flag = !this.flag; 73 | } 74 | 75 | start() { 76 | this.schedule(this.addShadow, 0.1, cc.macro.REPEAT_FOREVER, 0); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /assets/Behavior/general/BhvAfterImage.ts: -------------------------------------------------------------------------------- 1 | const { ccclass, property } = cc._decorator; 2 | 3 | /** 4 | * [准备开发] 5 | * 残影效果(未实现) 6 | */ 7 | @ccclass 8 | export default class BhvAfterImage extends cc.Component { 9 | @property(cc.Camera) 10 | camera: cc.Camera = null; 11 | 12 | //表示当前帧的RenderTexture 13 | @property(cc.Sprite) 14 | spriteNew: cc.Sprite = null; 15 | 16 | //表示上一帧的RenderTexture 17 | @property(cc.Sprite) 18 | spriteOld: cc.Sprite = null; 19 | 20 | texture1: cc.RenderTexture; 21 | texture2: cc.RenderTexture; 22 | 23 | flag: boolean = true; 24 | public showAfterImage = false; 25 | 26 | public oldX: number = 0; 27 | public oldY: number = 0; 28 | 29 | onLoad() { 30 | //初始化渲染纹理 31 | this.texture1 = new cc.RenderTexture(); 32 | this.texture1.initWithSize(cc.winSize.width, cc.winSize.height); 33 | this.texture2 = new cc.RenderTexture(); 34 | this.texture2.initWithSize(cc.winSize.width, cc.winSize.height); 35 | this.camera = cc.Camera.findCamera(cc.find("Canvas/Cameras")); 36 | } 37 | 38 | addShadow() { 39 | if(this.camera==null)return; //未设置相机,不生效 40 | //设置相机的渲染目标 41 | if (this.flag) { 42 | this.camera.targetTexture = this.texture1; 43 | } else { 44 | this.camera.targetTexture = this.texture2; 45 | } 46 | if (this.flag) { 47 | //当前渲染目标为t1,则上一帧的缓冲为t2 48 | let spriteFrame = new cc.SpriteFrame(); 49 | spriteFrame.setTexture(this.texture2); 50 | //更新残影图片 51 | this.spriteOld.spriteFrame = spriteFrame; 52 | } else { 53 | let spriteFrame = new cc.SpriteFrame(); 54 | spriteFrame.setTexture(this.texture1); 55 | this.spriteOld.spriteFrame = spriteFrame; 56 | } 57 | this.spriteOld.node.setPosition(this.camera.node.getPosition()); 58 | //将摄像机拍摄的图像渲染到渲染纹理内 59 | this.camera.render(this.node.getParent()); 60 | 61 | if (this.flag) { 62 | //当前渲染目标为t1,则将t1显示到屏幕上 63 | let spriteFrame = new cc.SpriteFrame(); 64 | spriteFrame.setTexture(this.texture1); 65 | //更新残影图片 66 | this.spriteNew.spriteFrame = spriteFrame; 67 | } else { 68 | let spriteFrame = new cc.SpriteFrame(); 69 | spriteFrame.setTexture(this.texture2); 70 | this.spriteNew.spriteFrame = spriteFrame; 71 | } 72 | this.flag = !this.flag; 73 | } 74 | 75 | start() { 76 | this.schedule(this.addShadow, 0.1, cc.macro.REPEAT_FOREVER, 0); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /assets/Script/Data/SceneManager.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-03-08 17:30:56 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-03-15 19:58:53 6 | */ 7 | 8 | let SCENE_NAME = { 9 | HOME:'Home', //背景音路径 10 | LEVEL:'Level', //UI音效路径 11 | DEMO:'DemoScene' 12 | } 13 | 14 | const LOAD_PREFAB_PATH = "prefab/WindowPreload"; 15 | 16 | /** 17 | * 场景管理,管理场景的切换和预加载 18 | */ 19 | class SceneManager { 20 | 21 | private targetScene:string = null; 22 | private isAutoStart:boolean = false; 23 | private isLoading:boolean = false; 24 | public SCENES = SCENE_NAME; 25 | 26 | preloadScene(name:string,autoStart:boolean = false){ 27 | 28 | //TODO 优化加载界面结构..... 29 | if(this.isLoading)return; 30 | 31 | this.isLoading = true; 32 | cc.loader.loadRes(LOAD_PREFAB_PATH,cc.Prefab,(e,res:cc.Prefab)=>{ 33 | let canvas = cc.find('Canvas'); 34 | let node = cc.instantiate(res); 35 | canvas.addChild(node); 36 | 37 | let progressBar = node.getChildByName('content').getChildByName('progressBar'); 38 | let progress = progressBar.getComponent(cc.ProgressBar); 39 | let number = node.getChildByName('content').getChildByName('number'); 40 | let progressLabel = number.getComponent(cc.Label); 41 | 42 | //cc.director.loadScene("MyScene",this.onSceneLaunched) 43 | this.targetScene = name; 44 | this.isAutoStart = autoStart; 45 | //预加载场景 46 | cc.director.preloadScene(name,(completedCount: number, totalCount: number, item: any)=>{ 47 | //进度条 48 | progress.progress = completedCount/totalCount; 49 | progressLabel.string = Math.floor(completedCount/totalCount *100).toString(); 50 | 51 | },(e)=>{ 52 | progress.progress = 1; 53 | progressLabel.string = "100"; 54 | this.isLoading = false; 55 | this.onPreloadFinish(e) 56 | }); 57 | 58 | }); 59 | 60 | 61 | } 62 | 63 | loadScene(name:string){ 64 | //切换场景 65 | cc.director.loadScene(name,this.onSceneLaunched) 66 | } 67 | 68 | onPreloadFinish(e){ 69 | console.log("Next scene preloaded:"); 70 | //加载完成,读取新场景 71 | if(this.isAutoStart){ 72 | this.loadScene(this.targetScene); 73 | } 74 | } 75 | 76 | onSceneLaunched(){ 77 | 78 | } 79 | 80 | 81 | 82 | // update (dt) {} 83 | } 84 | 85 | export let sceneManager = new SceneManager(); 86 | -------------------------------------------------------------------------------- /assets/Behavior/animate/BhvGroupTween.ts: -------------------------------------------------------------------------------- 1 | import {ANI_ACTION_TYPE, EASE_TYPE, IGetAniActionConfig, TweenConfig } from './commonTween'; 2 | const {ccclass, property,menu} = cc._decorator; 3 | 4 | /** 5 | * 群体动画 [v1.0.0] 6 | * 适用于需要控制一群节点批量进行动画移动的情况 7 | */ 8 | @ccclass 9 | @menu("添加特殊行为/Animate/Group Tween (组tween)") 10 | export default class BhvGroupTween extends cc.Component { 11 | 12 | 13 | @property({ 14 | tooltip:'延迟决定,什么时候播放tween动画' 15 | }) 16 | delayTime:number = 0; 17 | 18 | @property({ 19 | tooltip:'动画时间' 20 | }) 21 | easeTime:number = 0; 22 | 23 | @property({ 24 | tooltip:'对于需要tween的节点,与之前一个节点相间隔的时间' 25 | }) 26 | delayTimeOffset:number = 0; 27 | 28 | @property 29 | reverseOrder:boolean = false; 30 | 31 | /** 进入动画类型 */ 32 | @property({ 33 | type: cc.Enum(ANI_ACTION_TYPE), 34 | tooltip: '入口动画', 35 | displayName: 'Animation Type', 36 | }) 37 | private animationType: ANI_ACTION_TYPE = ANI_ACTION_TYPE.SCALE; 38 | 39 | /** 进入动画TWEEN类型 */ 40 | @property({ 41 | type: cc.Enum(EASE_TYPE), 42 | tooltip: '入口动画 的 TWEEN 类型', 43 | displayName: 'Animation Tween', 44 | }) 45 | private easeType: EASE_TYPE = EASE_TYPE.SineInOut; 46 | 47 | @property([cc.Node]) 48 | private tweenNodes:cc.Node[] = []; 49 | 50 | 51 | // LIFE-CYCLE CALLBACKS: 52 | 53 | onLoad () { 54 | 55 | if(this.tweenNodes.length<=0){ 56 | this.tweenNodes = this.tweenNodes.concat(this.node.children); 57 | } 58 | 59 | } 60 | 61 | start () { 62 | 63 | this.node.opacity = 0; 64 | this.scheduleOnce(()=>{ 65 | this.node.opacity = 255; 66 | this.playIn(); 67 | },0.1); 68 | 69 | } 70 | 71 | runTweenAction(node:cc.Node,index:number,reverse:boolean = false){ 72 | 73 | let id = this.reverseOrder?(this.node.children.length-1-index):index; 74 | let time = this.delayTime + this.delayTimeOffset * id; 75 | 76 | let config:IGetAniActionConfig = { 77 | type: this.animationType, 78 | time:this.easeTime, 79 | isActionOut:reverse, 80 | ease:this.easeType, 81 | node: node, 82 | width: this.node.width, 83 | height: this.node.height, 84 | delay:time 85 | } 86 | 87 | let action = TweenConfig.getAction(config); 88 | node.runAction(action); 89 | 90 | } 91 | 92 | playIn(){ 93 | this.tweenNodes.forEach((element,index) => { 94 | this.runTweenAction(element, index, false); 95 | }); 96 | } 97 | 98 | playOut(){ 99 | this.tweenNodes.forEach((element,index) => { 100 | this.runTweenAction(element, index, true); 101 | }); 102 | } 103 | 104 | // update (dt) {} 105 | } 106 | -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvRotateTo.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-07-06 18:15:06 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-07-06 19:05:49 6 | */ 7 | 8 | 9 | const {ccclass, property,menu,disallowMultiple} = cc._decorator; 10 | 11 | 12 | 13 | /** 14 | * 旋转到 [v1.0.0] 15 | * 旋转行为会使节点自动旋转到某个特定位置 16 | */ 17 | @ccclass 18 | @menu("添加特殊行为/Movement/RotateTo (旋转到指定角度)") 19 | @disallowMultiple 20 | export default class BhvRotateTo extends cc.Component { 21 | 22 | // LIFE-CYCLE CALLBACKS: 23 | 24 | 25 | targetAngle:number = 0; 26 | 27 | @property 28 | lerpValue:number = 0.01; 29 | 30 | @property({ 31 | tooltip:'角度精细度的范围差', 32 | range:[0,1] 33 | }) 34 | precisionAngle:number = 0.1; 35 | 36 | _lerpValue:number = 0.01; 37 | 38 | /**lerp 减速 */ 39 | lerpDecel:number = 0.01; 40 | 41 | @property( { type: [cc.Component.EventHandler] } ) 42 | finishEvents:cc.Component.EventHandler[] = [] 43 | 44 | private isRun:boolean = false; 45 | 46 | 47 | // @property({ 48 | // tooltip:'低速滚动模式(一般是转盘这种需要区分阶段)' 49 | // }) 50 | // delayStopMode:boolean = false; 51 | 52 | onLoad(){ 53 | this._lerpValue = this.lerpValue; 54 | } 55 | 56 | 57 | /** 58 | * wrap 角度的旋转角度,比如720 度,可以被设置为 0度,360 59 | * @param loop 60 | */ 61 | wrapAngleCircle(loop:number = 0){ 62 | this.node.rotation = this.node.rotation%360 + loop*360; 63 | } 64 | 65 | 66 | /** 67 | * 旋转到指定角度(逆向请传入负值角度 68 | * @param angle 角度 69 | * @param lerp lerp 70 | */ 71 | rotateTo(angle:number,lerp?:number,precisionAngle:number =0.1){ 72 | if(lerp!== null && lerp !== undefined){ 73 | this._lerpValue = this.lerpValue = lerp; 74 | } 75 | if(precisionAngle){ 76 | this.precisionAngle = precisionAngle; 77 | } 78 | 79 | this.targetAngle = angle; 80 | this.isRun = true; 81 | } 82 | 83 | rotateAdd(angle:number,lerp:number){ 84 | if(lerp!== null && lerp !== undefined){ 85 | this._lerpValue = this.lerpValue = lerp; 86 | } 87 | 88 | this.targetAngle = this.node.rotation + angle; 89 | this.isRun = true; 90 | } 91 | 92 | 93 | /**停止旋转节点 */ 94 | stop (){ 95 | this.isRun = false; 96 | } 97 | 98 | update (dt:number) { 99 | if(!this.isRun)return; 100 | let lerp = dt * this._lerpValue * 60; 101 | 102 | this.node.rotation = cc.misc.lerp(this.node.rotation,this.targetAngle,lerp); 103 | if(Math.abs(this.node.rotation-this.targetAngle)<=this.precisionAngle){ 104 | this.isRun = false; 105 | this.node.rotation = this.targetAngle; 106 | this.finishEvents.forEach(comp=>{ 107 | comp.emit([comp.customEventData]); 108 | }) 109 | } 110 | 111 | } 112 | 113 | 114 | } 115 | -------------------------------------------------------------------------------- /assets/Test/BhvChainGroup2.ts: -------------------------------------------------------------------------------- 1 | // Learn TypeScript: 2 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/typescript.html 3 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html 4 | // Learn Attribute: 5 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 6 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html 7 | // Learn life-cycle callbacks: 8 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 9 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 10 | 11 | const {ccclass, property} = cc._decorator; 12 | 13 | /** 14 | * 15 | * TODO 可以将自己定义的节点构成 chain,而不是默认的组件绑定节点的 子节点 16 | */ 17 | @ccclass 18 | export default class BhvChainGroup2 extends cc.Component { 19 | 20 | @property 21 | nodeArray:cc.Node[] = []; 22 | 23 | @property 24 | segLength = 64; 25 | 26 | @property(cc.Node) 27 | targetNode:cc.Node = null; 28 | 29 | private targetPos:cc.Vec2 = cc.v2(0,0); 30 | // LIFE-CYCLE CALLBACKS: 31 | 32 | onLoad () { 33 | if(this.nodeArray.length<=0){ 34 | this.nodeArray = this.nodeArray.concat(this.node.children); 35 | } 36 | } 37 | 38 | start () { 39 | let left = this.nodeArray[this.nodeArray.length-1]; 40 | left.x = 120; 41 | left.y = 150; 42 | } 43 | 44 | update (dt) { 45 | //chain绑定 46 | if(this.targetNode){ 47 | this.reachSegment(0, this.targetNode.x, this.targetNode.y); //头部牵引坐标节点 48 | 49 | } 50 | 51 | for (let i = 1; i < this.nodeArray.length; i++) { 52 | this.reachSegment(i, this.targetPos.x, this.targetPos.y); 53 | } 54 | 55 | for (let j = this.nodeArray.length - 1; j >= 1; j--) { 56 | this.positionSegment(j, j - 1); 57 | } 58 | 59 | for (let k = 0; k < this.nodeArray.length; k++) { 60 | let node = this.nodeArray[k]; 61 | //node.scale = (k+1)/8+1 62 | //this.segment(node.x, node.y, node.rotation, (k + 1) * 2); 63 | } 64 | 65 | } 66 | 67 | positionSegment(_a,_b){ 68 | let a = this.nodeArray[_a]; 69 | let b = this.nodeArray[_b]; 70 | b.x = a.x + Math.cos(-1*cc.misc.degreesToRadians(a.rotation)) * this.segLength; 71 | b.y = a.y + Math.sin(-1*cc.misc.degreesToRadians(a.rotation)) * this.segLength; 72 | } 73 | 74 | reachSegment(i,xin,yin){ 75 | let node = this.nodeArray[i]; 76 | const dx = xin - node.x; 77 | const dy = yin - node.y; 78 | node.rotation = cc.misc.radiansToDegrees( -1 * Math.atan2(dy,dx)); 79 | this.targetPos.x = xin - Math.cos(-1*cc.misc.degreesToRadians(node.rotation)) * this.segLength; 80 | this.targetPos.y = (yin - Math.sin(-1*cc.misc.degreesToRadians(node.rotation)) * this.segLength); 81 | 82 | } 83 | 84 | 85 | } 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /assets/Plugin/ui/PlugTableViewCell.ts: -------------------------------------------------------------------------------- 1 | import PlugTableView from "./PlugTableView"; 2 | 3 | 4 | const {ccclass, property} = cc._decorator; 5 | 6 | /** 7 | * 配合 PlugTableView 使用,作为 PlugTableView 的细胞, 8 | * 请注意, 只能在继承后使用 9 | * 通过重载 longClicked \ clicked \ init 函数 调用 10 | */ 11 | @ccclass 12 | export default class PlugTableViewCell extends cc.Component { 13 | 14 | @property({ 15 | visible: false 16 | }) 17 | tableView:PlugTableView = null; 18 | 19 | @property 20 | private _isCellInit_:boolean = false; 21 | 22 | @property 23 | private _longClicked_:boolean = false; 24 | 25 | // LIFE-CYCLE CALLBACKS: 26 | 27 | // onLoad () {} 28 | 29 | /** 不可以重写 */ 30 | private _cellAddMethodToNode_ () { 31 | this.node['clicked'] = this.clicked.bind(this); 32 | } 33 | 34 | private _cellAddTouch_ () { 35 | this.node.on(cc.Node.EventType.TOUCH_START, function (event) { 36 | if (this.node.active === true && this.node.opacity !== 0) { 37 | if (!this._longClicked_) { 38 | this._longClicked_ = true; 39 | this.scheduleOnce(this._longClicked, 1.5); 40 | } 41 | } 42 | }, this); 43 | this.node.on(cc.Node.EventType.TOUCH_MOVE, function () { 44 | if (this._longClicked_) { 45 | this._longClicked_ = false; 46 | this.unschedule(this._longClicked); 47 | } 48 | }, this); 49 | this.node.on(cc.Node.EventType.TOUCH_END, function () { 50 | this.clicked(); 51 | if (this._longClicked_) { 52 | this._longClicked_ = false; 53 | this.unschedule(this._longClicked); 54 | } 55 | }, this); 56 | this.node.on(cc.Node.EventType.TOUCH_CANCEL, function () { 57 | if (this._longClicked_) { 58 | this._longClicked_ = false; 59 | this.unschedule(this._longClicked); 60 | } 61 | }, this); 62 | } 63 | 64 | private _cellInit_(tableView) { 65 | this.tableView = tableView; 66 | if (!this._isCellInit_) { 67 | this._cellAddMethodToNode_(); 68 | this._cellAddTouch_(); 69 | this._isCellInit_ = true; 70 | } 71 | } 72 | 73 | private _longClicked() { 74 | this._longClicked_ = false; 75 | this.node.emit(cc.Node.EventType.TOUCH_CANCEL); 76 | this.longClicked(); 77 | } 78 | 79 | /** (可重载) 长按时对应的方法 */ 80 | longClicked() { 81 | 82 | } 83 | 84 | /** (可重载) 被点击时相应的方法 */ 85 | clicked() { 86 | 87 | } 88 | 89 | /** 90 | * (可重载) 加载需要初始化数据时调用 91 | * ( index, data, reload, group = [] ) 92 | * @param index cell的排序下标 93 | * @param data 自定义 初始化 tableView 时传入的data 94 | * @param reload 当前是否执行的是 tableView.reload() 操作 95 | * @param group 得到当前组 96 | */ 97 | init(index:number, data:{array?:Array,target?:any}, reload:boolean, group:[number,number]) { 98 | 99 | } 100 | 101 | // update (dt) {} 102 | } 103 | 104 | -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvAtlasFrame.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-04-24 16:03:19 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-04-24 16:41:35 6 | */ 7 | 8 | 9 | const { ccclass, property, executeInEditMode, requireComponent, menu } = cc._decorator; 10 | 11 | /** 12 | * 图集帧 [v0.5.0] 13 | * ver 0.5.0 新功能追加,可以使用 图集模式,通过设置对象的名字模板来获取帧 14 | */ 15 | @ccclass 16 | @executeInEditMode 17 | @requireComponent(cc.Sprite) 18 | @menu("添加特殊行为/UI/Frame Name(帧图设置)") 19 | export default class BhvAtlasFrame extends cc.Component { 20 | 21 | @property(cc.SpriteAtlas) 22 | public spriteAtlas: cc.SpriteAtlas = null; 23 | 24 | @property({ 25 | type: cc.SpriteFrame, 26 | tooltip: '默认的帧图名字,如果找不到对应的名字将使用这个帧代替' 27 | }) 28 | public defaultFrame: cc.SpriteFrame = null; 29 | 30 | @property({ 31 | tooltip: '索引模式,启用后可以使用模板名字符来设置index' 32 | }) 33 | indexMode: boolean = false; 34 | 35 | @property({ 36 | type: cc.Integer, 37 | tooltip: "帧图的最大取值范围 0 ~ indexMax", 38 | visible: function () { return this.indexMode === true; } 39 | }) 40 | public indexMax: number = 9; 41 | 42 | /**模板 用*代替你要的索引值的位置, 例如 name_* > name_2, find_* > find_2, 索引通过 this.index 获取 */ 43 | @property({ 44 | tooltip: 'name_*_a 的方式可以动态的设置帧图名和index', 45 | visible: function () { return this.indexMode === true; } 46 | }) 47 | atlasNameTemplate: string = "*"; 48 | 49 | @property 50 | private _index: number = 0; 51 | public get index(): number { 52 | return this._index; 53 | } 54 | @property({ 55 | type: cc.Integer, 56 | tooltip: 'name_{i}_a 的方式可以动态的设置帧图名和index', 57 | visible: function () { return this.indexMode === true; } 58 | }) 59 | public set index(v: number) { 60 | if (v < 0) v = 0; 61 | if (v > this.indexMax) v = this.indexMax; 62 | this._index = v; 63 | this.frameName = this.getNameFromTemplate(v); 64 | } 65 | 66 | @property 67 | private _frameName: string = ''; 68 | public get frameName(): string { 69 | return this._frameName; 70 | } 71 | @property({ 72 | tooltip: '按名字,设置对应atlas图集 的 spriteFrame', 73 | visible: function () { return this.indexMode === false; } 74 | }) 75 | public set frameName(v: string) { 76 | let frame = this.spriteAtlas.getSpriteFrame(v); 77 | // 默认动画帧 不会在运行时判断 78 | if (!CC_EDITOR && frame == null && this.defaultFrame) { 79 | frame = this.defaultFrame; 80 | v = frame.name; 81 | } 82 | this.getComponent(cc.Sprite).spriteFrame = frame; 83 | if (frame) { 84 | this.node.width = frame.getOriginalSize().width; 85 | this.node.height = frame.getOriginalSize().height; 86 | } 87 | this._frameName = v; 88 | 89 | } 90 | 91 | 92 | // LIFE-CYCLE CALLBACKS: 93 | 94 | // onLoad () {} 95 | private getNameFromTemplate(index: number) { 96 | return this.atlasNameTemplate.replace('*', index.toString()); 97 | } 98 | 99 | start() { 100 | 101 | } 102 | 103 | // update (dt) {} 104 | } 105 | -------------------------------------------------------------------------------- /doc/Behavior/logic/BhvFSM.md: -------------------------------------------------------------------------------- 1 | Bhv FSM 2 | 3 | ### 介绍 4 | 5 | 简单实现的状态机组件,通过继承方式使用。添加状态后,需要手动切换状态。该组件会调用自身的 进入、更新、离开 三个函数,以提供基础的状态机功能。 6 | 7 | ### 更新 8 | 9 | - 0.1 - 更新基本状态机的功能 10 | 11 | ### 属性 12 | 13 | - debug​:​ 显示打印状态机的调试信息 14 | - currentState: 状态机的初始状态名 15 | - preState: 上一个状态 16 | - duration: 状态机的运行时间,状态切换后都会重置,可用于判断当前状态持续时间。 17 | - paused: 状态机是否暂停运行逻辑 18 | 19 | ### 绑定逻辑 20 | 21 | 1. 声明 类 MyFSM 继承自 BhvFSM 组件 22 | 2. 在 start 生命周期函数添加状态。 23 | 3. 在MyFSM类中声明不同的状态对应的触发函数: onXXXEnter / onXXXUpdate / onXXExit 24 | 4. 对应函数会在同名的状态切换的对应时机触发。比如onWalkEnter,是在 Walk 状态进入后触发的。 25 | 5. 在不同的状态触发函数中,自己控制逻辑操作和对应条件的状态。 26 | 6. 将 MyFSM 组件 挂在对应的对象身上 27 | 28 | ### 脚本方法 29 | 30 | - addState(state: string) - 添加一个状态 31 | 32 | ```typescript 33 | let fsm = this.node.getComponent('BhvFSM'); 34 | fsm.addState("Walk"); 35 | ``` 36 | 37 | - addStates(states: object) - 添加一组状态 38 | 39 | ```typescript 40 | let fsm = this.node.getComponent('BhvFSM'); 41 | fsm.addState("Walk"); 42 | //添加一组状态机的键名 43 | let states = { 44 | WALK:"Walk", 45 | RUN:"Run", 46 | STOP:"Stop" 47 | } 48 | 49 | fsm.addStates(states); 50 | 51 | ``` 52 | 53 | - removeState(state: string) - 移除一个状态 54 | 55 | ```typescript 56 | let fsm = this.node.getComponent('BhvFSM'); 57 | //移除状态 58 | fsm.removeState("Walk"); 59 | ``` 60 | 61 | - getState(state: string): string - 获取一个状态 62 | 63 | ```typescript 64 | let fsm = this.node.getComponent('BhvFSM'); 65 | let res = this.getState("Start"); 66 | if(res == null){ 67 | //状态不存在 68 | } 69 | ``` 70 | 71 | - changeState(*state*: *string* ) - 改变一个状态 72 | 73 | ```typescript 74 | let fsm = this.node.getComponent('BhvFSM'); 75 | let res = this.getState("Start"); 76 | if(res == null){ 77 | //状态不存在 78 | } 79 | ``` 80 | 81 | - removeAllStates(): string - 移除所有的 states, 如果当前处于该状态会强制触发离开 82 | 83 | - resetState(); //重启状态, 此方法会重启状态,重新调用状态的入口函数 84 | 85 | ### 完整例子 86 | 87 | - 可以参考以下方式建立自己的FSM 88 | 89 | ```typescript 90 | const STATE = { 91 | Idle:"Idle" 92 | WALK:"Walk", 93 | RUN:"Run", 94 | STOP:"Stop" 95 | } 96 | 97 | @ccclass 98 | export default class MyFSM extends BhvFSM { 99 | static STATE = STATE; 100 | start(){ 101 | this.addStates(STATE); 102 | this.changeState(STATE.Idel); 103 | } 104 | 105 | //可以通过函数参数获得状态名,也可以通过 this.currentState 获得 106 | onIdleEnter(cur:string,pre:string){ 107 | this.changeState(STATE.Walk); 108 | } 109 | onWalkEnter(){ 110 | cc.log("开始走路!"); 111 | } 112 | onWalkUpdate(){ 113 | cc.log("走路!"); 114 | if(this.duration>=0.5){ 115 | this.changeState(STATE.Run); 116 | } 117 | } 118 | 119 | onRunEnter(){ 120 | cc.log("跑起来了!"); 121 | } 122 | onRunUpdate(){ 123 | cc.log("狂奔!"); //update会持续刷新 124 | if(this.duration>=1.0){ 125 | this.changeState(STATE.Stop); 126 | } 127 | } 128 | 129 | onRunExit(){ 130 | cc.log("不跑了!"); 131 | } 132 | 133 | onStopEnter(){ 134 | cc.log("筋疲力尽!"); 135 | } 136 | 137 | 138 | } 139 | 140 | 141 | ``` 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /assets/Behavior/general/BhvAudioSource.ts: -------------------------------------------------------------------------------- 1 | 2 | const {ccclass, property,menu,executionOrder} = cc._decorator; 3 | 4 | /** 5 | * 音频管理器 [v1.0.0] 6 | * 自动管理音频状态,改进自官方组件,可以控制音量播放, 淡入淡出功能 7 | */ 8 | @ccclass 9 | @menu('其他组件/WSS:AudioSource') 10 | @executionOrder(-1) 11 | export default class BhvAudioSource extends cc.AudioSource { 12 | 13 | // // LIFE-CYCLE CALLBACKS: 14 | // @property 15 | // useFadeIn:boolean = true; 16 | 17 | static _TempSources:{source:BhvAudioSource,tag:string}[] = []; 18 | /**设置指定tag 的 audioSource 的音量 */ 19 | static VolumeTag:any = {}; 20 | /**设置所有默认效果音的音量 */ 21 | static DefaultVolume:number = 1.0; 22 | static SetTagVolume(tag:string,volume:number =1.0){ 23 | this.VolumeTag[tag] = volume; 24 | this.UpdateVolume(); 25 | } 26 | static SetDefaultVolume(volume:number =1.0){ 27 | this.DefaultVolume = volume; 28 | this.UpdateVolume(); 29 | } 30 | static GetTagVolume(tag:string){ 31 | if(tag in this.VolumeTag){ 32 | return this.VolumeTag[tag]; 33 | }else{ 34 | return this.DefaultVolume; 35 | } 36 | }; 37 | /**手动更新 所有 基于 BhvAudioSource 组件 的音量 */ 38 | static UpdateVolume(){ 39 | this._TempSources.forEach(config=>{ 40 | config.source.volume = this.DefaultVolume; 41 | if(config.tag in this.VolumeTag){ 42 | config.source.volume = this.VolumeTag[config.tag]; 43 | } 44 | }) 45 | } 46 | static GetAudioByTag(tag:string =""):BhvAudioSource[]{ 47 | let result = this._TempSources.filter((config)=>{config.source.tag === tag}).map(value => value.source); 48 | return result; 49 | } 50 | static PauseAll(){ 51 | this._TempSources.forEach(s=>{ 52 | s.source.pause(); 53 | }) 54 | } 55 | static ResumeAll(){ 56 | this._TempSources.forEach(s=>{ 57 | s.source.resume(); 58 | }) 59 | } 60 | 61 | //原始的音频文件大小 62 | private _originVolume:number = 1.0; 63 | private _isFading:boolean = false; 64 | 65 | @property({ 66 | tooltip:'识别音乐类型的标签,填写后可以统一通过标签处理' 67 | }) 68 | private tag:string = ''; //用于识别缓存的组件副本tag 69 | 70 | onLoad () { 71 | BhvAudioSource._TempSources.push({ 72 | tag:this.tag, 73 | source:this 74 | }) 75 | 76 | //cc.log(BhvAudioSource._TempSources); 77 | super.onLoad(); 78 | this._originVolume = this.volume; 79 | this.volume = BhvAudioSource.GetTagVolume(this.tag) * this._originVolume; 80 | 81 | 82 | } 83 | 84 | fadeIn(){ 85 | 86 | } 87 | 88 | fadeOut(){ 89 | this.loop = false; 90 | } 91 | 92 | onEnable(){ 93 | super.onEnable(); 94 | //cc.director.on('BhvAudioSource:Fade',()=>{},this); 95 | } 96 | 97 | onDisable(){ 98 | super.onDisable(); 99 | } 100 | 101 | onDestroy(){ 102 | let index = BhvAudioSource._TempSources.findIndex(config=>{return config.source === this}); 103 | BhvAudioSource._TempSources.splice(index); 104 | 105 | super.onDestroy(); 106 | } 107 | 108 | // update (dt) { 109 | // if(this._isFading){ 110 | 111 | // } 112 | // } 113 | } 114 | -------------------------------------------------------------------------------- /assets/Test/BhvSnake.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | const {ccclass, property} = cc._decorator; 4 | 5 | /** 6 | * 贪吃蛇行为,也可以作为2d游戏序列 7 | */ 8 | @ccclass 9 | export default class BhvSnake extends cc.Component { 10 | 11 | numSegments = 10; 12 | direction = 'right'; 13 | diff = 10; 14 | xStart = 0; 15 | yStart = 160; 16 | xCor = []; 17 | yCor = []; 18 | 19 | 20 | start () { 21 | for (let i = 0; i < this.numSegments; i++) { 22 | this.xCor.push(this.xStart + i * this.diff); 23 | this.yCor.push(this.yStart); 24 | } 25 | } 26 | 27 | line(x1,y1,x2,y2){ 28 | 29 | } 30 | 31 | updateSnakeCoordinates() { 32 | for (let i = 0; i < this.numSegments - 1; i++) { 33 | this.xCor[i] = this.xCor[i + 1]; 34 | this.yCor[i] = this.yCor[i + 1]; 35 | } 36 | switch (this.direction) { 37 | case 'right': 38 | this.xCor[this.numSegments - 1] = this.xCor[this.numSegments - 2] + this.diff; 39 | this.yCor[this.numSegments - 1] = this.yCor[this.numSegments - 2]; 40 | break; 41 | case 'up': 42 | this.xCor[this.numSegments - 1] = this.xCor[this.numSegments - 2]; 43 | this.yCor[this.numSegments - 1] = this.yCor[this.numSegments - 2] - this.diff; 44 | break; 45 | case 'left': 46 | this.xCor[this.numSegments - 1] = this.xCor[this.numSegments - 2] - this.diff; 47 | this.yCor[this.numSegments - 1] = this.yCor[this.numSegments - 2]; 48 | break; 49 | case 'down': 50 | this.xCor[this.numSegments - 1] = this.xCor[this.numSegments - 2]; 51 | this.yCor[this.numSegments - 1] = this.yCor[this.numSegments - 2] + this.diff; 52 | break; 53 | } 54 | } 55 | 56 | /** 57 | * 快速检查自身碰撞(不使用游戏引擎提供的碰撞 58 | */ 59 | checkSnakeCollision() { 60 | const snakeHeadX = this.xCor[this.xCor.length - 1]; 61 | const snakeHeadY = this.yCor[this.yCor.length - 1]; 62 | for (let i = 0; i < this.xCor.length - 1; i++) { 63 | if (this.xCor[i] === snakeHeadX && this.yCor[i] === snakeHeadY) { 64 | return true; 65 | } 66 | } 67 | } 68 | 69 | /** 70 | * 按钮控制方向 71 | */ 72 | keyPressed() { 73 | // switch (keyCode) { 74 | // case 74: 75 | // if (direction !== 'right') { 76 | // direction = 'left'; 77 | // } 78 | // break; 79 | // case 76: 80 | // if (direction !== 'left') { 81 | // direction = 'right'; 82 | // } 83 | // break; 84 | // case 73: 85 | // if (direction !== 'down') { 86 | // direction = 'up'; 87 | // } 88 | // break; 89 | // case 75: 90 | // if (direction !== 'up') { 91 | // direction = 'down'; 92 | // } 93 | // break; 94 | // } 95 | } 96 | 97 | 98 | update(dt) { 99 | 100 | for (let i = 0; i < this.numSegments - 1; i++) { 101 | this.line(this.xCor[i], this.yCor[i], this.xCor[i + 1], this.yCor[i + 1]); 102 | } 103 | this.updateSnakeCoordinates(); 104 | 105 | } 106 | } 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvSnake.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | const {ccclass, property} = cc._decorator; 4 | 5 | /** 6 | * 贪吃蛇行为,也可以作为2d游戏序列 7 | */ 8 | @ccclass 9 | export default class BhvSnake extends cc.Component { 10 | 11 | numSegments = 10; 12 | direction = 'right'; 13 | diff = 10; 14 | xStart = 0; 15 | yStart = 160; 16 | xCor = []; 17 | yCor = []; 18 | 19 | 20 | start () { 21 | for (let i = 0; i < this.numSegments; i++) { 22 | this.xCor.push(this.xStart + i * this.diff); 23 | this.yCor.push(this.yStart); 24 | } 25 | } 26 | 27 | line(x1,y1,x2,y2){ 28 | 29 | } 30 | 31 | updateSnakeCoordinates() { 32 | for (let i = 0; i < this.numSegments - 1; i++) { 33 | this.xCor[i] = this.xCor[i + 1]; 34 | this.yCor[i] = this.yCor[i + 1]; 35 | } 36 | switch (this.direction) { 37 | case 'right': 38 | this.xCor[this.numSegments - 1] = this.xCor[this.numSegments - 2] + this.diff; 39 | this.yCor[this.numSegments - 1] = this.yCor[this.numSegments - 2]; 40 | break; 41 | case 'up': 42 | this.xCor[this.numSegments - 1] = this.xCor[this.numSegments - 2]; 43 | this.yCor[this.numSegments - 1] = this.yCor[this.numSegments - 2] - this.diff; 44 | break; 45 | case 'left': 46 | this.xCor[this.numSegments - 1] = this.xCor[this.numSegments - 2] - this.diff; 47 | this.yCor[this.numSegments - 1] = this.yCor[this.numSegments - 2]; 48 | break; 49 | case 'down': 50 | this.xCor[this.numSegments - 1] = this.xCor[this.numSegments - 2]; 51 | this.yCor[this.numSegments - 1] = this.yCor[this.numSegments - 2] + this.diff; 52 | break; 53 | } 54 | } 55 | 56 | /** 57 | * 快速检查自身碰撞(不使用游戏引擎提供的碰撞 58 | */ 59 | checkSnakeCollision() { 60 | const snakeHeadX = this.xCor[this.xCor.length - 1]; 61 | const snakeHeadY = this.yCor[this.yCor.length - 1]; 62 | for (let i = 0; i < this.xCor.length - 1; i++) { 63 | if (this.xCor[i] === snakeHeadX && this.yCor[i] === snakeHeadY) { 64 | return true; 65 | } 66 | } 67 | } 68 | 69 | /** 70 | * 按钮控制方向 71 | */ 72 | keyPressed() { 73 | // switch (keyCode) { 74 | // case 74: 75 | // if (direction !== 'right') { 76 | // direction = 'left'; 77 | // } 78 | // break; 79 | // case 76: 80 | // if (direction !== 'left') { 81 | // direction = 'right'; 82 | // } 83 | // break; 84 | // case 73: 85 | // if (direction !== 'down') { 86 | // direction = 'up'; 87 | // } 88 | // break; 89 | // case 75: 90 | // if (direction !== 'up') { 91 | // direction = 'down'; 92 | // } 93 | // break; 94 | // } 95 | } 96 | 97 | 98 | update(dt) { 99 | 100 | for (let i = 0; i < this.numSegments - 1; i++) { 101 | this.line(this.xCor[i], this.yCor[i], this.xCor[i + 1], this.yCor[i + 1]); 102 | } 103 | this.updateSnakeCoordinates(); 104 | 105 | } 106 | } 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /assets/Behavior/input/BhvInputArea.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-06-22 15:41:32 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-06-22 16:17:08 6 | */ 7 | 8 | const {ccclass, property,disallowMultiple ,menu,executionOrder} = cc._decorator; 9 | 10 | /** 11 | * 触摸区域 [v0.0.1] 12 | */ 13 | @ccclass 14 | @menu("添加特殊行为/Input/Input Area (输入区域)") 15 | @disallowMultiple 16 | @executionOrder(-1) 17 | export default class BhvInputArea extends cc.Component { 18 | 19 | @property 20 | tag:string = ''; 21 | 22 | /**是否正在触摸该区域 */ 23 | public isTouching:boolean = false; 24 | 25 | /** 是否悬浮在该区域上 */ 26 | public isOverArea:boolean = false; 27 | 28 | private startTouchId:number = 0; 29 | 30 | public duration:number = 0; 31 | 32 | static _TempComps:{tag:string,comp:BhvInputArea}[] = []; 33 | 34 | /** 35 | * 查找触摸区域的问题 36 | * @param tag 查询的标签 37 | */ 38 | static find(tag:string):BhvInputArea{ 39 | let res = this._TempComps.find(v=>v.tag === tag); 40 | if(res){ 41 | return res.comp; 42 | } 43 | } 44 | 45 | onLoad(){ 46 | BhvInputArea._TempComps.push({ 47 | tag:this.tag, 48 | comp:this 49 | }) 50 | } 51 | 52 | onEnable(){ 53 | let node = this.node; 54 | node.on(cc.Node.EventType.TOUCH_START,this.onTouchStart,this,true); 55 | node.on(cc.Node.EventType.TOUCH_MOVE,this.onTouchMove,this,true); 56 | node.on(cc.Node.EventType.TOUCH_END,this.onTouchEnd,this,true); 57 | node.on(cc.Node.EventType.TOUCH_CANCEL,this.onTouchCancel,this,true); 58 | node.on(cc.Node.EventType.MOUSE_ENTER,this.onMouseEnter,this); 59 | node.on(cc.Node.EventType.MOUSE_LEAVE,this.onMouseLeave,this); 60 | } 61 | 62 | onDisable(){ 63 | let node = this.node; 64 | node.off(cc.Node.EventType.TOUCH_START,this.onTouchStart,this,true); 65 | node.off(cc.Node.EventType.TOUCH_MOVE,this.onTouchMove,this,true); 66 | node.off(cc.Node.EventType.TOUCH_END,this.onTouchEnd,this,true); 67 | node.off(cc.Node.EventType.TOUCH_CANCEL,this.onTouchCancel,this,true); 68 | node.off(cc.Node.EventType.MOUSE_ENTER,this.onMouseEnter,this,true); 69 | node.off(cc.Node.EventType.MOUSE_LEAVE,this.onMouseLeave,this,true); 70 | } 71 | 72 | onMouseEnter(e:cc.Event.EventMouse){ 73 | this.isOverArea = true; 74 | } 75 | 76 | onMouseLeave(e:cc.Event.EventMouse){ 77 | this.isOverArea = false; 78 | } 79 | 80 | onTouchStart(e:cc.Touch){ 81 | this.startTouchId = e.getID(); 82 | this.isTouching = true; 83 | } 84 | 85 | onTouchMove(e:cc.Touch){ 86 | if(e.getID()!== this.startTouchId)return; 87 | this.isTouching = true; 88 | } 89 | 90 | onTouchEnd(e:cc.Touch){ 91 | if(e.getID()!== this.startTouchId)return; 92 | this.isTouching = false; 93 | } 94 | 95 | onTouchCancel(e:cc.Touch){ 96 | if(e.getID()!== this.startTouchId)return; 97 | this.isTouching = false; 98 | } 99 | 100 | onDestroy(){ 101 | let index = BhvInputArea._TempComps.findIndex(config=>{return config.comp === this}); 102 | BhvInputArea._TempComps.splice(index); 103 | } 104 | 105 | update (dt) { 106 | if(this.isTouching){ 107 | this.duration += dt; 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /assets/Behavior/general/BhvAutoDestroy.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-04-10 00:31:19 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-04-19 00:16:17 6 | */ 7 | 8 | 9 | const {ccclass, property,disallowMultiple,menu} = cc._decorator; 10 | 11 | 12 | /**自动销毁时的动画类型 */ 13 | enum DESTROY_ANI { 14 | NONE, 15 | SCALE_IN, 16 | SCALE_OUT, 17 | FADE_OUT, 18 | SCALE_LINE 19 | } 20 | 21 | /** 22 | * 自动销毁[v1.0.0] 23 | * 可以根据条件,让对象自动销毁 24 | * ver 0.1 基本功能,根据时间、距离或者信号销毁对象 25 | * todo ver 0.2 加入自动销毁时动画 26 | * todo ver 0.3 自动销毁时选择移出节点而不是 destroy,需要用cc.director 监听 27 | * todo ver 0.4 对象池自动回收通知,勾选对象池回收模式,可以将该节点回收到 指定名字的对象池(请自己处理该逻辑) 28 | */ 29 | @ccclass 30 | @menu("添加特殊行为/General/AutoDestroy (渐隐渐显)") 31 | @disallowMultiple 32 | export default class BhvAutoDestroy extends cc.Component { 33 | 34 | 35 | @property({ 36 | tooltip:"检查时间,时间到达后触发销毁" 37 | }) 38 | public isCheckTimer:boolean = true; 39 | 40 | @property({ 41 | tooltip:"等待销毁的时间", 42 | visible:function(){ 43 | return this.isCheckTimer === true 44 | } 45 | }) 46 | public waitTime:number = 1.0; 47 | 48 | @property({ 49 | tooltip:"检查范围,运动超过创建范围时触发" 50 | }) 51 | public isCheckRange:boolean = false; 52 | 53 | @property({ 54 | tooltip:"超过距离的最大值", 55 | visible:function(){ 56 | return this.isCheckRange === true 57 | } 58 | }) 59 | public outRangeMax:number = 100; 60 | 61 | /**初始点坐标 */ 62 | private startPosition:cc.Vec2 = null; 63 | 64 | @property({ 65 | tooltip:"检查信号传递,如果收到了指定信号就自动销毁" 66 | }) 67 | public isCheckEmit:boolean = false; 68 | 69 | /**是否 自动将销毁的对象自动回收到对象池 */ 70 | @property({ 71 | tooltip:"收到该节点消息,将会自动销毁节点", 72 | visible:function(){ 73 | return this.isCheckEmit === true 74 | } 75 | }) 76 | private destroyMessage:string = "auto-destroy"; 77 | 78 | @property({ 79 | tooltip:"自动销毁时播放动画", 80 | visible:function(){ 81 | return this.isCheckEmit ===false &&this.isCheckTimer === false && this.isCheckEmit === false; 82 | } 83 | }) 84 | public destroyAnimation:DESTROY_ANI = DESTROY_ANI.NONE; 85 | 86 | /** 准备销毁对象 */ 87 | private isReadyDestroy:boolean = false; 88 | 89 | 90 | // /**是否 自动将销毁的对象自动回收到对象池 */ 91 | // @property({ 92 | // tooltip:"是否在销毁对象时,自动放入对象池" 93 | // }) 94 | // private isAutoRecoveryPool:boolean = false; 95 | 96 | start () { 97 | this.startPosition = this.node.position; 98 | if(this.isCheckTimer){ 99 | this.scheduleOnce(this.onReadyDestroy, this.waitTime); 100 | } 101 | } 102 | 103 | /**自动销毁前的操作 */ 104 | onReadyDestroy(){ 105 | if(this.isReadyDestroy === true)return; 106 | this.isReadyDestroy = true; 107 | let action:cc.Action; 108 | 109 | 110 | switch (this.destroyAnimation) { 111 | case DESTROY_ANI.NONE: 112 | 113 | break; 114 | 115 | default: 116 | break; 117 | } 118 | 119 | //不允许销毁的情况 120 | this.node.destroy(); 121 | 122 | } 123 | 124 | update (dt) { 125 | if(this.isReadyDestroy === true)return; 126 | //超出范围 127 | if(this.isCheckRange){ 128 | let dy = this.node.y-this.startPosition.y 129 | let dx = this.node.x-this.startPosition.x 130 | let dis = Math.sqrt(dx * dx + dy * dy); 131 | if(dis>this.outRangeMax){ 132 | this.onReadyDestroy(); 133 | } 134 | 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvProgressLimit.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-04-30 16:23:57 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-11-05 12:40:37 6 | */ 7 | 8 | 9 | const {ccclass, property,executeInEditMode} = cc._decorator; 10 | 11 | enum PROP_CONDITION { 12 | SCALE, 13 | SCALE_X, 14 | SCALE_Y, 15 | X, 16 | Y, 17 | WIDTH, 18 | HEIGHT, 19 | OPACITY 20 | } 21 | 22 | const PROP_NAME_ARRAY = ['scale','scaleX','scaleY','x','y','width','height','opacity'] 23 | 24 | /** 25 | * [进度条]以百分比控制进度条的属性 26 | * 27 | */ 28 | @ccclass 29 | export default class BhvProgressLimit extends cc.Component { 30 | 31 | @property(cc.Node) 32 | target:cc.Node= null; 33 | 34 | @property 35 | valueMin:number = 0; 36 | 37 | @property 38 | valueMax:number = 1; 39 | 40 | @property 41 | private _propType : PROP_CONDITION = 0; 42 | public get propType() : PROP_CONDITION { 43 | return this._propType; 44 | } 45 | @property({ 46 | type:cc.Enum(PROP_CONDITION) 47 | }) 48 | public set propType(v : PROP_CONDITION) { 49 | this._propType = v; 50 | if(CC_EDITOR){ 51 | this._editorUpdateConfig(v); 52 | } 53 | } 54 | 55 | 56 | @property 57 | private _progress : number = 0.5; 58 | public get progress() : number { 59 | return this._progress; 60 | } 61 | @property({ 62 | range:[0,1], 63 | slide:true 64 | }) 65 | public set progress(v : number) { 66 | if(v<0)v=0; 67 | if(v>1)v=1; 68 | this._progress = v; 69 | this.updateProp(v); 70 | } 71 | 72 | //在编辑器中切换限制条件后的控制情况 73 | _editorUpdateConfig(v){ 74 | switch (v) { 75 | case PROP_CONDITION.SCALE: 76 | this.valueMin = 0; 77 | this.valueMax = 1; 78 | break; 79 | case PROP_CONDITION.SCALE_X: 80 | this.valueMin = 0; 81 | this.valueMax = 1; 82 | break; 83 | case PROP_CONDITION.SCALE_Y: 84 | this.valueMin = 0; 85 | this.valueMax = 1; 86 | break; 87 | case PROP_CONDITION.X: 88 | this.valueMin = 0; 89 | this.valueMax = 640; 90 | break; 91 | case PROP_CONDITION.Y: 92 | this.valueMin = 0; 93 | this.valueMax = 640; 94 | break; 95 | case PROP_CONDITION.WIDTH: 96 | this.valueMin = 0; 97 | this.valueMax = this.node.width||100; 98 | break; 99 | case PROP_CONDITION.HEIGHT: 100 | this.valueMin = 0; 101 | this.valueMax = this.node.height||100; 102 | break; 103 | case PROP_CONDITION.OPACITY: 104 | this.valueMin = 0; 105 | this.valueMax = 255; 106 | break; 107 | 108 | default: 109 | break; 110 | } 111 | } 112 | 113 | updateProp(v){ 114 | let prop = this.propType; 115 | let propName = PROP_NAME_ARRAY[prop]; 116 | let value = this.mapValue(v,0,1,this.valueMin,this.valueMax); 117 | let node = this.target||this.node; 118 | if(propName in node){ 119 | node[propName] = value; 120 | } 121 | 122 | } 123 | 124 | private mapValue(x: number, xMin: number, xMax: number, yMin: number, yMax: number){ 125 | return (yMax - yMin) * (x - xMin) / (xMax - xMin) + yMin; 126 | } 127 | 128 | // LIFE-CYCLE CALLBACKS: 129 | 130 | // onLoad () {} 131 | 132 | start () { 133 | 134 | } 135 | 136 | // update (dt) {} 137 | } 138 | -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvValueSnyc.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-04-23 23:14:25 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-04-24 00:23:09 6 | */ 7 | 8 | 9 | const {ccclass, property, menu, executeInEditMode} = cc._decorator; 10 | 11 | 12 | /** 13 | * [Value Sync] 14 | * 当你需要管理同步两个组件中的某个值,可以使用这个操作 15 | * 注意,这个赋值是强联系的,请不要用于逻辑判断 16 | */ 17 | @ccclass 18 | @menu("添加特殊行为/UI/Value Sync (值同步)") 19 | @executeInEditMode 20 | export default class BhvValueSync extends cc.Component { 21 | 22 | @property({ 23 | tooltip:'将值映射到另外一个值上(可以限制取值的范围)', 24 | }) 25 | useValueMap:boolean = false; 26 | 27 | @property({ 28 | tooltip:'区间值限制,保证输入的值不会超过区间范围', 29 | }) 30 | useValueClamp:boolean = false; 31 | @property({ 32 | visible:function(){return this.useValueClamp}, 33 | tooltip:'限制输入值的区间,X= 最小值 Y=最大值', 34 | displayName:'Value Clamp' 35 | }) 36 | inputValueRange:cc.Vec2 = cc.v2(0,1); 37 | 38 | 39 | @property({ 40 | tooltip:'组件名,可以为自己的组件名(类名)或者cc.Node 或者cc其他组件名' 41 | }) 42 | selfCompName:string = ''; 43 | @property 44 | selfCompProperty:string = ''; 45 | @property({ 46 | visible:function(){return this.useValueMap}, 47 | tooltip:'将值映射区间,X= 最小值 Y=最大值', 48 | displayName:'Map Range' 49 | }) 50 | selfMapRange:cc.Vec2 = cc.v2(0,1); 51 | 52 | @property(cc.Node) 53 | otherNode:cc.Node = null; 54 | @property 55 | otherCompName:string = ''; 56 | @property 57 | otherCompProperty:string = ''; 58 | @property({ 59 | visible:function(){return this.useValueMap}, 60 | tooltip:'将值映射区间,X= 最小值 Y=最大值', 61 | displayName:'Map Range' 62 | }) 63 | otherMapRange:cc.Vec2 = cc.v2(0,1); 64 | 65 | selfComp:any = null; 66 | otherComp:any = null; 67 | 68 | private _preValue:any = null; 69 | 70 | // LIFE-CYCLE CALLBACKS: 71 | 72 | //必须在 start判断,否则执行顺序有问题 73 | onLoad(){ 74 | if(!this.selfCompName || !this.otherCompName ||!this.otherCompProperty ||!this.selfCompProperty)return; 75 | this.selfComp = (this.selfCompName == "cc.Node")?this.node:this.getComponent(this.selfCompName); 76 | this.otherComp = (this.otherCompName == "cc.Node")?this.otherNode:this.otherNode.getComponent(this.otherCompName); 77 | 78 | if(this.selfCompProperty in this.selfComp ===false){ 79 | cc.error("BhvValueSync:",this.selfCompProperty,' 不在'+this.selfCompName+'组件内'); 80 | } 81 | 82 | if(this.otherCompProperty in this.otherComp ===false){ 83 | cc.error("BhvValueSync:",this.otherCompProperty,'不在'+this.selfCompName+'组件内'); 84 | } 85 | } 86 | 87 | update (dt) { 88 | if(CC_EDITOR)return;//不建议编辑器模式调试 89 | if(!this.selfComp || !this.otherComp)return; 90 | //同步赋值操作 注意,为了方便使用 这里的 comp 并不知道是一个节点 还是一个组件 91 | let value:any = this.selfComp[this.selfCompProperty]; 92 | if(value === undefined || value === null)return; 93 | //脏值判断,如果这个值没有被更新,后续的判断都应该取消 94 | if(value === this._preValue)return; 95 | this._preValue = value; 96 | 97 | //输入值限制 98 | if(this.useValueClamp){ 99 | if(value>this.inputValueRange.y)value = this.inputValueRange.y; 100 | if(valuethis.inputValueRange.y)value = this.inputValueRange.y; 100 | if(value{return v.name == name}); 54 | if(index<0){cc.error('frameIndex 设置了不存在的节点:',name);return;} 55 | this.index = index||0; 56 | } 57 | 58 | /**通过事件的方式设置 index (编辑器用) */ 59 | setEventIndex(e,data:string){ 60 | this.index = parseInt(data); 61 | } 62 | 63 | /**通过事件的方式设置 name (编辑器用) */ 64 | setEventName(e,name:string){ 65 | this.setByName(name); 66 | } 67 | 68 | public next(){ 69 | this.index++; 70 | } 71 | 72 | public previous(){ 73 | this.index--; 74 | } 75 | 76 | private setChildrenState(index:number){ 77 | if(this.componentName ==='' || this.componentProperty === '')return; 78 | this.node.children.forEach((node,i)=>{ 79 | 80 | let selected = index === i; //是否为选中的属性 81 | if(this.componentName === 'cc.Node'){ 82 | if(this.componentProperty in node){ 83 | //node[this.componentProperty] = 84 | } 85 | }else{ 86 | let comp = node.getComponent(this.componentName); 87 | let selectValue:any = selected?this.componentSelectValue:this.componentUnSelectValue; 88 | if(comp == null || this.componentProperty in comp === false){ 89 | if(comp){ 90 | cc.error(this.componentProperty+'is not in'+comp.name); 91 | }else{ 92 | cc.error('cant find comp '+this.componentName+' in '+node.name); 93 | } 94 | return; 95 | } 96 | switch (typeof comp[this.componentProperty]) { 97 | case 'boolean': 98 | comp[this.componentProperty] = selectValue == true; //模糊等于判断 99 | break; 100 | case 'number': 101 | comp[this.componentProperty] = parseFloat(selectValue); 102 | break; 103 | case 'string': 104 | comp[this.componentProperty] = selectValue ; 105 | break; 106 | 107 | default: 108 | break; 109 | } 110 | } 111 | }) 112 | 113 | 114 | } 115 | 116 | // update (dt) {} 117 | } 118 | -------------------------------------------------------------------------------- /assets/Test/BhvSpringGroup.ts: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * @Author: wss 4 | * @Date: 2019-04-12 21:08:56 5 | * @Last Modified by: wss 6 | * @Last Modified time: 2019-05-03 22:17:25 7 | */ 8 | 9 | const {ccclass, property, menu} = cc._decorator; 10 | 11 | /** 12 | * [开发中]链式行为 ver 0.0.1 13 | * 可以将几个子节点绑定成关节模式 14 | * 链式结构,可以将容器内的对象链接起来 15 | * TODO 可以将自己定义的节点构成 chain 16 | * 后续开发请参考url: http://p5js.org/zh-Hans/examples/interaction-follow-1.html 17 | * 后续开发请参考url: http://p5js.org/zh-Hans/examples/interaction-follow-2.html 18 | * 后续开发请参考url: http://p5js.org/zh-Hans/examples/interaction-follow-3.html 19 | */ 20 | @ccclass 21 | @menu("添加特殊行为/Movement/SpringGroup (一组弹簧)") 22 | export default class BhvChainsGroup extends cc.Component { 23 | 24 | @property([cc.Node]) 25 | chainNodes :cc.Node[] = []; 26 | 27 | spring2dNodes:Spring2D[] = []; 28 | 29 | lineNodes:cc.Node[] = []; //保存线节点的 30 | 31 | @property 32 | lineHeight:number = 16; 33 | 34 | @property(cc.SpriteFrame) 35 | lineTexture:cc.SpriteFrame = null; 36 | 37 | // LIFE-CYCLE CALLBACKS: 38 | 39 | @property 40 | gravity:number = 0; 41 | 42 | @property 43 | mass:number = 5; 44 | 45 | onLoad () { 46 | if(this.chainNodes.length <1){ 47 | this.chainNodes = this.chainNodes.concat(this.node.children); 48 | } 49 | 50 | for (let i = 0; i < this.chainNodes.length; i++) { 51 | let node = this.chainNodes[i]; 52 | this.spring2dNodes.push(new Spring2D(node.x,node.y,this.mass,this.gravity)); 53 | this.lineNodes.push(this.createLineNode()); 54 | } 55 | 56 | } 57 | 58 | start () { 59 | 60 | } 61 | 62 | createLineNode(){ 63 | let node = new cc.Node(); 64 | let sprite = node.addComponent(cc.Sprite); 65 | sprite.type = cc.Sprite.Type.SLICED; 66 | sprite.spriteFrame = this.lineTexture; 67 | node.anchorX = 0; 68 | node.height = this.lineHeight; 69 | this.node.addChild(node); 70 | return node; 71 | } 72 | 73 | update(dt) { 74 | for (let i = 0; i < this.chainNodes.length; i++) { 75 | const node = this.chainNodes[i]; 76 | const spring = this.spring2dNodes[i]; 77 | const line = this.lineNodes[i]; 78 | const preNode = i>0?this.chainNodes[i-1]:null; 79 | if(preNode){ 80 | spring.update(node,preNode.x,preNode.y); 81 | spring.setLine(line,preNode.x,preNode.y); 82 | } 83 | 84 | } 85 | 86 | 87 | } 88 | 89 | // update (dt) {} 90 | } 91 | 92 | // 2d 弹簧效果 93 | class Spring2D { 94 | x = 0;// The x- and y-coordinates 95 | y = 0; 96 | vx = 0; // The x- and y-axis velocities 97 | vy = 0; 98 | mass = 0; 99 | gravity = 9.8; 100 | stiffness = 0.2; 101 | damping = 0.7; 102 | 103 | constructor(xpos, ypos, m, g){ 104 | this.x = xpos;// The x- and y-coordinates 105 | this.y = ypos; 106 | this.mass = m; 107 | this.gravity = g; 108 | } 109 | 110 | update(node,targetX, targetY) { 111 | let forceX = (targetX - this.x) * this.stiffness; 112 | let ax = forceX / this.mass; 113 | this.vx = this.damping * (this.vx + ax); 114 | this.x += this.vx; 115 | let forceY = (targetY - this.y) * this.stiffness; 116 | forceY += this.gravity; 117 | let ay = forceY / this.mass; 118 | this.vy = this.damping * (this.vy + ay); 119 | this.y += this.vy; 120 | 121 | node.x = this.x; 122 | node.y = this.y; 123 | 124 | } 125 | 126 | setLine(lineNode,nx,ny){ 127 | var startPos: cc.Vec2 = cc.v2(this.x,this.y); 128 | var endPos: cc.Vec2 = cc.v2(nx,ny); 129 | var distance: number = startPos.sub(endPos).mag(); 130 | var angle: number = Math.atan2(endPos.y - startPos.y, endPos.x - startPos.x); 131 | lineNode.x = this.x; 132 | lineNode.y = this.y; 133 | lineNode.width = distance; 134 | lineNode.rotation = cc.misc.radiansToDegrees(angle) * -1; 135 | 136 | } 137 | 138 | 139 | } 140 | -------------------------------------------------------------------------------- /assets/Behavior/ui/BhvAutoFrame.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-04-10 14:32:46 4 | * @LastEditTime: 2019-12-09 15:06:55 5 | * @LastEditors: wss 6 | */ 7 | 8 | const { ccclass, property, menu } = cc._decorator; 9 | 10 | /** 11 | * 简单循环帧动画 [v1.0.0] 12 | * 自动循环切换播放循环帧,适合比较简单的情况 13 | */ 14 | @ccclass 15 | @menu("添加特殊行为/UI/Loop Frame (帧循环)") 16 | export default class BhvLoopFrame extends cc.Component { 17 | 18 | @property({ 19 | type: [cc.SpriteFrame], 20 | tooltip: '动画的帧' 21 | }) 22 | spriteFrames: Array = []; 23 | 24 | @property({ 25 | tooltip:'帧的时间间隔' 26 | }) 27 | duration: number = 0.1; 28 | 29 | @property({ 30 | tooltip:'是否循环播放' 31 | }) 32 | loop: boolean = false; 33 | 34 | @property({ 35 | tooltip:'是否在组件加载的时候播放' 36 | }) 37 | playOnload: boolean = false; 38 | 39 | private sprite:cc.Sprite; // 精灵组件 40 | 41 | /** 是否正在播放 */ 42 | isPlaying:boolean = false; 43 | 44 | playTime:number = 0; 45 | 46 | isLoop:boolean = false; 47 | 48 | endFunc:Function = null; 49 | 50 | onLoad() { 51 | // 判断一下在组件所挂在的节点上面有没有cc.Sprite组件; 52 | let s_com = this.node.getComponent(cc.Sprite); 53 | if (!s_com) { // 没有cc.Sprite组件,要显示图片一定要有cc.Sprite组件,所以我们添加一个cc.Sprite组件; 54 | s_com = this.node.addComponent(cc.Sprite); 55 | } 56 | this.sprite = s_com; // 精灵组件 57 | // end 58 | this.isPlaying = false; // 是否正在播放; 59 | this.playTime = 0; 60 | this.isLoop = false; 61 | this.endFunc = null; 62 | 63 | // 显示第0个frame; 64 | if (this.spriteFrames.length > 0) { 65 | this.sprite.spriteFrame = this.spriteFrames[0]; 66 | } 67 | 68 | if (this.playOnload) { 69 | if (!this.loop) { 70 | this.playOnce(null); 71 | } 72 | else { 73 | this.playLoop(); 74 | } 75 | } 76 | } 77 | 78 | // 实现播放一次, 79 | playOnce(end_func) { 80 | this.playTime = 0; 81 | this.isPlaying = true; 82 | this.isLoop = false; 83 | this.endFunc = end_func; 84 | } 85 | // end 86 | 87 | // 实现循环播放 88 | playLoop() { 89 | this.playTime = 0; 90 | this.isPlaying = true; 91 | this.isLoop = true; 92 | } 93 | // end 94 | 95 | stop() { 96 | this.playTime = 0; 97 | this.isPlaying = false; 98 | this.isLoop = false; 99 | } 100 | 101 | // called every frame, uncomment this function to activate update callback 102 | // 每一次刷新的时候需要调用的函数,dt距离上一次刷新过去的时间; 103 | update(dt) { 104 | if (this.isPlaying === false) { // 没有启动播放,不做处理 105 | return; 106 | } 107 | 108 | this.playTime += dt; // 累积我们播放的时间; 109 | 110 | // 计算时间,应当播放第几帧,而不是随便的下一帧, 111 | // 否则的话,同样的动画1, 60帧,你在30FPS的机器上你会播放2秒, 112 | // 你在60FPS的机器上你会播放1秒,动画就不同步; 113 | 114 | let index = Math.floor(this.playTime / this.duration); // 向下取整数 115 | // index 116 | if (this.isLoop === false) { // 播放一次 117 | if (index >= this.spriteFrames.length) { // 非循环播放结束 118 | // 精灵显示的是最后一帧; 119 | this.sprite.spriteFrame = this.spriteFrames[this.spriteFrames.length - 1]; 120 | // end 121 | this.isPlaying = false; 122 | this.playTime = 0; 123 | if (this.endFunc) { // 调用回掉函数 124 | this.endFunc(); 125 | } 126 | return; 127 | } 128 | else { 129 | this.sprite.spriteFrame = this.spriteFrames[index]; 130 | } 131 | } 132 | else { // 循环播放; 133 | 134 | while (index >= this.spriteFrames.length) { 135 | index -= this.spriteFrames.length; 136 | this.playTime -= (this.duration * this.spriteFrames.length); 137 | } 138 | 139 | // 在合法的范围之内 140 | this.sprite.spriteFrame = this.spriteFrames[index]; 141 | // end 142 | } 143 | } 144 | 145 | 146 | } 147 | 148 | -------------------------------------------------------------------------------- /assets/Behavior/general/BhvWrap.ts: -------------------------------------------------------------------------------- 1 | // Learn TypeScript: 2 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/typescript.html 3 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html 4 | // Learn Attribute: 5 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html 6 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html 7 | // Learn life-cycle callbacks: 8 | // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html 9 | // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html 10 | 11 | const {ccclass, property, menu, disallowMultiple} = cc._decorator; 12 | 13 | enum WRAP_MODE { 14 | parent, //以父节点为基准 15 | canvas, //以全局 Canvas 为基准, 16 | custom 17 | } 18 | 19 | 20 | /** 21 | *!(请使用新的 BhvBoundary 行为代替,该行为已经弃用) 22 | * Wrap 包装,会将对象限定在包装范围内,可以循环也可以限制移动的边界范围 23 | */ 24 | @ccclass 25 | @menu("添加特殊行为/General/Wrap (包装)") 26 | @disallowMultiple 27 | export default class BhvWrap extends cc.Component { 28 | 29 | @property({ 30 | type:cc.Enum(WRAP_MODE), 31 | tooltip: "wrap 模式", 32 | }) 33 | wrapMode = WRAP_MODE.parent; 34 | 35 | @property(cc.Node) 36 | customNode:cc.Node = null 37 | 38 | // LIFE-CYCLE CALLBACKS: 39 | 40 | start () { 41 | var node = this.node; 42 | var bBound = node.getBoundingBox(); 43 | var offset = node.getAnchorPoint(); 44 | 45 | /**debug */ 46 | var child = new cc.Node('test'); 47 | child.setParent(this.node); 48 | child.setPosition(0,0); 49 | 50 | /**@type cc.Graphics */ 51 | var graphic = child.addComponent(cc.Graphics); 52 | graphic.rect(-bBound.width * offset.x,-bBound.height *offset.y,bBound.width,bBound.height); 53 | graphic.fillColor = cc.color(0,255,155,155); 54 | graphic.fill(); 55 | 56 | } 57 | 58 | getBBOX (node:cc.Node):{left?:number,right?:number,top?:number,bottom?:number}{ 59 | if(!node)return{}; 60 | var bBound = node.getBoundingBox(); 61 | var offset = node.getAnchorPoint(); 62 | var bbox = { 63 | left:bBound.x - bBound.width * offset.x, 64 | right:bBound.x + bBound.width * offset.x, 65 | top:bBound.y - bBound.height * offset.y, 66 | bottom:bBound.y + bBound.height * offset.y, 67 | } 68 | return bbox; 69 | } 70 | 71 | update (dt) { 72 | 73 | var bbox = this.getBBOX(this.node); 74 | 75 | var canvas:cc.Node = cc.find('Canvas'); 76 | var canvasSize:cc.Size = canvas.getContentSize(); 77 | var parent:cc.Node = this.node.getParent(); //获取该节点的父节点 78 | var bbox2 ; 79 | 80 | var lBound:number = 0, rBound:number = 0, tBound:number = 0, bBound:number = 0; 81 | 82 | // wrap to layout 83 | if (this.wrapMode === WRAP_MODE.canvas) 84 | { 85 | 86 | rBound = canvasSize.width; 87 | bBound = canvasSize.height; 88 | 89 | } 90 | // wrap to viewport 91 | else if(this.wrapMode === WRAP_MODE.parent &&parent) 92 | { 93 | bbox2 = this.getBBOX(parent); 94 | lBound = bbox2.left; 95 | rBound = bbox2.right; 96 | tBound = bbox2.top; 97 | bBound = bbox2.bottom; 98 | 99 | } 100 | 101 | else if(this.wrapMode === WRAP_MODE.custom &&this.customNode) 102 | { 103 | bbox2 = this.getBBOX(this.customNode); 104 | lBound = bbox2.left; 105 | rBound = bbox2.right; 106 | tBound = bbox2.top; 107 | bBound = bbox2.bottom; 108 | 109 | } 110 | 111 | 112 | if (bbox.right < lBound) 113 | { 114 | this.node.x = (rBound - 1) + (this.node.x - bbox.left); 115 | } 116 | else if (bbox.left > rBound) 117 | { 118 | this.node.x = (lBound + 1) - (bbox.right - this.node.x); 119 | } 120 | else if (bbox.bottom < tBound) 121 | { 122 | this.node.y = (bBound - 1) + (this.node.y - bbox.top); 123 | } 124 | else if (bbox.top > bBound) 125 | { 126 | this.node.y = (tBound + 1) - (bbox.bottom - this.node.y); 127 | } 128 | 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /assets/Behavior/movement/BhvShake.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: wss 3 | * @Date: 2019-06-03 17:16:46 4 | * @Last Modified by: wss 5 | * @Last Modified time: 2019-06-03 17:16:46 6 | */ 7 | 8 | 9 | const { ccclass, property, menu } = cc._decorator; 10 | 11 | 12 | /** 13 | * 震动 [v1.0.0] 14 | * 随机圆上一点作为振幅,不断缩小半径降低强度,半径缩小的速率就是阻尼,可以实现各种效果的震动。 15 | * ( 修复震动 BUG ) 16 | */ 17 | @ccclass 18 | @menu("添加特殊行为/Movement/Shake (震动)") 19 | export default class BhvShake extends cc.Component { 20 | 21 | @property({ 22 | tooltip: '移动模式,移动模式不会还原对象的坐标回到 shake 发生前的状态,适合运动的物体' 23 | }) 24 | movingMode: boolean = false; 25 | 26 | @property({ 27 | tooltip: '衰退模式,会随着震动时间强度逐渐衰退' 28 | }) 29 | decayMode: boolean = false; 30 | 31 | @property({ 32 | visible: function () { return this.decayMode === true }, 33 | tooltip: '阻尼,震动时半径逐渐缩小的速率' 34 | }) 35 | damping: number = 0.01; 36 | 37 | @property({ 38 | tooltip: '震动时间' 39 | }) 40 | shakeTime: number = 0.5; 41 | 42 | /**初始值 */ 43 | @property({ 44 | tooltip: '震动x,y的偏移量' 45 | }) 46 | intensity: cc.Vec2 = cc.v2(5, 5); 47 | 48 | /**实际震动时用到的值 */ 49 | _intensity: cc.Vec2 = cc.v2(5, 5); 50 | 51 | _originPos: cc.Vec2 = cc.v2(0, 0); 52 | 53 | _isShaking: boolean = false; 54 | 55 | _timer: number = 0.5; 56 | 57 | // LIFE-CYCLE CALLBACKS: 58 | 59 | onLoad() { 60 | this._originPos = this.node.position; 61 | this._intensity = this.intensity; 62 | } 63 | 64 | /**通过按钮事件调用的震动 */ 65 | onButtonShake(e, time: string) { 66 | this.shake(parseFloat(time)); 67 | } 68 | 69 | /**重新设置震动的初始位置 */ 70 | setOriginPos(pos:cc.Vec2){ 71 | this._originPos = pos; 72 | } 73 | 74 | shake(time: number = 0.5, intensity?: cc.Vec2) { 75 | //如果在shake状态,那么只是会维持shaking,而不改变默认的位置 76 | if (this._isShaking === false) { 77 | // this._originPos = this.node.position; 78 | if(!this.movingMode){ 79 | this.node.position.x = this._originPos.x; 80 | this.node.position.y = this._originPos.y; 81 | } 82 | 83 | } 84 | 85 | if (time > 0) { 86 | this._timer = time; 87 | } 88 | 89 | if (intensity) this.intensity = intensity; 90 | this._intensity = this.intensity.clone(); //clone 91 | this._timer = this.shakeTime; 92 | 93 | this._isShaking = true; 94 | } 95 | 96 | 97 | update(dt) { 98 | if (!this._isShaking) return; 99 | 100 | this._timer -= dt; 101 | //倒计时 102 | if (this._timer <= 0) { 103 | if(!this.movingMode){ 104 | this.node.x = this._originPos.x; 105 | this.node.y = this._originPos.y; 106 | } 107 | this._isShaking = false; 108 | } 109 | 110 | let sx, sy; 111 | sx = (Math.random() * 2 - 1) * this._intensity.x; 112 | sy = (Math.random() * 2 - 1) * this._intensity.y; 113 | 114 | if(this.decayMode){ 115 | if (this._intensity.x > 0.01) { 116 | this._intensity.x -= this._intensity.x * this.damping *dt * 60; 117 | } else { 118 | this._intensity.x = 0; 119 | } 120 | 121 | if (this._intensity.y > 0.01) { 122 | this._intensity.y -= this._intensity.y *this.damping *dt *60 ; 123 | } else { 124 | this._intensity.y = 0; 125 | } 126 | 127 | if(this._intensity.y<0.01 && this._intensity.x<0.01){ 128 | this._intensity.y = 0; 129 | this._intensity.x = 0; 130 | if(!this.movingMode){ 131 | this.node.x = this._originPos.x; 132 | this.node.y = this._originPos.y; 133 | } 134 | 135 | this._isShaking = false; 136 | return; 137 | } 138 | } 139 | 140 | //震动中 141 | if (this.movingMode) { 142 | this.node.x += sx; 143 | this.node.y += sy; 144 | } else { 145 | this.node.x = this._originPos.x + sx; 146 | this.node.y = this._originPos.y + sy; 147 | } 148 | 149 | } 150 | } 151 | 152 | --------------------------------------------------------------------------------