Merge branch 'main' into Dylan

This commit is contained in:
djkellerman
2025-01-20 18:04:37 -05:00
13 changed files with 2486 additions and 486 deletions

View File

@@ -1,6 +1,6 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1101 &-7951230361386602773
--- !u!1101 &-8088454279998633666
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
@@ -24,8 +24,8 @@ AnimatorStateTransition:
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 0
--- !u!1101 &-7336001256458513922
m_CanTransitionToSelf: 1
--- !u!1101 &-3289816270970516984
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
@@ -35,21 +35,46 @@ AnimatorStateTransition:
m_Conditions:
- m_ConditionMode: 6
m_ConditionEvent: state
m_EventTreshold: 2
m_EventTreshold: 1
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -65348665591799820}
m_DstState: {fileID: 2600039493493020915}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.2
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 0
m_CanTransitionToSelf: 1
--- !u!1101 &-3226116647278939360
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 6
m_ConditionEvent: state
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1699472617733096240}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.1
m_TransitionOffset: 0
m_ExitTime: 0.625
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1107 &-1538096663108953913
AnimatorStateMachine:
serializedVersion: 6
@@ -61,7 +86,7 @@ AnimatorStateMachine:
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 2600039493493020915}
m_Position: {x: 290, y: 0, z: 0}
m_Position: {x: 550, y: 0, z: 0}
- serializedVersion: 1
m_State: {fileID: -65348665591799820}
m_Position: {x: 290, y: 50, z: 0}
@@ -70,24 +95,19 @@ AnimatorStateMachine:
m_Position: {x: 290, y: -50, z: 0}
- serializedVersion: 1
m_State: {fileID: 4390441580030614539}
m_Position: {x: 325, y: 15, z: 0}
- serializedVersion: 1
m_State: {fileID: 8225265107180556939}
m_Position: {x: 360, y: 80, z: 0}
m_Position: {x: 60, y: 80, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions:
- {fileID: -7951230361386602773}
- {fileID: -325823806790880945}
- {fileID: -7336001256458513922}
- {fileID: 5263795009836994554}
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 80, y: 0, z: 0}
m_EntryPosition: {x: 540, y: 0, z: 0}
m_EntryPosition: {x: 890, y: 0, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 2600039493493020915}
--- !u!1101 &-325823806790880945
--- !u!1101 &-1491732674038617540
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
@@ -111,7 +131,32 @@ AnimatorStateTransition:
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 0
m_CanTransitionToSelf: 1
--- !u!1101 &-1027424570895581804
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 6
m_ConditionEvent: state
m_EventTreshold: 2
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -65348665591799820}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.2
m_TransitionOffset: 0
m_ExitTime: 0.625
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &-65348665591799820
AnimatorState:
serializedVersion: 6
@@ -122,7 +167,9 @@ AnimatorState:
m_Name: Jump
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_Transitions:
- {fileID: -1491732674038617540}
- {fileID: -3289816270970516984}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
@@ -153,6 +200,12 @@ AnimatorController:
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: punch
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 1
m_Controller: {fileID: 9100000}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
@@ -166,6 +219,31 @@ AnimatorController:
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1101 &1187931533429329025
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 6
m_ConditionEvent: state
m_EventTreshold: 2
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -65348665591799820}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.2
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &1699472617733096240
AnimatorState:
serializedVersion: 6
@@ -176,7 +254,9 @@ AnimatorState:
m_Name: Idle
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_Transitions:
- {fileID: -8088454279998633666}
- {fileID: 1187931533429329025}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
@@ -202,7 +282,9 @@ AnimatorState:
m_Name: Walk
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_Transitions:
- {fileID: -3226116647278939360}
- {fileID: -1027424570895581804}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
@@ -228,7 +310,8 @@ AnimatorState:
m_Name: TrevorPunch
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_Transitions:
- {fileID: 7801668757208663834}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
@@ -244,29 +327,50 @@ AnimatorState:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &8225265107180556939
AnimatorState:
serializedVersion: 6
--- !u!1101 &5263795009836994554
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Block
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 896bcaa1220cb294480528aa82dbc0e7, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: punch
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 4390441580030614539}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.05
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &7801668757208663834
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1699472617733096240}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.1
m_TransitionOffset: 0
m_ExitTime: 0.7972973
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1

