diff --git a/Assets/Resources/Games/karateman.prefab b/Assets/Resources/Games/karateman.prefab index 9226b91e7..8444cda50 100644 --- a/Assets/Resources/Games/karateman.prefab +++ b/Assets/Resources/Games/karateman.prefab @@ -106,6 +106,7 @@ MonoBehaviour: late: 0 isEligible: 0 kicked: 0 + RotHolder: {fileID: 7503168023327542540} --- !u!1 &2099248522849929875 GameObject: m_ObjectHideFlags: 0 @@ -766,6 +767,7 @@ MonoBehaviour: HitParticle: {fileID: 7248900332593533644} RockParticle: {fileID: 7248900332432276694} BulbHit: {fileID: 7248900333007582906} + hitBarrel: 0 --- !u!95 &7248900332013002442 Animator: serializedVersion: 3 @@ -1102,9 +1104,9 @@ SpriteRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 0 + m_SortingOrder: 60 m_Sprite: {fileID: -348202296468608855, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - m_Color: {r: 1, g: 1, b: 1, a: 0.4745098} + m_Color: {r: 1, g: 1, b: 1, a: 0.7019608} m_FlipX: 0 m_FlipY: 0 m_DrawMode: 0 @@ -12004,9 +12006,9 @@ SpriteRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 0 + m_SortingOrder: 60 m_Sprite: {fileID: -348202296468608855, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - m_Color: {r: 1, g: 1, b: 1, a: 0.4745098} + m_Color: {r: 1, g: 1, b: 1, a: 0.7019608} m_FlipX: 0 m_FlipY: 0 m_DrawMode: 0 @@ -12059,6 +12061,7 @@ GameObject: m_Component: - component: {fileID: 7248900333300803150} - component: {fileID: 7248900333300803151} + - component: {fileID: 5840347371021274451} m_Layer: 0 m_Name: karateman m_TagString: Untagged @@ -12112,12 +12115,44 @@ MonoBehaviour: - {fileID: -3530312539838775474, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: 8671423413994339737, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: -6341196331951941137, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} + BarrelSprites: + - {fileID: 6524922379630696755, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} + - {fileID: 1156572009758090512, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} + - {fileID: -7998309181045564909, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} + - {fileID: -7906004722935515527, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} + - {fileID: 5805539206011318834, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} BGSprites: - Sprites: - {fileID: -5244473057742839103, guid: 1fe78dfa0c2320546915f1f2b70c79a7, type: 3} - {fileID: 3927547596512374108, guid: 1fe78dfa0c2320546915f1f2b70c79a7, type: 3} - {fileID: 6723002177432063909, guid: 1fe78dfa0c2320546915f1f2b70c79a7, type: 3} BGSprite: {fileID: 7248900333330862853} +--- !u!61 &5840347371021274451 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7248900333300803145} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0.5021653, y: -5.3626747} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0, y: 0} + oldSize: {x: 0, y: 0} + newSize: {x: 0, y: 0} + adaptiveTilingThreshold: 0 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 19.024342, y: 3.0151978} + m_EdgeRadius: 0 --- !u!1 &7248900333330862855 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Resources/Sprites/Games/KarateMan/Animations/Bomb/Bomb.controller b/Assets/Resources/Sprites/Games/KarateMan/Animations/Bomb/Bomb.controller index 315e060f8..2ffe6d592 100644 --- a/Assets/Resources/Sprites/Games/KarateMan/Animations/Bomb/Bomb.controller +++ b/Assets/Resources/Sprites/Games/KarateMan/Animations/Bomb/Bomb.controller @@ -62,7 +62,7 @@ AnimatorState: m_StateMachineBehaviours: [] m_Position: {x: 50, y: 50, z: 0} m_IKOnFeet: 0 - m_WriteDefaultValues: 1 + m_WriteDefaultValues: 0 m_Mirror: 0 m_SpeedParameterActive: 0 m_MirrorParameterActive: 0 diff --git a/Assets/Resources/Sprites/Games/KarateMan/Animations/Bomb/BombHit.anim b/Assets/Resources/Sprites/Games/KarateMan/Animations/Bomb/BombHit.anim index be04abc45..176e21ad9 100644 --- a/Assets/Resources/Sprites/Games/KarateMan/Animations/Bomb/BombHit.anim +++ b/Assets/Resources/Sprites/Games/KarateMan/Animations/Bomb/BombHit.anim @@ -13,41 +13,7 @@ AnimationClip: m_UseHighQualityCurve: 1 m_RotationCurves: [] m_CompressedRotationCurves: [] - m_EulerCurves: - - curve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: {x: 0, y: 0, z: 0} - inSlope: {x: 0, y: 0, z: 0} - outSlope: {x: 0, y: 0, z: -594.75} - tangentMode: 0 - weightedMode: 0 - inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - - serializedVersion: 3 - time: 0.2 - value: {x: 0, y: 0, z: -118.95} - inSlope: {x: -0, y: -0, z: -594.75} - outSlope: {x: 0, y: 0, z: -285.62308} - tangentMode: 0 - weightedMode: 0 - inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - - serializedVersion: 3 - time: 1.5 - value: {x: 0, y: 0, z: -490.26} - inSlope: {x: -0, y: -0, z: -285.62308} - outSlope: {x: 0, y: 0, z: 0} - tangentMode: 0 - weightedMode: 0 - inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - path: BombHolder/BombRotHolder + m_EulerCurves: [] m_PositionCurves: - curve: serializedVersion: 2 @@ -71,7 +37,7 @@ AnimationClip: inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - serializedVersion: 3 - time: 1.5166667 + time: 1.5333333 value: {x: 3.572, y: 0.881, z: 0} inSlope: {x: 0, y: -5.3573384, z: 0} outSlope: {x: 0, y: -5.3573384, z: 0} @@ -122,22 +88,22 @@ AnimationClip: inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - serializedVersion: 3 - time: 0.96666664 + time: 1.1333333 value: {x: 0.23, y: 0.23, z: 1} - inSlope: {x: -0.13186815, y: -0.13186815, z: 0} - outSlope: {x: -0.13186815, y: -0.13186815, z: 0} + inSlope: {x: -0.55813956, y: -0.55813956, z: 0} + outSlope: {x: -0.55813956, y: -0.55813956, z: 0} tangentMode: 0 weightedMode: 0 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - serializedVersion: 3 - time: 1.5166667 - value: {x: 0.18, y: 0.18, z: 1} - inSlope: {x: 0, y: 0, z: 0} - outSlope: {x: 0, y: 0, z: 0} + time: 1.4333333 + value: {x: 0, y: 0, z: 1} + inSlope: {x: -0.81399375, y: -0.8134725, z: 0} + outSlope: {x: -0.81399375, y: -0.8134725, z: 0} tangentMode: 0 weightedMode: 0 - inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + inWeight: {x: 0.33685815, y: 0.35239553, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} m_PreInfinity: 2 m_PostInfinity: 2 @@ -156,8 +122,8 @@ AnimationClip: inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.036830254, y: 0.03882108, z: 0.33333334} - serializedVersion: 3 - time: 1.5166667 - value: {x: 0.18761705, y: 0.18761705, z: 0.18761703} + time: 1.6 + value: {x: 0, y: 0, z: 0.18761703} inSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0} tangentMode: 0 @@ -378,13 +344,6 @@ AnimationClip: typeID: 4 customType: 0 isPPtrCurve: 0 - - serializedVersion: 2 - path: 4092152953 - attribute: 4 - script: {fileID: 0} - typeID: 4 - customType: 4 - isPPtrCurve: 0 - serializedVersion: 2 path: 3441349904 attribute: 3 @@ -503,7 +462,7 @@ AnimationClip: m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseTime: 0 m_StartTime: 0 - m_StopTime: 1.5166667 + m_StopTime: 1.6 m_OrientationOffsetY: 0 m_Level: 0 m_CycleOffset: 0 @@ -541,7 +500,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 1.5166667 + time: 1.5333333 value: 3.572 inSlope: 0 outSlope: 0 @@ -578,7 +537,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 1.5166667 + time: 1.5333333 value: 0.881 inSlope: -5.3573384 outSlope: -5.3573384 @@ -615,7 +574,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 1.5166667 + time: 1.5333333 value: 0 inSlope: 0 outSlope: 0 @@ -630,117 +589,6 @@ AnimationClip: path: BombHolder classID: 4 script: {fileID: 0} - - curve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 69 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 0.2 - value: 0 - inSlope: -0 - outSlope: 0 - tangentMode: 69 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 1.5 - value: 0 - inSlope: -0 - outSlope: 0 - tangentMode: 69 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - attribute: localEulerAnglesRaw.x - path: BombHolder/BombRotHolder - classID: 4 - script: {fileID: 0} - - curve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 69 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 0.2 - value: 0 - inSlope: -0 - outSlope: 0 - tangentMode: 69 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 1.5 - value: 0 - inSlope: -0 - outSlope: 0 - tangentMode: 69 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - attribute: localEulerAnglesRaw.y - path: BombHolder/BombRotHolder - classID: 4 - script: {fileID: 0} - - curve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 0 - outSlope: -594.75 - tangentMode: 69 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 0.2 - value: -118.95 - inSlope: -594.75 - outSlope: -285.62308 - tangentMode: 69 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 1.5 - value: -490.26 - inSlope: -285.62308 - outSlope: 0 - tangentMode: 69 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - attribute: localEulerAnglesRaw.z - path: BombHolder/BombRotHolder - classID: 4 - script: {fileID: 0} - curve: serializedVersion: 2 m_Curve: @@ -754,22 +602,22 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.96666664 + time: 1.1333333 value: 0.23 - inSlope: -0.13186815 - outSlope: -0.13186815 + inSlope: -0.55813956 + outSlope: -0.55813956 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 1.5166667 - value: 0.18 - inSlope: 0 - outSlope: 0 - tangentMode: 136 + time: 1.4333333 + value: 0 + inSlope: -0.81399375 + outSlope: -0.81399375 + tangentMode: 0 weightedMode: 0 - inWeight: 0.33333334 + inWeight: 0.33685815 outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 @@ -791,22 +639,22 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.96666664 + time: 1.1333333 value: 0.23 - inSlope: -0.13186815 - outSlope: -0.13186815 + inSlope: -0.55813956 + outSlope: -0.55813956 tangentMode: 136 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 1.5166667 - value: 0.18 - inSlope: 0 - outSlope: 0 - tangentMode: 136 + time: 1.4333333 + value: 0 + inSlope: -0.8134725 + outSlope: -0.8134725 + tangentMode: 0 weightedMode: 0 - inWeight: 0.33333334 + inWeight: 0.35239553 outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 @@ -828,16 +676,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 0.96666664 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 1.5166667 + time: 1.1333333 value: 1 inSlope: 0 outSlope: 0 @@ -949,8 +788,8 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.036830254 - serializedVersion: 3 - time: 1.5166667 - value: 0.18761705 + time: 1.6 + value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 @@ -977,8 +816,8 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.03882108 - serializedVersion: 3 - time: 1.5166667 - value: 0.18761705 + time: 1.6 + value: 0 inSlope: 0 outSlope: 0 tangentMode: 136 @@ -1005,7 +844,7 @@ AnimationClip: inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 - time: 1.5166667 + time: 1.6 value: 0.18761703 inSlope: 0 outSlope: 0 @@ -1020,37 +859,7 @@ AnimationClip: path: Shadow classID: 4 script: {fileID: 0} - m_EulerEditorCurves: - - curve: - serializedVersion: 2 - m_Curve: [] - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - attribute: m_LocalEulerAngles.x - path: BombHolder/BombRotHolder - classID: 4 - script: {fileID: 0} - - curve: - serializedVersion: 2 - m_Curve: [] - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - attribute: m_LocalEulerAngles.y - path: BombHolder/BombRotHolder - classID: 4 - script: {fileID: 0} - - curve: - serializedVersion: 2 - m_Curve: [] - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - attribute: m_LocalEulerAngles.z - path: BombHolder/BombRotHolder - classID: 4 - script: {fileID: 0} + m_EulerEditorCurves: [] m_HasGenericRootTransform: 0 m_HasMotionFloatCurves: 0 m_Events: [] diff --git a/Assets/Resources/Sprites/Games/KarateMan/karateman_main.png b/Assets/Resources/Sprites/Games/KarateMan/karateman_main.png index 52ec41608..eef6547ee 100644 Binary files a/Assets/Resources/Sprites/Games/KarateMan/karateman_main.png and b/Assets/Resources/Sprites/Games/KarateMan/karateman_main.png differ diff --git a/Assets/Resources/Sprites/Games/KarateMan/karateman_main.png.meta b/Assets/Resources/Sprites/Games/KarateMan/karateman_main.png.meta index 82663c09d..5a0031153 100644 --- a/Assets/Resources/Sprites/Games/KarateMan/karateman_main.png.meta +++ b/Assets/Resources/Sprites/Games/KarateMan/karateman_main.png.meta @@ -128,6 +128,21 @@ TextureImporter: - first: 213: -678416614439994711 second: karateman_fastfx_1 + - first: + 213: 6524922379630696755 + second: karateman_barrelfx_0 + - first: + 213: 1156572009758090512 + second: karateman_barrelfx_1 + - first: + 213: -7998309181045564909 + second: karateman_barrelfx_2 + - first: + 213: -7906004722935515527 + second: karateman_barrelfx_3 + - first: + 213: 5805539206011318834 + second: karateman_barrelfx_4 externalObjects: {} serializedVersion: 11 mipmaps: @@ -1086,7 +1101,7 @@ TextureImporter: width: 856 height: 568 alignment: 0 - pivot: {x: 0, y: 0} + pivot: {x: 0.5, y: 0.5} border: {x: 0, y: 0, z: 0, w: 0} outline: [] physicsShape: [] @@ -1098,6 +1113,111 @@ TextureImporter: indices: edges: [] weights: [] + - serializedVersion: 2 + name: karateman_barrelfx_0 + rect: + serializedVersion: 2 + x: 1828 + y: 708 + width: 184 + height: 280 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 33952e0755e2d8a50800000000000000 + internalID: 6524922379630696755 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: karateman_barrelfx_1 + rect: + serializedVersion: 2 + x: 2020 + y: 708 + width: 184 + height: 280 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 0156ac67d18fc0010800000000000000 + internalID: 1156572009758090512 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: karateman_barrelfx_2 + rect: + serializedVersion: 2 + x: 2212 + y: 708 + width: 184 + height: 280 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 31a980c3d2c400190800000000000000 + internalID: -7998309181045564909 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: karateman_barrelfx_3 + rect: + serializedVersion: 2 + x: 2404 + y: 804 + width: 280 + height: 184 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 9763ed0a79a384290800000000000000 + internalID: -7906004722935515527 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: karateman_barrelfx_4 + rect: + serializedVersion: 2 + x: 2404 + y: 612 + width: 280 + height: 184 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 23278e7162b619050800000000000000 + internalID: 5805539206011318834 + vertices: [] + indices: + edges: [] + weights: [] outline: [] physicsShape: [] bones: [] diff --git a/Assets/Scenes/Game.unity b/Assets/Scenes/Game.unity index 7110ccbf6..182f480ff 100644 --- a/Assets/Scenes/Game.unity +++ b/Assets/Scenes/Game.unity @@ -476,7 +476,7 @@ AudioSource: m_Enabled: 1 serializedVersion: 4 OutputAudioMixerGroup: {fileID: 0} - m_audioClip: {fileID: 8300000, guid: 92cf585c80f8fb843964e525aef1406c, type: 3} + m_audioClip: {fileID: 8300000, guid: 5fc457d2d31969c44a6734ce4e684ff8, type: 3} m_PlayOnAwake: 0 m_Volume: 1 m_Pitch: 1 @@ -1835,7 +1835,7 @@ MonoBehaviour: playerEntities: [] currentEvent: 0 currentPlayerEvent: 0 - txt: {fileID: 4900000, guid: 4b7512c586e16a847a5b8490bf35e852, type: 3} + txt: {fileID: 4900000, guid: df453afcce54d5c4e9105c6829ed8f30, type: 3} startOffset: 0.5 GameCamera: {fileID: 519420031} CursorCam: {fileID: 79134728} diff --git a/Assets/Scripts/Games/KarateMan/BarrelDestroyEffect.cs b/Assets/Scripts/Games/KarateMan/BarrelDestroyEffect.cs new file mode 100644 index 000000000..81e994443 --- /dev/null +++ b/Assets/Scripts/Games/KarateMan/BarrelDestroyEffect.cs @@ -0,0 +1,48 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +using DG.Tweening; + +namespace RhythmHeavenMania.Games.KarateMan +{ + public class BarrelDestroyEffect : MonoBehaviour + { + private SpriteRenderer SpriteRenderer; + private Rigidbody2D rb2d; + public int spriteIndex; + + private void Start() + { + SpriteRenderer = this.gameObject.AddComponent(); + SpriteRenderer.sprite = KarateMan.instance.BarrelSprites[spriteIndex]; + + rb2d = this.gameObject.AddComponent(); + rb2d.gravityScale = 10; + // rb2d.interpolation = RigidbodyInterpolation2D.Interpolate; + + float randX = Random.Range(800, 1400); + + rb2d.AddForce(Vector3.up * Random.Range(900, 1666)); + rb2d.AddForce(Vector3.right * randX); + // this.gameObject.AddComponent().rotateSpeed = Random.Range(60, 450); + + BoxCollider2D col = this.gameObject.AddComponent(); + col.offset = new Vector2(-0.0574677f, -0.07480353f); + col.size = new Vector2(0.5694333f, 1.912059f); + + StartCoroutine(FadeOut()); + } + + private void Update() + { + this.transform.eulerAngles = new Vector3(0, 0, rb2d.velocity.magnitude * 4); + } + + private IEnumerator FadeOut() + { + yield return new WaitForSeconds(Conductor.instance.secPerBeat * 3); + SpriteRenderer.DOColor(new Color(1, 1, 1, 0), Conductor.instance.secPerBeat * 3).OnComplete(delegate { Destroy(this.gameObject); }); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Games/KarateMan/BarrelDestroyEffect.cs.meta b/Assets/Scripts/Games/KarateMan/BarrelDestroyEffect.cs.meta new file mode 100644 index 000000000..8f6bc1a9a --- /dev/null +++ b/Assets/Scripts/Games/KarateMan/BarrelDestroyEffect.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e9d184371fba53f4bad123485376f507 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Games/KarateMan/Bomb.cs b/Assets/Scripts/Games/KarateMan/Bomb.cs index 375c21ba8..ee20ba621 100644 --- a/Assets/Scripts/Games/KarateMan/Bomb.cs +++ b/Assets/Scripts/Games/KarateMan/Bomb.cs @@ -16,6 +16,9 @@ namespace RhythmHeavenMania.Games.KarateMan public bool kicked; private bool eligible; + public GameObject RotHolder; + private Vector3 lastRot; + private void Start() { anim = GetComponent(); @@ -41,6 +44,7 @@ namespace RhythmHeavenMania.Games.KarateMan { eligible = false; // explode animation + if (normalizedBeat > 4) Destroy(this.gameObject); } @@ -70,13 +74,18 @@ namespace RhythmHeavenMania.Games.KarateMan Destroy(this.gameObject); } } + + lastRot = RotHolder.transform.eulerAngles; } public void Hit() { + KarateJoe.instance.HitEffectF(new Vector3(0.9f, 2.0549f)); + Jukebox.PlayOneShotGame("karateman/bombKick"); hitBeat = Conductor.instance.songPositionInBeats; kicked = true; + RotHolder.transform.eulerAngles = lastRot; } } } \ No newline at end of file diff --git a/Assets/Scripts/Games/KarateMan/KarateJoe.cs b/Assets/Scripts/Games/KarateMan/KarateJoe.cs index c4d52880f..b328482aa 100644 --- a/Assets/Scripts/Games/KarateMan/KarateJoe.cs +++ b/Assets/Scripts/Games/KarateMan/KarateJoe.cs @@ -93,14 +93,12 @@ namespace RhythmHeavenMania.Games.KarateMan Jukebox.PlayOneShotGame(p.hitSnd); p.Hit(); - GameObject hit = Instantiate(HitEffect); - hit.transform.parent = HitEffect.transform.parent; - hit.SetActive(true); + HitEffectF(HitEffect.transform.localPosition); switch (p.type) { case 0: - HitParticle.Play(); + // HitParticle.Play(); break; case 1: GameObject bulbHit = Instantiate(BulbHit); @@ -109,15 +107,48 @@ namespace RhythmHeavenMania.Games.KarateMan Destroy(bulbHit, 0.7f); break; case 2: - RockParticle.Play(); + // RockParticle.Play(); break; case 4: if (kickC != null) StopCoroutine(kickC); kickC = StartCoroutine(PrepareKick()); + for (int i = 0; i < 8; i++) + { + GameObject be = new GameObject(); + be.transform.localPosition = p.transform.localPosition; + be.transform.parent = this.transform.parent; + BarrelDestroyEffect bde = be.AddComponent(); + + switch (i) + { + case 0: + bde.spriteIndex = 0; + break; + case 1: + bde.spriteIndex = 0; + break; + case 2: + bde.spriteIndex = 1; + break; + case 3: + bde.spriteIndex = 2; + break; + case 4: + bde.spriteIndex = 3; + break; + case 5: + bde.spriteIndex = 3; + break; + case 6: + bde.spriteIndex = 4; + break; + case 7: + bde.spriteIndex = 4; + break; + } + } break; } - - Destroy(hit, 0.04f); } else { @@ -136,5 +167,14 @@ namespace RhythmHeavenMania.Games.KarateMan else anim.Play("PunchRight", 0, 0); } + + public void HitEffectF(Vector3 pos) + { + GameObject hit = Instantiate(HitEffect); + hit.transform.parent = HitEffect.transform.parent; + hit.transform.localPosition = pos; + hit.SetActive(true); + Destroy(hit, 0.03f); + } } } \ No newline at end of file diff --git a/Assets/Scripts/Games/KarateMan/KarateMan.cs b/Assets/Scripts/Games/KarateMan/KarateMan.cs index 12c8e2767..51d8407a7 100644 --- a/Assets/Scripts/Games/KarateMan/KarateMan.cs +++ b/Assets/Scripts/Games/KarateMan/KarateMan.cs @@ -14,6 +14,7 @@ namespace RhythmHeavenMania.Games.KarateMan public static KarateMan instance { get; set; } public Sprite[] ObjectSprites; + public Sprite[] BarrelSprites; public List BGSprites; public SpriteRenderer BGSprite;