diff --git a/assets/Media/Images/Game/UI/HealthBarBg.png.meta b/assets/Media/Images/Game/UI/HealthBarBg.png.meta index fa7e54a..c81f1c0 100644 --- a/assets/Media/Images/Game/UI/HealthBarBg.png.meta +++ b/assets/Media/Images/Game/UI/HealthBarBg.png.meta @@ -8,30 +8,6 @@ ".png" ], "subMetas": { - "6c48a": { - "importer": "texture", - "uuid": "29bf4d7b-909b-472f-839a-bbb94136bab3@6c48a", - "displayName": "HealthBarBg", - "id": "6c48a", - "name": "texture", - "userData": { - "wrapModeS": "clamp-to-edge", - "wrapModeT": "clamp-to-edge", - "minfilter": "nearest", - "magfilter": "nearest", - "mipfilter": "none", - "anisotropy": 0, - "isUuid": true, - "imageUuidOrDatabaseUri": "29bf4d7b-909b-472f-839a-bbb94136bab3", - "visible": false - }, - "ver": "1.0.22", - "imported": true, - "files": [ - ".json" - ], - "subMetas": {} - }, "f9941": { "importer": "sprite-frame", "uuid": "29bf4d7b-909b-472f-839a-bbb94136bab3@f9941", @@ -123,6 +99,30 @@ ".json" ], "subMetas": {} + }, + "6c48a": { + "importer": "texture", + "uuid": "29bf4d7b-909b-472f-839a-bbb94136bab3@6c48a", + "displayName": "HealthBarBg", + "id": "6c48a", + "name": "texture", + "userData": { + "wrapModeS": "clamp-to-edge", + "wrapModeT": "clamp-to-edge", + "minfilter": "nearest", + "magfilter": "nearest", + "mipfilter": "none", + "anisotropy": 0, + "isUuid": true, + "imageUuidOrDatabaseUri": "29bf4d7b-909b-472f-839a-bbb94136bab3", + "visible": false + }, + "ver": "1.0.22", + "imported": true, + "files": [ + ".json" + ], + "subMetas": {} } }, "userData": { diff --git a/assets/Media/Images/Game/UI/HealthBarFill.png.meta b/assets/Media/Images/Game/UI/HealthBarFill.png.meta index 36dbd16..b411bb4 100644 --- a/assets/Media/Images/Game/UI/HealthBarFill.png.meta +++ b/assets/Media/Images/Game/UI/HealthBarFill.png.meta @@ -8,30 +8,6 @@ ".png" ], "subMetas": { - "6c48a": { - "importer": "texture", - "uuid": "0ca53d61-de26-4d01-9770-eec0e3ac06ae@6c48a", - "displayName": "HealthBarFill", - "id": "6c48a", - "name": "texture", - "userData": { - "wrapModeS": "clamp-to-edge", - "wrapModeT": "clamp-to-edge", - "minfilter": "nearest", - "magfilter": "nearest", - "mipfilter": "none", - "anisotropy": 0, - "isUuid": true, - "imageUuidOrDatabaseUri": "0ca53d61-de26-4d01-9770-eec0e3ac06ae", - "visible": false - }, - "ver": "1.0.22", - "imported": true, - "files": [ - ".json" - ], - "subMetas": {} - }, "f9941": { "importer": "sprite-frame", "uuid": "0ca53d61-de26-4d01-9770-eec0e3ac06ae@f9941", @@ -123,6 +99,30 @@ ".json" ], "subMetas": {} + }, + "6c48a": { + "importer": "texture", + "uuid": "0ca53d61-de26-4d01-9770-eec0e3ac06ae@6c48a", + "displayName": "HealthBarFill", + "id": "6c48a", + "name": "texture", + "userData": { + "wrapModeS": "clamp-to-edge", + "wrapModeT": "clamp-to-edge", + "minfilter": "nearest", + "magfilter": "nearest", + "mipfilter": "none", + "anisotropy": 0, + "isUuid": true, + "imageUuidOrDatabaseUri": "0ca53d61-de26-4d01-9770-eec0e3ac06ae", + "visible": false + }, + "ver": "1.0.22", + "imported": true, + "files": [ + ".json" + ], + "subMetas": {} } }, "userData": { diff --git a/assets/Media/Prefabs/Game/Player.prefab b/assets/Media/Prefabs/Game/Player.prefab index 7d7bc70..724323e 100644 --- a/assets/Media/Prefabs/Game/Player.prefab +++ b/assets/Media/Prefabs/Game/Player.prefab @@ -22,29 +22,26 @@ "__id__": 2 }, { - "__id__": 32 + "__id__": 10 + }, + { + "__id__": 40 } ], "_active": true, "_components": [ - { - "__id__": 92 - }, - { - "__id__": 94 - }, - { - "__id__": 96 - }, - { - "__id__": 98 - }, { "__id__": 100 + }, + { + "__id__": 102 + }, + { + "__id__": 104 } ], "_prefab": { - "__id__": 102 + "__id__": 106 }, "_lpos": { "__type__": "cc.Vec3", @@ -76,121 +73,17 @@ }, { "__type__": "cc.Node", - "_name": "PlayerUI", + "_name": "PlayerGraphics", "_objFlags": 0, "_parent": { "__id__": 1 }, - "_children": [ - { - "__id__": 3 - } - ], - "_active": true, - "_components": [ - { - "__id__": 27 - }, - { - "__id__": 29 - } - ], - "_prefab": { - "__id__": 31 - }, - "_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 - }, - "_layer": 33554432, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_id": "" - }, - { - "__type__": "cc.Node", - "_name": "PlayerHealthUI", - "_objFlags": 0, - "_parent": { - "__id__": 2 - }, - "_children": [ - { - "__id__": 4 - }, - { - "__id__": 10 - } - ], - "_active": true, - "_components": [ - { - "__id__": 22 - }, - { - "__id__": 24 - } - ], - "_prefab": { - "__id__": 26 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": 0, - "y": 40, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": 2, - "y": 2, - "z": 1 - }, - "_layer": 33554432, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_id": "" - }, - { - "__type__": "cc.Node", - "_name": "Background", - "_objFlags": 0, - "_parent": { - "__id__": 3 - }, "_children": [], "_active": true, "_components": [ + { + "__id__": 3 + }, { "__id__": 5 }, @@ -234,12 +127,280 @@ "_name": "", "_objFlags": 0, "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": { "__id__": 4 }, + "_contentSize": { + "__type__": "cc.Size", + "width": 64, + "height": 80 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "27WCxjyDtPY4hBA7DUNQs/" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, "_enabled": true, "__prefab": { "__id__": 6 }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "3d470257-0eba-4a39-8504-5420e4e28ca8@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": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "70s+AxZhlAtZ5hzh17PCIp" + }, + { + "__type__": "cc.Animation", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": { + "__id__": 8 + }, + "playOnLoad": true, + "_clips": [ + { + "__uuid__": "4cc17fff-7876-4922-b371-2fe1cec77c14", + "__expectedType__": "cc.AnimationClip" + }, + { + "__uuid__": "5bf4b24f-2ebc-43ad-8f59-97e486d05c0c", + "__expectedType__": "cc.AnimationClip" + } + ], + "_defaultClip": { + "__uuid__": "4cc17fff-7876-4922-b371-2fe1cec77c14", + "__expectedType__": "cc.AnimationClip" + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "bcNAmPNOJFZYoGb/Jkt49+" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "10asaaiY9FoLNifykcWCdz" + }, + { + "__type__": "cc.Node", + "_name": "PlayerUI", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 11 + } + ], + "_active": true, + "_components": [ + { + "__id__": 35 + }, + { + "__id__": 37 + } + ], + "_prefab": { + "__id__": 39 + }, + "_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 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "PlayerHealthUI", + "_objFlags": 0, + "_parent": { + "__id__": 10 + }, + "_children": [ + { + "__id__": 12 + }, + { + "__id__": 18 + } + ], + "_active": true, + "_components": [ + { + "__id__": 30 + }, + { + "__id__": 32 + } + ], + "_prefab": { + "__id__": 34 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 40, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 2, + "y": 2, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "Background", + "_objFlags": 0, + "_parent": { + "__id__": 11 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 13 + }, + { + "__id__": 15 + } + ], + "_prefab": { + "__id__": 17 + }, + "_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 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 12 + }, + "_enabled": true, + "__prefab": { + "__id__": 14 + }, "_contentSize": { "__type__": "cc.Size", "width": 22, @@ -261,11 +422,11 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 4 + "__id__": 12 }, "_enabled": true, "__prefab": { - "__id__": 8 + "__id__": 16 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -315,24 +476,24 @@ "_name": "HpBar", "_objFlags": 0, "_parent": { - "__id__": 3 + "__id__": 11 }, "_children": [ { - "__id__": 11 + "__id__": 19 } ], "_active": true, "_components": [ { - "__id__": 17 + "__id__": 25 }, { - "__id__": 19 + "__id__": 27 } ], "_prefab": { - "__id__": 21 + "__id__": 29 }, "_lpos": { "__type__": "cc.Vec3", @@ -367,20 +528,20 @@ "_name": "MovableBar", "_objFlags": 0, "_parent": { - "__id__": 10 + "__id__": 18 }, "_children": [], "_active": true, "_components": [ { - "__id__": 12 + "__id__": 20 }, { - "__id__": 14 + "__id__": 22 } ], "_prefab": { - "__id__": 16 + "__id__": 24 }, "_lpos": { "__type__": "cc.Vec3", @@ -415,11 +576,11 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 11 + "__id__": 19 }, "_enabled": true, "__prefab": { - "__id__": 13 + "__id__": 21 }, "_contentSize": { "__type__": "cc.Size", @@ -442,11 +603,11 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 11 + "__id__": 19 }, "_enabled": true, "__prefab": { - "__id__": 15 + "__id__": 23 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -496,11 +657,11 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 10 + "__id__": 18 }, "_enabled": true, "__prefab": { - "__id__": 18 + "__id__": 26 }, "_contentSize": { "__type__": "cc.Size", @@ -523,14 +684,14 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 10 + "__id__": 18 }, "_enabled": true, "__prefab": { - "__id__": 20 + "__id__": 28 }, "_barSprite": { - "__id__": 14 + "__id__": 22 }, "_mode": 0, "_totalLength": 20, @@ -557,11 +718,11 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 3 + "__id__": 11 }, "_enabled": true, "__prefab": { - "__id__": 23 + "__id__": 31 }, "_contentSize": { "__type__": "cc.Size", @@ -584,14 +745,14 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 3 + "__id__": 11 }, "_enabled": true, "__prefab": { - "__id__": 25 + "__id__": 33 }, "healthBar": { - "__id__": 19 + "__id__": 27 }, "_id": "" }, @@ -614,11 +775,11 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 2 + "__id__": 10 }, "_enabled": true, "__prefab": { - "__id__": 28 + "__id__": 36 }, "_contentSize": { "__type__": "cc.Size", @@ -641,14 +802,14 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 2 + "__id__": 10 }, "_enabled": true, "__prefab": { - "__id__": 30 + "__id__": 38 }, "healthUI": { - "__id__": 24 + "__id__": 32 }, "_id": "" }, @@ -675,17 +836,17 @@ }, "_children": [ { - "__id__": 33 + "__id__": 41 } ], "_active": true, "_components": [ { - "__id__": 89 + "__id__": 97 } ], "_prefab": { - "__id__": 91 + "__id__": 99 }, "_lpos": { "__type__": "cc.Vec3", @@ -720,12 +881,9 @@ "_name": "AnimatedWeapon", "_objFlags": 0, "_parent": { - "__id__": 32 + "__id__": 40 }, "_children": [ - { - "__id__": 34 - }, { "__id__": 42 }, @@ -740,22 +898,25 @@ }, { "__id__": 74 + }, + { + "__id__": 82 } ], "_active": true, "_components": [ { - "__id__": 82 + "__id__": 90 }, { - "__id__": 84 + "__id__": 92 }, { - "__id__": 86 + "__id__": 94 } ], "_prefab": { - "__id__": 88 + "__id__": 96 }, "_lpos": { "__type__": "cc.Vec3", @@ -790,173 +951,8 @@ "_name": "WeaponCollider", "_objFlags": 0, "_parent": { - "__id__": 33 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 35 - }, - { - "__id__": 37 - }, - { - "__id__": 39 - } - ], - "_prefab": { "__id__": 41 }, - "_lpos": { - "__type__": "cc.Vec3", - "x": 70.758, - "y": 0, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0.7071067811865475, - "w": 0.7071067811865476 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": 1, - "y": 1, - "z": 1 - }, - "_layer": 33554432, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 90 - }, - "_id": "" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 34 - }, - "_enabled": true, - "__prefab": { - "__id__": 36 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 20, - "height": 60 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "26JnIO5fFKMJY94HwhP7Ea" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 34 - }, - "_enabled": true, - "__prefab": { - "__id__": 38 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 10, - "b": 10, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@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": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "6denF/VGNC9pPYhCo6jTcJ" - }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 34 - }, - "_enabled": true, - "__prefab": { - "__id__": 40 - }, - "tag": 0, - "_group": 8, - "_density": 1, - "_sensor": false, - "_friction": 0.2, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_size": { - "__type__": "cc.Size", - "width": 20, - "height": 60 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "6dzj0ZweFLqIAu//pVzgvf" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "62G1NZhrtA6oqoo6vnCxoU" - }, - { - "__type__": "cc.Node", - "_name": "WeaponCollider-001", - "_objFlags": 0, - "_parent": { - "__id__": 33 - }, "_children": [], "_active": true, "_components": [ @@ -975,7 +971,7 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 82, + "x": 70.758, "y": 0, "z": 0 }, @@ -1015,7 +1011,7 @@ "_contentSize": { "__type__": "cc.Size", "width": 20, - "height": 80 + "height": 60 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -1026,7 +1022,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "37MHPBYZ9FD7XrDLRhTkh7" + "fileId": "26JnIO5fFKMJY94HwhP7Ea" }, { "__type__": "cc.Sprite", @@ -1070,7 +1066,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "7fCL35jY9MiqaamapYWo4d" + "fileId": "6denF/VGNC9pPYhCo6jTcJ" }, { "__type__": "cc.BoxCollider2D", @@ -1097,13 +1093,13 @@ "_size": { "__type__": "cc.Size", "width": 20, - "height": 80 + "height": 60 }, "_id": "" }, { "__type__": "cc.CompPrefabInfo", - "fileId": "760qkXYLpFRamYDQb+asrT" + "fileId": "6dzj0ZweFLqIAu//pVzgvf" }, { "__type__": "cc.PrefabInfo", @@ -1113,14 +1109,14 @@ "asset": { "__id__": 0 }, - "fileId": "9fhjS72S1Ns5MfV5m3Xe0o" + "fileId": "62G1NZhrtA6oqoo6vnCxoU" }, { "__type__": "cc.Node", - "_name": "WeaponCollider-002", + "_name": "WeaponCollider-001", "_objFlags": 0, "_parent": { - "__id__": 33 + "__id__": 41 }, "_children": [], "_active": true, @@ -1140,7 +1136,7 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 92, + "x": 82, "y": 0, "z": 0 }, @@ -1180,7 +1176,7 @@ "_contentSize": { "__type__": "cc.Size", "width": 20, - "height": 100 + "height": 80 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -1191,7 +1187,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "10Jh20jspLwafR3AfTYAUg" + "fileId": "37MHPBYZ9FD7XrDLRhTkh7" }, { "__type__": "cc.Sprite", @@ -1235,7 +1231,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "d2XpfKGgxOFZh/Szkftz1C" + "fileId": "7fCL35jY9MiqaamapYWo4d" }, { "__type__": "cc.BoxCollider2D", @@ -1262,13 +1258,13 @@ "_size": { "__type__": "cc.Size", "width": 20, - "height": 100 + "height": 80 }, "_id": "" }, { "__type__": "cc.CompPrefabInfo", - "fileId": "4dbjIeTWVGf43weYHP/cxo" + "fileId": "760qkXYLpFRamYDQb+asrT" }, { "__type__": "cc.PrefabInfo", @@ -1278,14 +1274,14 @@ "asset": { "__id__": 0 }, - "fileId": "48mrAHXJtMNYaIKHB78XlO" + "fileId": "9fhjS72S1Ns5MfV5m3Xe0o" }, { "__type__": "cc.Node", - "_name": "WeaponCollider-003", + "_name": "WeaponCollider-002", "_objFlags": 0, "_parent": { - "__id__": 33 + "__id__": 41 }, "_children": [], "_active": true, @@ -1305,7 +1301,7 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 102, + "x": 92, "y": 0, "z": 0 }, @@ -1345,7 +1341,7 @@ "_contentSize": { "__type__": "cc.Size", "width": 20, - "height": 120 + "height": 100 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -1356,7 +1352,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "dfdo3/X/RObIr6NHagxi3K" + "fileId": "10Jh20jspLwafR3AfTYAUg" }, { "__type__": "cc.Sprite", @@ -1400,7 +1396,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "93g9HxPpJDS66Tr+lKOsi1" + "fileId": "d2XpfKGgxOFZh/Szkftz1C" }, { "__type__": "cc.BoxCollider2D", @@ -1427,13 +1423,13 @@ "_size": { "__type__": "cc.Size", "width": 20, - "height": 120 + "height": 100 }, "_id": "" }, { "__type__": "cc.CompPrefabInfo", - "fileId": "17Bj2RC1VOKp3ZLPhCn6y0" + "fileId": "4dbjIeTWVGf43weYHP/cxo" }, { "__type__": "cc.PrefabInfo", @@ -1443,14 +1439,14 @@ "asset": { "__id__": 0 }, - "fileId": "d4nzd/Dg5KbZvnMQ13a5Wq" + "fileId": "48mrAHXJtMNYaIKHB78XlO" }, { "__type__": "cc.Node", - "_name": "WeaponCollider-004", + "_name": "WeaponCollider-003", "_objFlags": 0, "_parent": { - "__id__": 33 + "__id__": 41 }, "_children": [], "_active": true, @@ -1470,7 +1466,7 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 112, + "x": 102, "y": 0, "z": 0 }, @@ -1510,7 +1506,7 @@ "_contentSize": { "__type__": "cc.Size", "width": 20, - "height": 140 + "height": 120 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -1521,7 +1517,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "0bXFehdNVNAonCweeO1bcM" + "fileId": "dfdo3/X/RObIr6NHagxi3K" }, { "__type__": "cc.Sprite", @@ -1565,7 +1561,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "80bCqvlw5I7qSFw/LCJFCZ" + "fileId": "93g9HxPpJDS66Tr+lKOsi1" }, { "__type__": "cc.BoxCollider2D", @@ -1592,13 +1588,13 @@ "_size": { "__type__": "cc.Size", "width": 20, - "height": 140 + "height": 120 }, "_id": "" }, { "__type__": "cc.CompPrefabInfo", - "fileId": "0eujok6UdFLLYvFM40Wypn" + "fileId": "17Bj2RC1VOKp3ZLPhCn6y0" }, { "__type__": "cc.PrefabInfo", @@ -1608,14 +1604,14 @@ "asset": { "__id__": 0 }, - "fileId": "86IoiE6VlKyaT0EAcff4ob" + "fileId": "d4nzd/Dg5KbZvnMQ13a5Wq" }, { "__type__": "cc.Node", - "_name": "WeaponCollider-005", + "_name": "WeaponCollider-004", "_objFlags": 0, "_parent": { - "__id__": 33 + "__id__": 41 }, "_children": [], "_active": true, @@ -1635,7 +1631,7 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 122, + "x": 112, "y": 0, "z": 0 }, @@ -1675,7 +1671,7 @@ "_contentSize": { "__type__": "cc.Size", "width": 20, - "height": 160 + "height": 140 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -1686,7 +1682,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "4e3YnlYBZPhJNnemH6RrLs" + "fileId": "0bXFehdNVNAonCweeO1bcM" }, { "__type__": "cc.Sprite", @@ -1730,7 +1726,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "f8aIgES5lLI71ievsEgqGG" + "fileId": "80bCqvlw5I7qSFw/LCJFCZ" }, { "__type__": "cc.BoxCollider2D", @@ -1754,6 +1750,171 @@ "x": 0, "y": 0 }, + "_size": { + "__type__": "cc.Size", + "width": 20, + "height": 140 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "0eujok6UdFLLYvFM40Wypn" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "86IoiE6VlKyaT0EAcff4ob" + }, + { + "__type__": "cc.Node", + "_name": "WeaponCollider-005", + "_objFlags": 0, + "_parent": { + "__id__": 41 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 83 + }, + { + "__id__": 85 + }, + { + "__id__": 87 + } + ], + "_prefab": { + "__id__": 89 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 122, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0.7071067811865475, + "w": 0.7071067811865476 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 90 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 82 + }, + "_enabled": true, + "__prefab": { + "__id__": 84 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 20, + "height": 160 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "4e3YnlYBZPhJNnemH6RrLs" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 82 + }, + "_enabled": true, + "__prefab": { + "__id__": 86 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 10, + "b": 10, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@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": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "f8aIgES5lLI71ievsEgqGG" + }, + { + "__type__": "cc.BoxCollider2D", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 82 + }, + "_enabled": true, + "__prefab": { + "__id__": 88 + }, + "tag": 0, + "_group": 8, + "_density": 1, + "_sensor": false, + "_friction": 0.2, + "_restitution": 0, + "_offset": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, "_size": { "__type__": "cc.Size", "width": 20, @@ -1780,11 +1941,11 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 33 + "__id__": 41 }, "_enabled": false, "__prefab": { - "__id__": 83 + "__id__": 91 }, "_contentSize": { "__type__": "cc.Size", @@ -1807,11 +1968,11 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 33 + "__id__": 41 }, "_enabled": true, "__prefab": { - "__id__": 85 + "__id__": 93 }, "playOnLoad": false, "_clips": [ @@ -1835,16 +1996,13 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 33 + "__id__": 41 }, "_enabled": true, "__prefab": { - "__id__": 87 + "__id__": 95 }, "colliders": [ - { - "__id__": 39 - }, { "__id__": 47 }, @@ -1859,6 +2017,9 @@ }, { "__id__": 79 + }, + { + "__id__": 87 } ], "_id": "" @@ -1882,17 +2043,17 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 32 + "__id__": 40 }, "_enabled": true, "__prefab": { - "__id__": 90 + "__id__": 98 }, "weaponAnimation": { - "__id__": 84 + "__id__": 92 }, "upgradableCollider": { - "__id__": 86 + "__id__": 94 }, "_id": "" }, @@ -1919,7 +2080,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 93 + "__id__": 101 }, "_contentSize": { "__type__": "cc.Size", @@ -1937,50 +2098,6 @@ "__type__": "cc.CompPrefabInfo", "fileId": "719qofq15Oa5MHES2QrijZ" }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 95 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "3d470257-0eba-4a39-8504-5420e4e28ca8@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": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "88FjjB30tJ97ZyzVf0LOIP" - }, { "__type__": "b570au4G81O8IXoTXg1MQAd", "_name": "", @@ -1990,16 +2107,22 @@ }, "_enabled": true, "__prefab": { - "__id__": 97 + "__id__": 103 }, "collider": { - "__id__": 98 + "__id__": 104 }, "playerUI": { - "__id__": 29 + "__id__": 37 }, "weapon": { - "__id__": 89 + "__id__": 97 + }, + "playerGraphics": { + "__id__": 2 + }, + "animation": { + "__id__": 7 }, "_id": "" }, @@ -2016,7 +2139,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 99 + "__id__": 105 }, "tag": 0, "_group": 2, @@ -2040,34 +2163,6 @@ "__type__": "cc.CompPrefabInfo", "fileId": "18oFw6jPBL34mmf4jgmCVT" }, - { - "__type__": "cc.Animation", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 101 - }, - "playOnLoad": true, - "_clips": [ - { - "__uuid__": "5bf4b24f-2ebc-43ad-8f59-97e486d05c0c", - "__expectedType__": "cc.AnimationClip" - } - ], - "_defaultClip": { - "__uuid__": "5bf4b24f-2ebc-43ad-8f59-97e486d05c0c", - "__expectedType__": "cc.AnimationClip" - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "af5Lk5McBBlYevBMB11or5" - }, { "__type__": "cc.PrefabInfo", "root": { diff --git a/assets/Scenes/Game.scene b/assets/Scenes/Game.scene index 38d2a61..85b9eb6 100644 --- a/assets/Scenes/Game.scene +++ b/assets/Scenes/Game.scene @@ -196,7 +196,7 @@ "_enabled": true, "__prefab": null, "maxHpLevel": 0, - "bonusDamageLevel": 5, + "bonusDamageLevel": 0, "projectilePiercingLevel": 0, "movementSpeedLevel": 0, "xpGathererLevel": 0, @@ -2584,14 +2584,6 @@ "modalWindowManager": { "__id__": 76 }, - "settingsAsset": { - "__uuid__": "4a156ee8-535e-4443-8bf5-8b979a08d232", - "__expectedType__": "cc.JsonAsset" - }, - "translationAsset": { - "__uuid__": "7d43843c-0765-427c-9161-2fd9030369c8", - "__expectedType__": "cc.JsonAsset" - }, "_id": "3a9z1bqlFCGL4/WyDwU4L5" }, { diff --git a/assets/Scripts/Game/Unit/Player/Player.ts b/assets/Scripts/Game/Unit/Player/Player.ts index a8a9185..e39c487 100644 --- a/assets/Scripts/Game/Unit/Player/Player.ts +++ b/assets/Scripts/Game/Unit/Player/Player.ts @@ -1,4 +1,4 @@ -import { BoxCollider2D, Collider2D, Component, Vec2, Vec3, _decorator } from "cc"; +import { Animation, Node, BoxCollider2D, Collider2D, Component, Vec2, Vec3, _decorator } from "cc"; import { IInput } from "../../Input/IInput"; import { UnitHealth } from "../UnitHealth"; import { UnitLevel } from "../UnitLevel"; @@ -13,6 +13,8 @@ export class Player extends Component { @property(BoxCollider2D) private collider: BoxCollider2D; @property(PlayerUI) private playerUI: PlayerUI; @property(Weapon) private weapon: Weapon; + @property(Node) private playerGraphics: Node; + @property(Animation) private animation: Animation; private input: IInput; private health: UnitHealth; @@ -20,6 +22,8 @@ export class Player extends Component { private regeneration: PlayerRegeneration; private speed: number; + private isMoveAnimationPlaying = false; + public init(input: IInput, data: PlayerData): void { this.input = input; this.health = new UnitHealth(data.maxHp); @@ -54,14 +58,32 @@ export class Player extends Component { public gameTick(deltaTime: number): void { const movement: Vec2 = this.input.getAxis(); - movement.x *= deltaTime * this.speed; - movement.y *= deltaTime * this.speed; + if (!movement.equals(Vec2.ZERO)) { + movement.x *= deltaTime * this.speed; + movement.y *= deltaTime * this.speed; - const newPosition: Vec3 = this.node.worldPosition; - newPosition.x += movement.x; - newPosition.y += movement.y; + const newPosition: Vec3 = this.node.worldPosition; + newPosition.x += movement.x; + newPosition.y += movement.y; - this.node.setWorldPosition(newPosition); + this.node.setWorldPosition(newPosition); + + if (!this.isMoveAnimationPlaying) { + this.isMoveAnimationPlaying = true; + this.animation.play("Move"); + } + + if (movement.x <= 0) { + this.playerGraphics.setScale(new Vec3(1, 1, 1)); + } else { + this.playerGraphics.setScale(new Vec3(-1, 1, 1)); + } + } else { + if (this.isMoveAnimationPlaying) { + this.isMoveAnimationPlaying = false; + this.animation.play("Idle"); + } + } this.weapon.gameTick(deltaTime); this.regeneration.gameTick(deltaTime);