File diff suppressed because it is too large Load Diff

View File

@@ -23,6 +23,15 @@
"interactions": "",
"initialStateCheck": false
},
{
"name": "Punch",
"type": "Button",
"id": "6fc12f4a-f346-4caf-a5f8-9d0f344122c3",
"expectedControlType": "",
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "Join",
"type": "Button",
@@ -122,10 +131,65 @@
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "Arrow Keys",
"id": "9173ff2d-9797-4ef9-bc5b-cee95168ec6e",
"path": "Dpad",
"interactions": "",
"processors": "",
"groups": "",
"action": "Move",
"isComposite": true,
"isPartOfComposite": false
},
{
"name": "up",
"id": "f3aa205f-a912-46ce-9018-4534b3d77ae9",
"path": "<Keyboard>/upArrow",
"interactions": "",
"processors": "",
"groups": ";Keyboard&Mouse",
"action": "Move",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "down",
"id": "7a97e1f5-1f55-46d9-9125-af294176511f",
"path": "<Keyboard>/downArrow",
"interactions": "",
"processors": "",
"groups": ";Keyboard&Mouse",
"action": "Move",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "left",
"id": "159cfd41-0d56-432e-b56c-34814abf49bb",
"path": "<Keyboard>/leftArrow",
"interactions": "",
"processors": "",
"groups": ";Keyboard&Mouse",
"action": "Move",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "right",
"id": "1a6aaa10-c994-4582-9e83-900289bd75da",
"path": "<Keyboard>/rightArrow",
"interactions": "",
"processors": "",
"groups": ";Keyboard&Mouse",
"action": "Move",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "",
"id": "6f8632d2-312f-4559-8fdd-d17a3c226436",
"path": "<Keyboard>/e",
"path": "<Keyboard>/space",
"interactions": "",
"processors": "",
"groups": ";Keyboard&Mouse",
@@ -165,6 +229,28 @@
"action": "Join",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "579f259d-1883-4fa5-bb3f-e564431fd795",
"path": "<Keyboard>/e",
"interactions": "",
"processors": "",
"groups": "",
"action": "Punch",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "b2af80b4-883d-4a96-982d-c1fa16fd900d",
"path": "<Gamepad>/buttonWest",
"interactions": "",
"processors": "",
"groups": "",
"action": "Punch",
"isComposite": false,
"isPartOfComposite": false
}
]
},

View File

