diff --git a/.gitignore b/.gitignore index a231b3f5..f10feedb 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ node_modules/ #////////////////////////// # WebStorm #////////////////////////// -.idea/ \ No newline at end of file +.idea/ +/nul diff --git a/assets/Scenes/LoginScene.scene b/assets/Scenes/LoginScene.scene new file mode 100644 index 00000000..564da48e --- /dev/null +++ b/assets/Scenes/LoginScene.scene @@ -0,0 +1,1393 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "LoginScene", + "_objFlags": 0, + "__editorExtras__": {}, + "_native": "", + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_name": "LoginScene", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_active": true, + "_components": [], + "_prefab": { + "__id__": 33 + }, + "_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__": 34 + }, + "_id": "dab4ae00-c26e-4176-9c7e-709d8899e525" + }, + { + "__type__": "cc.Node", + "_name": "UICanvas", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + }, + { + "__id__": 5 + } + ], + "_active": true, + "_components": [ + { + "__id__": 30 + }, + { + "__id__": 31 + }, + { + "__id__": 32 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 540, + "y": 1170, + "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": "beI88Z2HpFELqR4T5EMHpg" + }, + { + "__type__": "cc.Node", + "_name": "Camera", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_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": "ebFwiq8gBFaYpqYbdoDODe" + }, + { + "__type__": "cc.Camera", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 3 + }, + "_enabled": true, + "__prefab": null, + "_projection": 0, + "_priority": 0, + "_fov": 45, + "_fovAxis": 0, + "_orthoHeight": 1170, + "_near": 0, + "_far": 2000, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_depth": 1, + "_stencil": 0, + "_clearFlags": 7, + "_rect": { + "__type__": "cc.Rect", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + "_aperture": 19, + "_shutter": 7, + "_iso": 0, + "_screenScale": 1, + "_visibility": 1108344832, + "_targetTexture": null, + "_postProcess": null, + "_usePostProcess": false, + "_cameraType": -1, + "_trackingType": 0, + "_id": "63WIch3o5BEYRlXzTT0oWc" + }, + { + "__type__": "cc.Node", + "_name": "LoginUI", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 6 + }, + { + "__id__": 10 + }, + { + "__id__": 13 + }, + { + "__id__": 16 + } + ], + "_active": true, + "_components": [ + { + "__id__": 27 + }, + { + "__id__": 28 + }, + { + "__id__": 29 + } + ], + "_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": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "23Dh4rs5FFYLcPZI6qA2h6" + }, + { + "__type__": "cc.Node", + "_name": "BG", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 5 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 7 + }, + { + "__id__": 8 + }, + { + "__id__": 9 + } + ], + "_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": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "1d5qGpOzlPnLnKhwI6LYt7" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 6 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 1170, + "height": 2532 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "d0c5DY6+pDY74yxB4Bb9l/" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 6 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 24, + "g": 15, + "b": 32, + "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": "63iO9zGNNDP47QFZzKrJzC" + }, + { + "__type__": "820fdbVWCBN+qohMzrVfhh2", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 6 + }, + "_enabled": true, + "__prefab": null, + "_id": "16QQQ23ZJLVbI+9+hB2cMF" + }, + { + "__type__": "cc.Node", + "_name": "Icon_BG", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 5 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 11 + }, + { + "__id__": 12 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 299.3589999999999, + "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": "96PSzdR+lNW6rxfZaUrhFR" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 10 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 312, + "height": 312 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "6cv3lYbA1LhIoC9AtJJObM" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 10 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "956bb46f-bf99-44c5-b1d3-4717914d71ea@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": "f5WrotzqdGWJP9wQYVbDCZ" + }, + { + "__type__": "cc.Node", + "_name": "text", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 5 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 14 + }, + { + "__id__": 15 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -14.424999999999955, + "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": "8dWZtjhe5MC4Vrv/iR99Wa" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 13 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 971.1772500000001, + "height": 307.104 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "450JyC0olLu7EQEduC9/bx" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 13 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 195, + "g": 186, + "b": 206, + "a": 255 + }, + "_string": "All characters, places, or organizations depicted in this app are fictitious. Any resemblance to real persons, living or dead, is purely coincidental.", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 46, + "_fontSize": 46, + "_fontFamily": "NotoSans-Regular", + "_lineHeight": 54.6, + "_overflow": 1, + "_enableWrapText": true, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_enableOutline": false, + "_outlineColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_outlineWidth": 2, + "_enableShadow": false, + "_shadowColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_shadowOffset": { + "__type__": "cc.Vec2", + "x": 2, + "y": 2 + }, + "_shadowBlur": 2, + "_id": "b4oSayshNMcqNuuyrCIJak" + }, + { + "__type__": "cc.Node", + "_name": "loginNode", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 5 + }, + "_children": [ + { + "__id__": 17 + } + ], + "_active": true, + "_components": [ + { + "__id__": 25 + }, + { + "__id__": 26 + } + ], + "_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": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "cbgmHP/CFF1rtmMD7vJI0c" + }, + { + "__type__": "cc.Node", + "_name": "btnLogin", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 16 + }, + "_children": [ + { + "__id__": 18 + } + ], + "_active": true, + "_components": [ + { + "__id__": 21 + }, + { + "__id__": 22 + }, + { + "__id__": 23 + }, + { + "__id__": 24 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -370.278, + "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": "20XiExjNlNz4WgKxRYVHg4" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 17 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 19 + }, + { + "__id__": 20 + } + ], + "_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": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "c9QK+QiMdN05iiunOuSORG" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 18 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 124.5999755859375, + "height": 91.35 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "c69JGQfqNFH7wh5os8iwkl" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 18 + }, + "_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": 62.3, + "_fontSize": 62.3, + "_fontFamily": "Arial", + "_lineHeight": 72.5, + "_overflow": 0, + "_enableWrapText": true, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_enableOutline": false, + "_outlineColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_outlineWidth": 2, + "_enableShadow": false, + "_shadowColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_shadowOffset": { + "__type__": "cc.Vec2", + "x": 2, + "y": 2 + }, + "_shadowBlur": 2, + "_id": "14arglROtOO4uXIOOeRmbM" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 17 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 500, + "height": 110.1 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "9b8PXTRT1DqKCAXDPmdvwb" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 17 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 218, + "b": 70, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "d3a6a283-9dd4-4193-b450-46f35eea4a3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "d2zujrESJPbJh2iH8ZtP3u" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 17 + }, + "_enabled": true, + "__prefab": null, + "_alignFlags": 20, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 744.672, + "_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": "dfdxZQmvFOwrQBo53Z1saZ" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 17 + }, + "_enabled": true, + "__prefab": null, + "clickEvents": [], + "_interactable": true, + "_transition": 0, + "_normalColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_hoverColor": { + "__type__": "cc.Color", + "r": 211, + "g": 211, + "b": 211, + "a": 255 + }, + "_pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_disabledColor": { + "__type__": "cc.Color", + "r": 124, + "g": 124, + "b": 124, + "a": 255 + }, + "_normalSprite": null, + "_hoverSprite": null, + "_pressedSprite": null, + "_disabledSprite": null, + "_duration": 0.1, + "_zoomScale": 1.2, + "_target": { + "__id__": 17 + }, + "_id": "c9KDag5vBLKazTx4FSrM2p" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 16 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 1080, + "height": 2340 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "51LpH13xtAcKvHofY3HjM1" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 16 + }, + "_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": 100, + "_originalHeight": 100, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "ffSHIcdQ9MDLv6Ji+LALik" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 5 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 1080, + "height": 2340 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "61PRTabr1JtalMKyhRN7re" + }, + { + "__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": 100, + "_originalHeight": 100, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "fcCE1XQq5LsqZEHtr4Un7m" + }, + { + "__type__": "0fa6dwB3g1IR65sYkERgU2A", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 5 + }, + "_enabled": true, + "__prefab": null, + "m_rootNode": null, + "_id": "19/KVpJSNDwrm5eFmJdFVS" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 1080, + "height": 2340 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "d6rUX5yfhMlKoWX2bSbawx" + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": null, + "_cameraComponent": { + "__id__": 4 + }, + "_alignCanvasWithScreen": true, + "_id": "12O/ljcVlEqLmVm3U2gEOQ" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 2 + }, + "_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": "c5V1EV8IpMtrIvY1OE9t2u" + }, + { + "__type__": "cc.PrefabInfo", + "root": null, + "asset": null, + "fileId": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4", + "instance": null, + "targetOverrides": null + }, + { + "__type__": "cc.SceneGlobals", + "ambient": { + "__id__": 35 + }, + "shadows": { + "__id__": 36 + }, + "_skybox": { + "__id__": 37 + }, + "fog": { + "__id__": 38 + }, + "octree": { + "__id__": 39 + }, + "skin": { + "__id__": 40 + }, + "lightProbeInfo": { + "__id__": 41 + }, + "postSettings": { + "__id__": 42 + }, + "bakedWithStationaryMainLight": false, + "bakedWithHighpLightmap": false + }, + { + "__type__": "cc.AmbientInfo", + "_skyColorHDR": { + "__type__": "cc.Vec4", + "x": 0, + "y": 0, + "z": 0, + "w": 0.520833125 + }, + "_skyColor": { + "__type__": "cc.Vec4", + "x": 0, + "y": 0, + "z": 0, + "w": 0.520833125 + }, + "_skyIllumHDR": 20000, + "_skyIllum": 20000, + "_groundAlbedoHDR": { + "__type__": "cc.Vec4", + "x": 0, + "y": 0, + "z": 0, + "w": 0 + }, + "_groundAlbedo": { + "__type__": "cc.Vec4", + "x": 0, + "y": 0, + "z": 0, + "w": 0 + }, + "_skyColorLDR": { + "__type__": "cc.Vec4", + "x": 0.2, + "y": 0.5, + "z": 0.8, + "w": 1 + }, + "_skyIllumLDR": 20000, + "_groundAlbedoLDR": { + "__type__": "cc.Vec4", + "x": 0.2, + "y": 0.2, + "z": 0.2, + "w": 1 + } + }, + { + "__type__": "cc.ShadowsInfo", + "_enabled": false, + "_type": 0, + "_normal": { + "__type__": "cc.Vec3", + "x": 0, + "y": 1, + "z": 0 + }, + "_distance": 0, + "_planeBias": 1, + "_shadowColor": { + "__type__": "cc.Color", + "r": 76, + "g": 76, + "b": 76, + "a": 255 + }, + "_maxReceived": 4, + "_size": { + "__type__": "cc.Vec2", + "x": 512, + "y": 512 + } + }, + { + "__type__": "cc.SkyboxInfo", + "_envLightingType": 0, + "_envmapHDR": null, + "_envmap": null, + "_envmapLDR": null, + "_diffuseMapHDR": null, + "_diffuseMapLDR": null, + "_enabled": false, + "_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": false, + "_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/Scenes/LoginScene.scene.meta b/assets/Scenes/LoginScene.scene.meta new file mode 100644 index 00000000..1be101e8 --- /dev/null +++ b/assets/Scenes/LoginScene.scene.meta @@ -0,0 +1 @@ +{"ver":"1.1.50","importer":"scene","imported":true,"uuid":"dab4ae00-c26e-4176-9c7e-709d8899e525","files":[".json"],"subMetas":{},"userData":{}} diff --git a/assets/Scenes/PreloadScene.scene b/assets/Scenes/PreloadScene.scene index f23306db..cbc735d0 100644 --- a/assets/Scenes/PreloadScene.scene +++ b/assets/Scenes/PreloadScene.scene @@ -922,7 +922,7 @@ "__id__": 48 } ], - "_active": true, + "_active": false, "_components": [ { "__id__": 52 diff --git a/assets/Scripts/Sub/UI/LoginUI.ts b/assets/Scripts/Sub/UI/LoginUI.ts new file mode 100644 index 00000000..68329664 --- /dev/null +++ b/assets/Scripts/Sub/UI/LoginUI.ts @@ -0,0 +1,87 @@ +import { _decorator, Button, Component, Node } from "cc"; +import li_BaseView from "../../Main/Common/li_BaseView"; +import Utils from "../../Main/Common/Utils"; +import { GButton } from "../../Main/Common/GButton"; +import ResManager from "../../Main/Manager/ResManager"; +import { DataManager, DataId } from "../../chat18x/data/DataManager"; +import { LoginData } from "../../chat18x/data/LoginData"; +import { PlayerData } from "../../chat18x/data/PlayerData"; +import { AccountData } from "../../chat18x/data/AccountData"; +import { WalletData } from "../../chat18x/data/WalletData"; +import { EnvData } from "../../chat18x/data/EnvData"; +import DeviceIdService from "db://assets/Scripts/chat18x/foundation/identity/DeviceIdService"; +import MachineInfoService from "db://assets/Scripts/chat18x/foundation/identity/MachineInfoService"; +import { AuthService } from "db://assets/Scripts/chat18x/network/services/AuthService"; +import { PlayerDataService } from "db://assets/Scripts/chat18x/network/services/PlayerDataService"; +import proto from "db://assets/Scripts/proto/proto.pb.js"; +const { ccclass, property } = _decorator; + +@ccclass("LoginUI") +export class LoginUI extends li_BaseView { + private _nodeTab: any = {}; + private loginFinish = false; + + loginBtn: Node; + protected start(): void { + Utils.parseNode(this.node, this._nodeTab); + + this.loginBtn = this._nodeTab.btnLogin; + + GButton.BandClick(this.loginBtn, this.onLogin, this); + } + + update(deltaTime: number) { + if (this.loginFinish) { + this.loginFinish = false; + this.enterGame(); + } + } + + async onLogin() { + const deviceId = DeviceIdService.I.id; + const os = MachineInfoService.I.getMachineOs(); + const reqData = { + platType: "guset", + userId: deviceId, + device: deviceId, + os, + }; + console.log("登录请求数据:", reqData); + let res = await AuthService.I.login(reqData); + console.log("登录响应数据:", res); + if (res && res.code === proto.cs.EnmRetCode.SUCCESS) { + const resData = res.data; + const loginData = DataManager.I.getDataById(DataId.Login); + loginData.token = resData.token; + loginData.refreshToken = resData.refreshToken; + loginData.expire = Number(resData.expire); + const playerData = DataManager.I.getDataById(DataId.Player); + playerData.name = resData.name; + const accountData = DataManager.I.getDataById( + DataId.Account + ); + accountData.accId = resData.accId; + const envData = DataManager.I.getDataById(DataId.Env); + envData.cdn = resData.cdn; + + this.loginFinish = true; + this.reqMyInfo(); + } + } + + private async reqMyInfo() { + const reqData = {}; + let res = await PlayerDataService.I.reqMyInfo(reqData); + console.log("个人信息响应数据:", res); + if (res && res.code === proto.cs.EnmRetCode.SUCCESS) { + const resData = res.data; + const walletData = DataManager.I.getDataById(DataId.Wallet); + walletData.balance = Number(resData.balance); + walletData.vipExpire = Number(resData.vipExpire); + } + } + + private enterGame() { + ResManager.I.goMainScene(); + } +} diff --git a/assets/Scripts/Sub/UI/LoginUI.ts.meta b/assets/Scripts/Sub/UI/LoginUI.ts.meta new file mode 100644 index 00000000..d2d59fe1 --- /dev/null +++ b/assets/Scripts/Sub/UI/LoginUI.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.24", + "importer": "typescript", + "imported": true, + "uuid": "0fa6dc01-de0d-4847-ae6c-624111814d80", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/assets/Scripts/Sub/UI/PreloadUI.ts b/assets/Scripts/Sub/UI/PreloadUI.ts index 6e540957..6e00b5d0 100644 --- a/assets/Scripts/Sub/UI/PreloadUI.ts +++ b/assets/Scripts/Sub/UI/PreloadUI.ts @@ -25,34 +25,19 @@ import Utils from "../../Main/Common/Utils"; import { InnerMsgCode } from "../../Main/Config/InnerMsgCode"; import { promptItem } from "../Item/promptItem"; import LanguageUtils, { LanguageType } from "../../Main/Common/LanguageUtils"; -import { DataManager, DataId } from "../../chat18x/data/DataManager"; -import { LoginData } from "../../chat18x/data/LoginData"; -import { PlayerData } from "../../chat18x/data/PlayerData"; -import { AccountData } from "../../chat18x/data/AccountData"; -import { WalletData } from "../../chat18x/data/WalletData"; -import { EnvData } from "../../chat18x/data/EnvData"; +import { DataManager } from "../../chat18x/data/DataManager"; import { ConfigManager } from "../../chat18x/manager/ConfigManager"; import { AppConfig } from "db://assets/Scripts/chat18x/config/env/appConfig"; import DeviceIdService from "db://assets/Scripts/chat18x/foundation/identity/DeviceIdService"; -import MachineInfoService from "db://assets/Scripts/chat18x/foundation/identity/MachineInfoService"; -import { AuthService } from "db://assets/Scripts/chat18x/network/services/AuthService"; -import { PlayerDataService } from "db://assets/Scripts/chat18x/network/services/PlayerDataService"; -import { ApiCode } from "db://assets/Scripts/chat18x/network/client/types"; -import proto from "db://assets/Scripts/proto/proto.pb.js"; const { ccclass, property } = _decorator; @ccclass("PreloadUI") export class PreloadUI extends Component { - private checkFinish = true; //检查完成 private preloadFinish = false; //资源加载完成 - private loginFinish = false; //登录完成 private jinduBar: Node = null; private jinduFilled: Sprite = null; - //private LabProgress: Label = null; - private loginNode: Node = null; - private btnLogin: Node = null; //登录按钮 start() { //Utils.addInnerEL(InnerMsgCode.UI_ShowPrompt, this, this.resiveShowPrompt) @@ -62,16 +47,11 @@ export class PreloadUI extends Component { .getChildByName("jinduFilled") .getComponent(Sprite); - this.loginNode = this.node.getChildByName("loginNode"); - this.btnLogin = this.loginNode.getChildByName("btnLogin"); - //适配背景图 let BG = this.node.getChildByName("BG"); Utils.adjustBgPixelRatio(BG, 1); this.jinduFilled.fillRange = 0; - // 注册监听 - this.registerListener(); // 初始化配置 ConfigManager.I.init(); @@ -97,11 +77,9 @@ export class PreloadUI extends Component { } update(deltaTime: number) { - if (this.checkFinish) { - if (this.preloadFinish && this.loginFinish) { - this.checkFinish = false; - this.enterGame(); - } + if (this.preloadFinish) { + this.preloadFinish = false; + this.goToLoginScene(); } } @@ -195,7 +173,6 @@ export class PreloadUI extends Component { }); } else { this.preloadFinish = true; - this.enterLoginModule(); } }; preloadFunc(); @@ -206,120 +183,11 @@ export class PreloadUI extends Component { this.jinduFilled.fillRange = percent; } - // 进入登录模块 - private enterLoginModule() { - //this.LabProgress.node.active = false; + // 跳转到登录场景 + private goToLoginScene() { this.jinduBar.active = false; - this.loginNode.active = true; + ResManager.I.goCustomScene("LoginScene"); } - //登录 - async onLogin() { - //初始化SDK信息 - // SDKManager.init(() => { - // //检测是否有授权,有授权直接登录,没有授权就先进主界面,到主界面获取权限 - // SDKManager.checkAutoSetting("userInfo", (ishave) => { - // if (ishave) { - // console.log("有授权,直接登录") - // HttpUnit.ins.login((loginData) => { - // if (loginData == null) { - // //登录失败,这里处理重复登录的逻辑 - // } else { - // this.loginFinish = true - // } - // }) - // } else { - // console.log("没有授权,等待授权后登录") - // // this.loginFinish = true - // this.jinduBar.active = false - // this.LabProgress.node.active = false - // //登录按钮 - // this.btnLogin.node.active = true - // let loginPath = "" - // if (SDKManager.isWenxin()) { - // loginPath = "login1" - // } else if (SDKManager.isByteDance()) { - // loginPath = "login2" - // } else if (SDKManager.isKuaishou()) { - // loginPath = "login3" - // } - // ResManager.I.changeResourceSpriteFrame(this.btnLogin, loginPath) - // - // HttpUnit.ins.login((loginData) => { - // if (loginData == null) { - // //登录失败,这里处理重复登录的逻辑 - // } else { - // this.loginFinish = true - // } - // }) - // } - // }) - // }) - // 游客登录 - const deviceId = DeviceIdService.I.id; - const os = MachineInfoService.I.getMachineOs(); - const reqData = { - platType: "guset", - userId: deviceId, - device: deviceId, - os, - }; - console.log("登录请求数据:", reqData); - let res = await AuthService.I.login(reqData); - console.log("登录响应数据:", res); - if (res && res.code === proto.cs.EnmRetCode.SUCCESS) { - const resData = res.data; - // 保存数据 - const loginData = DataManager.I.getDataById(DataId.Login); - loginData.token = resData.token; - loginData.refreshToken = resData.refreshToken; - loginData.expire = Number(resData.expire); - const playerData = DataManager.I.getDataById(DataId.Player); - playerData.name = resData.name; - const accountData = DataManager.I.getDataById( - DataId.Account - ); - accountData.accId = resData.accId; - const envData = DataManager.I.getDataById(DataId.Env); - envData.cdn = resData.cdn; - - this.loginFinish = true; - // 请求个人信息 - this.reqMyInfo(); - } - } - - // 请求个人信息 - private async reqMyInfo() { - const reqData = {}; - let res = await PlayerDataService.I.reqMyInfo(reqData); - console.log("个人信息响应数据:", res); - if (res && res.code === proto.cs.EnmRetCode.SUCCESS) { - const resData = res.data; - // 保存数据 - const walletData = DataManager.I.getDataById(DataId.Wallet); - walletData.balance = Number(resData.balance); - walletData.vipExpire = Number(resData.vipExpire); - } - } - - enterGame() { - //let islogin = HttpUnit.IsLogin(); - //console.log("进入游戏,登录状态:", islogin); - this.jinduBar.active = false; - //this.LabProgress.node.active = false; - //this.btnLogin.node.active = false - // if (islogin) { - // } else { - // //没登录成功,先进主界面,在主界面里进行登录 - // } - - ResManager.I.goMainScene(); //进入下一个场景 - // ResManager.I.goCustomScene("Test2DScene"); //进入自定义场景 - } - - private registerListener() { - GButton.BandClick(this.btnLogin, this.onLogin, this); - } }