commit 476a551dc9a3717d32ff33aa947ef4a934d3e4e7 Author: ruanwujing <1220792244@qq.com> Date: Mon Jan 29 19:32:59 2024 +0800 拖拽组件 diff --git a/assets/resources.meta b/assets/resources.meta new file mode 100644 index 0000000..48bc879 --- /dev/null +++ b/assets/resources.meta @@ -0,0 +1,14 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "a96f0384-ae30-4d75-a6f6-ce7bad619932", + "files": [], + "subMetas": {}, + "userData": { + "isBundle": true, + "bundleConfigID": "default", + "bundleName": "resources", + "priority": 8 + } +} diff --git a/assets/resources/scenes.meta b/assets/resources/scenes.meta new file mode 100644 index 0000000..ff7de54 --- /dev/null +++ b/assets/resources/scenes.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "090cbe84-71ad-4ca6-bdaf-4b87538405db", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/assets/resources/scenes/drag.scene b/assets/resources/scenes/drag.scene new file mode 100644 index 0000000..cd90c06 --- /dev/null +++ b/assets/resources/scenes/drag.scene @@ -0,0 +1,2141 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "drag", + "_objFlags": 0, + "__editorExtras__": {}, + "_native": "", + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_name": "drag", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": null, + "_children": [ + { + "__id__": 2 + }, + { + "__id__": 5 + }, + { + "__id__": 43 + } + ], + "_active": true, + "_components": [], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "autoReleaseAssets": false, + "_globals": { + "__id__": 56 + }, + "_id": "3fd7ab19-8a50-470c-8dc7-0cd664f0fb5b" + }, + { + "__type__": "cc.Node", + "_name": "Main Light", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 3 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": -0.06397656665577071, + "y": -0.44608233363525845, + "z": -0.8239028751062036, + "w": -0.3436591377065261 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": -117.894, + "y": -194.909, + "z": 38.562 + }, + "_id": "c0y6F5f+pAvI805TdmxIjx" + }, + { + "__type__": "cc.DirectionalLight", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": null, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 250, + "b": 240, + "a": 255 + }, + "_useColorTemperature": false, + "_colorTemperature": 6550, + "_staticSettings": { + "__id__": 4 + }, + "_visibility": -325058561, + "_illuminanceHDR": 65000, + "_illuminance": 65000, + "_illuminanceLDR": 1.6927083333333335, + "_shadowEnabled": false, + "_shadowPcf": 0, + "_shadowBias": 0.00001, + "_shadowNormalBias": 0, + "_shadowSaturation": 1, + "_shadowDistance": 50, + "_shadowInvisibleOcclusionRange": 200, + "_csmLevel": 4, + "_csmLayerLambda": 0.75, + "_csmOptimizationMode": 2, + "_csmAdvancedOptions": false, + "_csmLayersTransition": false, + "_csmTransitionRange": 0.05, + "_shadowFixedArea": false, + "_shadowNear": 0.1, + "_shadowFar": 10, + "_shadowOrthoSize": 5, + "_id": "597uMYCbhEtJQc0ffJlcgA" + }, + { + "__type__": "cc.StaticLightSettings", + "_baked": false, + "_editorOnly": false, + "_castShadow": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 6 + }, + { + "__id__": 8 + }, + { + "__id__": 15 + }, + { + "__id__": 22 + }, + { + "__id__": 29 + }, + { + "__id__": 36 + }, + { + "__id__": 50 + } + ], + "_active": true, + "_components": [ + { + "__id__": 53 + }, + { + "__id__": 54 + }, + { + "__id__": 55 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 640, + "y": 360, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "1a3A7un6ZJ74ZdO4e7IPkx" + }, + { + "__type__": "cc.Node", + "_name": "Camera", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 5 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 7 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 1000 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "f0E/wp84BCaKfUohYJGAHT" + }, + { + "__type__": "cc.Camera", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 6 + }, + "_enabled": true, + "__prefab": null, + "_projection": 0, + "_priority": 1073741824, + "_fov": 45, + "_fovAxis": 0, + "_orthoHeight": 459.1304347826087, + "_near": 1, + "_far": 2000, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_depth": 1, + "_stencil": 0, + "_clearFlags": 6, + "_rect": { + "__type__": "cc.Rect", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + "_aperture": 19, + "_shutter": 7, + "_iso": 0, + "_screenScale": 1, + "_visibility": 41943040, + "_targetTexture": null, + "_postProcess": null, + "_usePostProcess": false, + "_cameraType": -1, + "_trackingType": 0, + "_id": "3a6qvjk0RF6K/A5ouflSKJ" + }, + { + "__type__": "cc.Node", + "_name": "Sprite", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 5 + }, + "_children": [ + { + "__id__": 9 + } + ], + "_active": true, + "_components": [ + { + "__id__": 12 + }, + { + "__id__": 13 + }, + { + "__id__": 14 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": -449.892, + "y": -125.705, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "10bG/7QjVLEbptBY6HIXW/" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 8 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 10 + }, + { + "__id__": 11 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -96.029, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "1eXDIZQURBFbY/saCJ5Fnh" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 9 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "36CuOEJoZPZ5Jx1jX3LW0J" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 9 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "默认设置", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 30, + "_fontSize": 30, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 0, + "_enableWrapText": true, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "49Mt6u3ylAhIjwUjPL/7hO" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 8 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 140, + "height": 140 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "40uukKvttHhpmqQsu9/66X" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 8 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "890f043a-8cad-46e4-b5b1-584554c0cad1@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 1, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "a4P42adzZEUpNCd8v2ErR4" + }, + { + "__type__": "46054KTV11L1bpFp5ktRO19", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 8 + }, + "_enabled": true, + "__prefab": null, + "touchOffsetSensitive": true, + "backHomeWhenFailed": true, + "backHomeType": 0, + "backTweenTime": 1, + "backTweenEasing": 0, + "floatType": 0, + "backToOriZ": true, + "_id": "cbGEPq1txFoKdACAW6bz6K" + }, + { + "__type__": "cc.Node", + "_name": "Sprite-001", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 5 + }, + "_children": [ + { + "__id__": 16 + } + ], + "_active": true, + "_components": [ + { + "__id__": 19 + }, + { + "__id__": 20 + }, + { + "__id__": 21 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": -256.58, + "y": -125.705, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "4fHmKqMF9BC7aVwlEoX9Bs" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 15 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 17 + }, + { + "__id__": 18 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -80.564, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "d9JJr/UItIJYURA01u5gko" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 16 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 203.1, + "height": 90.39999999999999 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 1 + }, + "_id": "02JpNAd6RJgrCAT5sYmhT6" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 16 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "拖拽时层级上浮", + "_horizontalAlign": 1, + "_verticalAlign": 0, + "_actualFontSize": 30, + "_fontSize": 30, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 3, + "_enableWrapText": true, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "28WdAu1Z5MH72mVIZBx9Zf" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 15 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 140, + "height": 140 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "cdiBQKBrdK6IgXeQTTRRhD" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 15 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "890f043a-8cad-46e4-b5b1-584554c0cad1@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 1, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "c6idGhn1NEHJtlYePot6Hj" + }, + { + "__type__": "46054KTV11L1bpFp5ktRO19", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 15 + }, + "_enabled": true, + "__prefab": null, + "touchOffsetSensitive": true, + "backHomeWhenFailed": false, + "backHomeType": 0, + "backTweenTime": 1, + "backTweenEasing": 0, + "floatType": 1, + "backToOriZ": true, + "_id": "8bliuOVLdCRb2wHSPkjHLd" + }, + { + "__type__": "cc.Node", + "_name": "Sprite-002", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 5 + }, + "_children": [ + { + "__id__": 23 + } + ], + "_active": true, + "_components": [ + { + "__id__": 26 + }, + { + "__id__": 27 + }, + { + "__id__": 28 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": -60.69, + "y": -125.705, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "85R3YPAAhK34lc3hs5QmEN" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 22 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 24 + }, + { + "__id__": 25 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -80.564, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "929vEcKsBFqqUo5MLTG+5I" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 23 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 202.3, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 1 + }, + "_id": "d57jboIW1MxJk72gVwEkV8" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 23 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "直接回家", + "_horizontalAlign": 1, + "_verticalAlign": 0, + "_actualFontSize": 30, + "_fontSize": 30, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 3, + "_enableWrapText": true, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "3788BizyZKEKxXNzRYnqkE" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 22 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 140, + "height": 140 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "d9F1qWCxhNHZc1Oj0Xg2Oc" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 22 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "890f043a-8cad-46e4-b5b1-584554c0cad1@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 1, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "a2gA5VqjtIXbTRKxUqtuRH" + }, + { + "__type__": "46054KTV11L1bpFp5ktRO19", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 22 + }, + "_enabled": true, + "__prefab": null, + "touchOffsetSensitive": true, + "backHomeWhenFailed": true, + "backHomeType": 0, + "backTweenTime": 1, + "backTweenEasing": 0, + "floatType": 1, + "backToOriZ": true, + "_id": "86+nGqKttDy4jOv8MzopLr" + }, + { + "__type__": "cc.Node", + "_name": "Sprite-003", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 5 + }, + "_children": [ + { + "__id__": 30 + } + ], + "_active": true, + "_components": [ + { + "__id__": 33 + }, + { + "__id__": 34 + }, + { + "__id__": 35 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 100.591, + "y": -125.705, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "b3FSFYtBpIXrkcSUToggE1" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 29 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 31 + }, + { + "__id__": 32 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -80.564, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "321Wfl5fNFm6unBu9fZHsr" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 30 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 202.3, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 1 + }, + "_id": "6ehbZOA/5N14TIToH9rCC1" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 30 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "缓动回家", + "_horizontalAlign": 1, + "_verticalAlign": 0, + "_actualFontSize": 30, + "_fontSize": 30, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 3, + "_enableWrapText": true, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "adiMFX1khPFoPqgS1WlUy4" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 29 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 140, + "height": 140 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "7f9sbpTO5AfJMdzk1xqaOB" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 29 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "890f043a-8cad-46e4-b5b1-584554c0cad1@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 1, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "7aClHBSQROL57tf5GD4/xx" + }, + { + "__type__": "46054KTV11L1bpFp5ktRO19", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 29 + }, + "_enabled": true, + "__prefab": null, + "touchOffsetSensitive": true, + "backHomeWhenFailed": true, + "backHomeType": 1, + "backTweenTime": 1, + "backTweenEasing": 6, + "floatType": 1, + "backToOriZ": true, + "_id": "30+EYScVRAK6CvlozvyHyR" + }, + { + "__type__": "cc.Node", + "_name": "Sprite-004", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 5 + }, + "_children": [ + { + "__id__": 37 + } + ], + "_active": true, + "_components": [ + { + "__id__": 40 + }, + { + "__id__": 41 + }, + { + "__id__": 42 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 271.48, + "y": -125.705, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "2d7FiBLIBDWIGR1D09E2Nm" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 36 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 38 + }, + { + "__id__": 39 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -80.564, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "e8O0rzrZdLR6TdqrauWfHK" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 37 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 202.3, + "height": 90.39999999999999 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 1 + }, + "_id": "957nF4HGZGmqZuF0VVwU8b" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 37 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "拖动时上浮到指定节点上", + "_horizontalAlign": 1, + "_verticalAlign": 0, + "_actualFontSize": 30, + "_fontSize": 30, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 3, + "_enableWrapText": true, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "46OSFJAOlLa5icud6LYf4t" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 36 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 140, + "height": 140 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "e5zgBdco1EjoykZ3agmwwf" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 36 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "890f043a-8cad-46e4-b5b1-584554c0cad1@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 1, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "f8wU7biIhPlrv3ycr+D/7k" + }, + { + "__type__": "46054KTV11L1bpFp5ktRO19", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 36 + }, + "_enabled": true, + "__prefab": null, + "touchOffsetSensitive": true, + "backHomeWhenFailed": true, + "backHomeType": 1, + "backTweenTime": 1, + "backTweenEasing": 6, + "floatType": 2, + "topLayerNode": { + "__id__": 43 + }, + "backToOriZ": true, + "_id": "aatAEIKcJNv7M1Cqiphk37" + }, + { + "__type__": "cc.Node", + "_name": "Canvas-001", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 44 + } + ], + "_active": true, + "_components": [ + { + "__id__": 47 + }, + { + "__id__": 48 + }, + { + "__id__": 49 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 640, + "y": 360, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "627wXooM9PzYYPMPem2e9W" + }, + { + "__type__": "cc.Node", + "_name": "SpriteSplash", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 43 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 45 + }, + { + "__id__": 46 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": -67.765, + "y": -51.408, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "55vX6hsl5CPYRaIEx4mwlc" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 44 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 759.2, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "baaMcWjDhDnr/bGKzRBwKt" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 44 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 172, + "g": 5, + "b": 5, + "a": 128 + }, + "_spriteFrame": { + "__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "b3Y/2eZjdCCbKU0a86FcHg" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 43 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 1280, + "height": 720 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "3dA8e/tFxIYaSuu00cQN7N" + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 43 + }, + "_enabled": true, + "__prefab": null, + "_cameraComponent": { + "__id__": 7 + }, + "_alignCanvasWithScreen": true, + "_id": "a1vRMUZDtEq4alEYswlhCc" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 43 + }, + "_enabled": true, + "__prefab": null, + "_alignFlags": 45, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "cb5nSfMutIgrVj/2x1wTHs" + }, + { + "__type__": "cc.Node", + "_name": "SpriteSplash", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 5 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 51 + }, + { + "__id__": 52 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": -8.428, + "y": 22.751, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "0a48vuhO9B26HPn8kwlygA" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 50 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 1000, + "height": 300 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "9djmvFSsBAcLee/IKmBzcp" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 50 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "deX3IqwdlKaqI+y1MNLKOM" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 5 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 1280, + "height": 720 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "ecpJR6tuZJM4HvtF4qRihA" + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 5 + }, + "_enabled": true, + "__prefab": null, + "_cameraComponent": { + "__id__": 7 + }, + "_alignCanvasWithScreen": true, + "_id": "dac7fCg29OfKKXAqW6XoPb" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 5 + }, + "_enabled": true, + "__prefab": null, + "_alignFlags": 45, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "f5SiNZdmxOF78KYIv0g/Rw" + }, + { + "__type__": "cc.SceneGlobals", + "ambient": { + "__id__": 57 + }, + "shadows": { + "__id__": 58 + }, + "_skybox": { + "__id__": 59 + }, + "fog": { + "__id__": 60 + }, + "octree": { + "__id__": 61 + }, + "skin": { + "__id__": 62 + }, + "lightProbeInfo": { + "__id__": 63 + }, + "postSettings": { + "__id__": 64 + }, + "bakedWithStationaryMainLight": false, + "bakedWithHighpLightmap": false + }, + { + "__type__": "cc.AmbientInfo", + "_skyColorHDR": { + "__type__": "cc.Vec4", + "x": 0.2, + "y": 0.5, + "z": 0.8, + "w": 0.520833125 + }, + "_skyColor": { + "__type__": "cc.Vec4", + "x": 0.2, + "y": 0.5, + "z": 0.8, + "w": 0.520833125 + }, + "_skyIllumHDR": 20000, + "_skyIllum": 20000, + "_groundAlbedoHDR": { + "__type__": "cc.Vec4", + "x": 0.2, + "y": 0.2, + "z": 0.2, + "w": 1 + }, + "_groundAlbedo": { + "__type__": "cc.Vec4", + "x": 0.2, + "y": 0.2, + "z": 0.2, + "w": 1 + }, + "_skyColorLDR": { + "__type__": "cc.Vec4", + "x": 0.452588, + "y": 0.607642, + "z": 0.755699, + "w": 0 + }, + "_skyIllumLDR": 0.8, + "_groundAlbedoLDR": { + "__type__": "cc.Vec4", + "x": 0.618555, + "y": 0.577848, + "z": 0.544564, + "w": 0 + } + }, + { + "__type__": "cc.ShadowsInfo", + "_enabled": false, + "_type": 0, + "_normal": { + "__type__": "cc.Vec3", + "x": 0, + "y": 1, + "z": 0 + }, + "_distance": 0, + "_shadowColor": { + "__type__": "cc.Color", + "r": 76, + "g": 76, + "b": 76, + "a": 255 + }, + "_maxReceived": 4, + "_size": { + "__type__": "cc.Vec2", + "x": 1024, + "y": 1024 + } + }, + { + "__type__": "cc.SkyboxInfo", + "_envLightingType": 0, + "_envmapHDR": { + "__uuid__": "d032ac98-05e1-4090-88bb-eb640dcb5fc1@b47c0", + "__expectedType__": "cc.TextureCube" + }, + "_envmap": { + "__uuid__": "d032ac98-05e1-4090-88bb-eb640dcb5fc1@b47c0", + "__expectedType__": "cc.TextureCube" + }, + "_envmapLDR": { + "__uuid__": "6f01cf7f-81bf-4a7e-bd5d-0afc19696480@b47c0", + "__expectedType__": "cc.TextureCube" + }, + "_diffuseMapHDR": null, + "_diffuseMapLDR": null, + "_enabled": true, + "_useHDR": true, + "_editableMaterial": null, + "_reflectionHDR": null, + "_reflectionLDR": null, + "_rotationAngle": 0 + }, + { + "__type__": "cc.FogInfo", + "_type": 0, + "_fogColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "_enabled": false, + "_fogDensity": 0.3, + "_fogStart": 0.5, + "_fogEnd": 300, + "_fogAtten": 5, + "_fogTop": 1.5, + "_fogRange": 1.2, + "_accurate": false + }, + { + "__type__": "cc.OctreeInfo", + "_enabled": false, + "_minPos": { + "__type__": "cc.Vec3", + "x": -1024, + "y": -1024, + "z": -1024 + }, + "_maxPos": { + "__type__": "cc.Vec3", + "x": 1024, + "y": 1024, + "z": 1024 + }, + "_depth": 8 + }, + { + "__type__": "cc.SkinInfo", + "_enabled": true, + "_blurRadius": 0.01, + "_sssIntensity": 3 + }, + { + "__type__": "cc.LightProbeInfo", + "_giScale": 1, + "_giSamples": 1024, + "_bounces": 2, + "_reduceRinging": 0, + "_showProbe": true, + "_showWireframe": true, + "_showConvex": false, + "_data": null, + "_lightProbeSphereVolume": 1 + }, + { + "__type__": "cc.PostSettingsInfo", + "_toneMappingType": 0 + } +] \ No newline at end of file diff --git a/assets/resources/scenes/drag.scene.meta b/assets/resources/scenes/drag.scene.meta new file mode 100644 index 0000000..014e3bf --- /dev/null +++ b/assets/resources/scenes/drag.scene.meta @@ -0,0 +1,11 @@ +{ + "ver": "1.1.49", + "importer": "scene", + "imported": true, + "uuid": "3fd7ab19-8a50-470c-8dc7-0cd664f0fb5b", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": {} +} diff --git a/assets/resources/ui.meta b/assets/resources/ui.meta new file mode 100644 index 0000000..50b3e80 --- /dev/null +++ b/assets/resources/ui.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "48a2fcb7-7b67-47f9-b27a-72e5dd8f59bf", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/assets/resources/ui/icons.meta b/assets/resources/ui/icons.meta new file mode 100644 index 0000000..51861ef --- /dev/null +++ b/assets/resources/ui/icons.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "3e88e947-2ba2-4e75-9137-b4478ee3e30c", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/assets/resources/ui/icons/test.png b/assets/resources/ui/icons/test.png new file mode 100644 index 0000000..516cbc8 Binary files /dev/null and b/assets/resources/ui/icons/test.png differ diff --git a/assets/resources/ui/icons/test.png.meta b/assets/resources/ui/icons/test.png.meta new file mode 100644 index 0000000..e8a6519 --- /dev/null +++ b/assets/resources/ui/icons/test.png.meta @@ -0,0 +1,134 @@ +{ + "ver": "1.0.26", + "importer": "image", + "imported": true, + "uuid": "890f043a-8cad-46e4-b5b1-584554c0cad1", + "files": [ + ".json", + ".png" + ], + "subMetas": { + "6c48a": { + "importer": "texture", + "uuid": "890f043a-8cad-46e4-b5b1-584554c0cad1@6c48a", + "displayName": "test", + "id": "6c48a", + "name": "texture", + "userData": { + "wrapModeS": "repeat", + "wrapModeT": "repeat", + "minfilter": "linear", + "magfilter": "linear", + "mipfilter": "none", + "anisotropy": 0, + "isUuid": true, + "imageUuidOrDatabaseUri": "890f043a-8cad-46e4-b5b1-584554c0cad1", + "visible": false + }, + "ver": "1.0.22", + "imported": true, + "files": [ + ".json" + ], + "subMetas": {} + }, + "f9941": { + "importer": "sprite-frame", + "uuid": "890f043a-8cad-46e4-b5b1-584554c0cad1@f9941", + "displayName": "test", + "id": "f9941", + "name": "spriteFrame", + "userData": { + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 140, + "height": 140, + "rawWidth": 140, + "rawHeight": 140, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "packable": true, + "pixelsToUnit": 100, + "pivotX": 0.5, + "pivotY": 0.5, + "meshType": 0, + "vertices": { + "rawPosition": [ + -70, + -70, + 0, + 70, + -70, + 0, + -70, + 70, + 0, + 70, + 70, + 0 + ], + "indexes": [ + 0, + 1, + 2, + 2, + 1, + 3 + ], + "uv": [ + 0, + 140, + 140, + 140, + 0, + 0, + 140, + 0 + ], + "nuv": [ + 0, + 0, + 1, + 0, + 0, + 1, + 1, + 1 + ], + "minPos": [ + -70, + -70, + 0 + ], + "maxPos": [ + 70, + 70, + 0 + ] + }, + "isUuid": true, + "imageUuidOrDatabaseUri": "890f043a-8cad-46e4-b5b1-584554c0cad1@6c48a", + "atlasUuid": "" + }, + "ver": "1.0.12", + "imported": true, + "files": [ + ".json" + ], + "subMetas": {} + } + }, + "userData": { + "hasAlpha": true, + "type": "sprite-frame", + "fixAlphaTransparencyArtifacts": true, + "redirect": "890f043a-8cad-46e4-b5b1-584554c0cad1@f9941" + } +} diff --git a/assets/scripts.meta b/assets/scripts.meta new file mode 100644 index 0000000..fdcbe86 --- /dev/null +++ b/assets/scripts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "bab336a4-c3b5-4e3a-9694-ddae8e852f2b", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/assets/scripts/components.meta b/assets/scripts/components.meta new file mode 100644 index 0000000..9b3cdde --- /dev/null +++ b/assets/scripts/components.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "409f432f-de47-4163-ab55-71e78cb76ca0", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/assets/scripts/components/GPDrag.ts b/assets/scripts/components/GPDrag.ts new file mode 100644 index 0000000..cf85bcd --- /dev/null +++ b/assets/scripts/components/GPDrag.ts @@ -0,0 +1,144 @@ +import { _decorator, CCBoolean, TweenEasing , CCFloat, CCString, Component, easing, Enum, EventTouch, isValid, Node, NodeEventType, Tween, tween, Vec2, Vec3 } from 'cc'; +const { ccclass, property } = _decorator; +export enum FloatType { + None, + MoveToTop, + MoveToTopLayer, + // CopyToTopLayer +} +export enum DragBackHomeType { + SetPosition, + Tween +} +export enum EasingString { + 'linear' , 'smooth' , 'fade' , 'constant' , + 'quadIn' , 'quadOut' , 'quadInOut' , 'quadOutIn' , + 'cubicIn' , 'cubicOut' , 'cubicInOut' , 'cubicOutIn' , + 'quartIn' , 'quartOut' , 'quartInOut' , 'quartOutIn' , + 'quintIn' , 'quintOut' , 'quintInOut' , 'quintOutIn' , + 'sineIn' , 'sineOut' , 'sineInOut' , 'sineOutIn' , + 'expoIn' , 'expoOut' , 'expoInOut' , 'expoOutIn' , + 'circIn' , 'circOut' , 'circInOut' , 'circOutIn' , + 'elasticIn' , 'elasticOut' , 'elasticInOut' , 'elasticOutIn' , + 'backIn' , 'backOut' , 'backInOut' , 'backOutIn' , + 'bounceIn' , 'bounceOut' , 'bounceInOut' , 'bounceOutIn' +} +@ccclass('GPDrag') +export class GPDrag extends Component { + @property({type:CCBoolean, tooltip:"触碰点偏移量敏感"}) + public touchOffsetSensitive = true + + @property({type:CCBoolean, tooltip:"失败时回到起始位置"}) + public backHomeWhenFailed = true + + @property({type:Enum(DragBackHomeType), tooltip:"回家的方式", visible:function(this){ + return this.backHomeWhenFailed + }}) + public backHomeType:DragBackHomeType = DragBackHomeType.SetPosition + + @property({type:CCFloat, visible:function(this) { + return this.backHomeWhenFailed && this.backHomeType == DragBackHomeType.Tween + }}) + public backTweenTime:number = 1; + + @property({type:Enum(EasingString), tooltip:"缓动类型", visible:function(this) { + return this.backHomeWhenFailed && this.backHomeType == DragBackHomeType.Tween + }}) + public backTweenEasing:EasingString = EasingString.linear + + @property({type:Enum(FloatType), tooltip:"上浮类型"}) + public floatType:FloatType = FloatType.None + + @property({type:Node, visible:function(this){ + return this.floatType == FloatType.MoveToTopLayer + // || this.floatType == FloatType.CopyToTopLayer + }}) + public topLayerNode:Node + + @property({type:CCBoolean, tooltip:"松开后返回原来的层级", visible:function(){ + return this.floatType != FloatType.None + }}) + public backToOriZ = true; + private srcParent:Node + private zOrder:number + private dragStartPos:Vec2 = new Vec2(0, 0) + private dragOffset:Vec2 = new Vec2(0, 0) + private succeedCheck:Function = null; + private succeedCallback:Function = null; + private backTween:Tween + + + start() { + this.node.on(NodeEventType.TOUCH_START, this.OnDragStart, this) + this.node.on(NodeEventType.TOUCH_MOVE, this.OnDragMove, this) + this.node.on(NodeEventType.TOUCH_END, this.OnDragEnd, this) + this.node.on(NodeEventType.TOUCH_CANCEL, this.OnDragEnd, this) + } + + private OnDragStart(e:EventTouch) { + this.dragStartPos.set(this.node.position.x, this.node.position.y); + let touchPoint = e.getUILocation(); + Vec2.subtract(this.dragOffset, this.dragStartPos, touchPoint) + switch(this.floatType) { + case FloatType.MoveToTop: + this.zOrder = this.node.getSiblingIndex(); + this.node.setSiblingIndex(Infinity); + break; + case FloatType.MoveToTopLayer: + this.zOrder = this.node.getSiblingIndex() + this.srcParent = this.node.parent + this.node.parent = this.topLayerNode; + break; + // case FloatType.CopyToTopLayer: + // break; + } + } + + private OnDragMove(e:EventTouch) { + let p = e.getUILocation(); + if (this.touchOffsetSensitive) + this.node.setPosition(new Vec3(p.x + this.dragOffset.x, p.y + this.dragOffset.y, 0)) + else + this.node.setPosition(new Vec3(p.x, 0, p.y)) + } + + private OnDragEnd(e:EventTouch) { + if (this.succeedCheck && this.succeedCheck(e)) { + this.succeedCallback && this.succeedCallback(e) + } else if(this.backHomeWhenFailed){ + let p = new Vec3(this.dragStartPos.x, this.dragStartPos.y, 0); + switch(this.backHomeType) { + case DragBackHomeType.SetPosition: + this.node.setPosition(p) + this.OnArrivedHome(); + break; + case DragBackHomeType.Tween: + this.backTween && this.backTween.stop() + let easing:TweenEasing = EasingString[this.backTweenEasing] as TweenEasing + this.backTween = tween(this.node) + .to(this.backTweenTime, {position:p}, {easing:easing}).call(this.OnArrivedHome.bind(this)).start() + break; + } + } + } + + private OnArrivedHome() { + if (this.backToOriZ) + switch(this.floatType) { + case FloatType.MoveToTop: + this.node.setSiblingIndex(this.zOrder) + break; + case FloatType.MoveToTopLayer: + this.node.parent = this.srcParent; + this.node.setSiblingIndex(this.zOrder) + break; + } + } + + protected onDestroy(): void { + this.node.off(NodeEventType.TOUCH_START, this.OnDragStart, this) + this.node.off(NodeEventType.TOUCH_MOVE, this.OnDragMove, this) + this.node.off(NodeEventType.TOUCH_END, this.OnDragEnd, this) + this.node.off(NodeEventType.TOUCH_CANCEL, this.OnDragEnd, this) + } +} \ No newline at end of file diff --git a/assets/scripts/components/GPDrag.ts.meta b/assets/scripts/components/GPDrag.ts.meta new file mode 100644 index 0000000..0825974 --- /dev/null +++ b/assets/scripts/components/GPDrag.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "46054293-575d-4bd5-ba45-a7992d44ed7d", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..47ab515 --- /dev/null +++ b/package.json @@ -0,0 +1,7 @@ +{ + "name": "drag", + "uuid": "6a0f6edd-acdd-43bd-bdc5-f0fd4b2cf734", + "creator": { + "version": "3.8.1" + } +}