@@ -12,6 +12,8 @@ GameObject:
- component: {fileID: 4642513082199340961}
- component: {fileID: 75167067980600170}
- component: {fileID: 6392580824388157607}
- component: {fileID: 5190430079571461372}
- component: {fileID: 2787587001401147982}
- component: {fileID: 5200627265685207284}
- component: {fileID: 1169583671018505929}
- component: {fileID: 2344147968324054325}
@@ -36,6 +38,8 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 5586015051149451479}
- {fileID: 2063840941502744053}
- {fileID: 7290594200745798336}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -54,9 +58,11 @@ MonoBehaviour:
ground:
serializedVersion: 2
m_Bits: 64
playerText: {fileID: 7508327662230183655}
walkSpeed: 5
walkSpeedFactor: 30
maxSpeed: 5
slowdownMultiplier: 40
virtualAxisX: 0
virtualButtonJump: 0
virtualButtonJumpLastFrame: 0
@@ -68,7 +74,6 @@ MonoBehaviour:
jumpLenience: 0.1
timeUnableToBeDeclaredNotJumping: 0.1
groundCheckDistance: 0.1
animate: 1
--- !u!114 &75167067980600170
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -99,6 +104,34 @@ MonoBehaviour:
state: 0
backwards: 0
clip: {fileID: 7400000, guid: 590f229c565f34c8296a875497c76553, type: 2}
--- !u!114 &5190430079571461372
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1375850422501237868}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9ae332d743f1a42ce8ee7a958853bcc1, type: 3}
m_Name:
m_EditorClassIdentifier:
cancelable: 1
hurtbox: {fileID: 2982388803569647282}
--- !u!114 &2787587001401147982
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1375850422501237868}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6bac5d744efb2eb40be2220da2d52b35, type: 3}
m_Name:
m_EditorClassIdentifier:
force: 200
damage: 0
--- !u!114 &5200627265685207284
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -250,13 +283,13 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1648017802882051395}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0.013222396, w: -0.9999126}
m_LocalRotation: {x: -0, y: -0, z: -0.33692652, w: -0.94153094}
m_LocalPosition: {x: 0, y: -0.5, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4818486997278545909}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 1.515}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 39.379}
--- !u!212 &5602021945915386438
SpriteRenderer:
m_ObjectHideFlags: 0
@@ -492,6 +525,108 @@ BoxCollider2D:
m_AutoTiling: 0
m_Size: {x: 0.0625, y: 0.5}
m_EdgeRadius: 0
--- !u!1 &1936916972718023967
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5586015051149451479}
- component: {fileID: 4734305610112586858}
- component: {fileID: 1520805838389731254}
- component: {fileID: 7345005991490873819}
m_Layer: 5
m_Name: Pentagon Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5586015051149451479
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1936916972718023967}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3619771033001887294}
m_Father: {fileID: 7009259675412950971}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!223 &4734305610112586858
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1936916972718023967}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 1
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_VertexColorAlwaysGammaSpace: 0
m_AdditionalShaderChannelsFlag: 25
m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!114 &1520805838389731254
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1936916972718023967}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 1920, y: 1080}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 1
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 0
--- !u!114 &7345005991490873819
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1936916972718023967}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!1 &3572452013539030063
GameObject:
m_ObjectHideFlags: 0
@@ -1195,13 +1330,13 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5600043765235685887}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalRotation: {x: -0, y: -0, z: 0.31969908, w: 0.9475191}
m_LocalPosition: {x: 0, y: -0.5, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3359136527054329610}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 180}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 37.289}
--- !u!212 &1263635959652575642
SpriteRenderer:
m_ObjectHideFlags: 0
@@ -1438,6 +1573,42 @@ BoxCollider2D:
m_AutoTiling: 0
m_Size: {x: 0.0625, y: 0.5}
m_EdgeRadius: 0
--- !u!1 &7049027663970876467
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3619771033001887294}
m_Layer: 5
m_Name: Pentagon
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3619771033001887294
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7049027663970876467}
m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 45.5, y: 45.5, z: 45.5}
m_ConstrainProportionsScale: 1
m_Children:
- {fileID: 8783822715394239814}
m_Father: {fileID: 5586015051149451479}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -29}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &7131227584641296005
GameObject:
m_ObjectHideFlags: 0
@@ -1573,3 +1744,217 @@ BoxCollider2D:
m_AutoTiling: 0
m_Size: {x: 0.0625, y: 0.5}
m_EdgeRadius: 0
--- !u!1 &7570979957438438421
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8783822715394239814}
- component: {fileID: 8381578833477757921}
- component: {fileID: 7508327662230183655}
m_Layer: 5
m_Name: Pong Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8783822715394239814
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7570979957438438421}
m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: -212.69974}
m_LocalScale: {x: 0.001, y: 0.001, z: 0.001}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 3619771033001887294}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -10.8496, y: 21.1539}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8381578833477757921
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7570979957438438421}
m_CullTransparentMesh: 1
--- !u!114 &7508327662230183655
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7570979957438438421}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 1
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: f4b6d771d01664138b2f3db447b45695, type: 2}
m_sharedMaterial: {fileID: 560944918044722035, guid: f4b6d771d01664138b2f3db447b45695, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &8302541871276031440
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2063840941502744053}
- component: {fileID: 2982388803569647282}
m_Layer: 0
m_Name: Punch Hurtbox
m_TagString: Punch Hurtbox
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2063840941502744053
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8302541871276031440}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 1.4, y: 0.3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7009259675412950971}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &2982388803569647282
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8302541871276031440}
m_Enabled: 0
serializedVersion: 3
m_Density: 1
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_ForceSendLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ForceReceiveLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ContactCaptureLayers:
serializedVersion: 2
m_Bits: 4294967295
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 1
m_UsedByEffector: 0
m_CompositeOperation: 0
m_CompositeOrder: 0
m_Offset: {x: 0.38033098, y: 0}
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
m_Size: {x: 2.750043, y: 1.2534463}
m_EdgeRadius: 0

View File

@@ -12279,6 +12279,84 @@ TilemapCollider2D:
m_MaximumTileChangeCount: 1000
m_ExtrusionFactor: 0
m_UseDelaunayMesh: 0
--- !u!1 &1335742585
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1335742587}
- component: {fileID: 1335742586}
m_Layer: 0
m_Name: Void 2
m_TagString: Platformer Hazard
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!61 &1335742586
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1335742585}
m_Enabled: 1
serializedVersion: 3
m_Density: 1
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_ForceSendLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ForceReceiveLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ContactCaptureLayers:
serializedVersion: 2
m_Bits: 4294967295
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 1
m_UsedByEffector: 0
m_CompositeOperation: 0
m_CompositeOrder: 0
m_Offset: {x: 0, y: 0}
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
m_Size: {x: 401.18524, y: 11.169355}
m_EdgeRadius: 0
--- !u!4 &1335742587
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1335742585}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 44, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1758254987
GameObject:
m_ObjectHideFlags: 0
@@ -12437,4 +12515,5 @@ SceneRoots:
- {fileID: 8682934954266721942}
- {fileID: 322321}
- {fileID: 1758254989}
- {fileID: 1335742587}
- {fileID: 804358387}

View File

@@ -28,4 +28,9 @@ public class AnimationPlayer : MonoBehaviour
{
this.state = state;
}
public void Punch()
{
animator.SetTrigger("punch");
}
}

View File

@@ -0,0 +1,37 @@
using UnityEngine;
[RequireComponent(typeof(Rigidbody2D))]
[RequireComponent(typeof(Collider2D))]
[RequireComponent(typeof(RespawnOnTriggerEnter))]
public class Damageable : MonoBehaviour
{
public float force = 50f;
public float damage = 0f;
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.gameObject.CompareTag("Punch Hurtbox"))
{
print($"{name}: Ouch");
Damage();
Recoil(collision.transform.parent.gameObject);
}
}
private void Recoil(GameObject damageSource)
{
GetComponent<Rigidbody2D>().AddForce(((transform.position - damageSource.transform.position).normalized + Vector3.up) * damage, ForceMode2D.Force);
//damageSource.transform.localScale *= 1.1f;
}
private void Damage()
{
damage += force;
}
public void ResetDamage()
{
damage = 0f;
//transform.localScale = Vector3.one;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6bac5d744efb2eb40be2220da2d52b35

View File

@@ -1,17 +1,26 @@
using System.Collections;
using TMPro;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.Tilemaps;
[RequireComponent(typeof(Rigidbody2D))]
[RequireComponent(typeof(BoxCollider2D))]
[RequireComponent(typeof(PlayerInput))]
[RequireComponent(typeof(AnimationPlayer))]
[RequireComponent(typeof(Punch))]
public class PlayerMovement : MonoBehaviour
{
[Header("Ground Layers")]
public LayerMask ground;
public TextMeshProUGUI playerText;
[Header("Movement")]
public float walkSpeed;
public float walkSpeedFactor = 1f;
public float maxSpeed = 5f;
public float slowdownMultiplier = 10f;
public float virtualAxisX;
public float virtualButtonJump;
public float virtualButtonJumpLastFrame;
@@ -27,6 +36,9 @@ public class PlayerMovement : MonoBehaviour
private Rigidbody2D body;
private BoxCollider2D collide;
private PlayerInput input;
private AnimationPlayer animationPlayer;
private Punch punch;
private bool jumpInputStillValid = false;
private float lastTimeJumpPressed;
@@ -38,9 +50,6 @@ public class PlayerMovement : MonoBehaviour
private float lastTimeOnGround;
public bool animate;
private AnimationPlayer animationPlayer;
private Vector3 positionLastFrame;
void Start()
@@ -50,7 +59,10 @@ public class PlayerMovement : MonoBehaviour
body = GetComponent<Rigidbody2D>();
collide = GetComponent<BoxCollider2D>();
input = GetComponent<PlayerInput>();
if (animate) animationPlayer = GetComponent<AnimationPlayer>();
animationPlayer = GetComponent<AnimationPlayer>();
punch = GetComponent<Punch>();
playerText.text = input.playerIndex.ToString();
}
private void Update()
@@ -71,7 +83,7 @@ public class PlayerMovement : MonoBehaviour
private void LateUpdate()
{
if (animate) Animate();
Animate();
}
private void Animate()
@@ -107,6 +119,8 @@ public class PlayerMovement : MonoBehaviour
private void Jump()
{
if (!punch.cancelable) return;
if (virtualButtonJumpLastFrame == 1f)
{
jumpInputStillValid = true;
@@ -146,19 +160,15 @@ public class PlayerMovement : MonoBehaviour
private void HorizontalMovement()
{
//body.linearVelocity = new Vector2(virtualAxisX * walkSpeed, body.linearVelocity.y);
if (!punch.cancelable) return;
body.AddForce(new Vector2(virtualAxisX * walkSpeed * walkSpeedFactor, 0), ForceMode2D.Force);
if (Mathf.Abs(body.linearVelocityX) >= maxSpeed)
{
body.linearVelocity = new Vector2(Mathf.Sign(body.linearVelocityX) * maxSpeed, body.linearVelocity.y);
body.AddForce(new Vector2(-Mathf.Sign(body.linearVelocityX) * (Mathf.Abs(body.linearVelocityX) - maxSpeed) * slowdownMultiplier, 0));
}
//if (!IsPhysicallyGrounded())
//{
body.linearVelocityX *= walkSmooth;
//}
if (transform.position == positionLastFrame && (input.actions.FindAction("Move").ReadValue<Vector2>().x == 0))
{
virtualAxisX = 0;
@@ -213,4 +223,9 @@ public class PlayerMovement : MonoBehaviour
boxCollider2D.bounds.center.y + (vertical * boxCollider2D.bounds.extents.y)
);
}
public void StopVelocity()
{
if (IsPhysicallyGrounded()) body.linearVelocity = Vector2.zero;
}
}

49
Assets/Scripts/Punch.cs Normal file
View File

@@ -0,0 +1,49 @@
using UnityEngine;
using UnityEngine.InputSystem;
[RequireComponent(typeof(PlayerMovement))]
[RequireComponent(typeof(PlayerInput))]
[RequireComponent(typeof(AnimationPlayer))]
public class Punch : MonoBehaviour
{
public bool cancelable = true;
[SerializeField] private BoxCollider2D hurtbox;
InputActionAsset actions;
private void Start()
{
actions = GetComponent<PlayerInput>().actions;
}
private void Update()
{
if (actions.FindAction("Punch").ReadValue<float>() == 1f)
{
if (!cancelable) return;
GetComponent<AnimationPlayer>().Punch();
DisableCancellation();
}
}
public void EnableHurtbox()
{
hurtbox.enabled = true;
}
public void DisableHurtbox()
{
hurtbox.enabled = false;
}
public void DisableCancellation()
{
cancelable = false;
}
public void EnableCancellation()
{
cancelable = true;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 9ae332d743f1a42ce8ee7a958853bcc1

View File

@@ -23,6 +23,10 @@ public class RespawnOnTriggerEnter : MonoBehaviour
{
rb.linearVelocity = Vector2.zero;
}
if (TryGetComponent<Damageable>(out var damageable))
{
damageable.ResetDamage();
}
}
}
}

View File

@@ -7,6 +7,7 @@ TagManager:
- Pong Goal
- Pong Paddle
- Platformer Hazard
- Punch Hurtbox
layers:
- Default
- TransparentFX