Skip to content

Commit

Permalink
refactor: Removed unused Hitbox overrides.
Browse files Browse the repository at this point in the history
OnHurt overrides were making the event not get called.
  • Loading branch information
christides11 committed Aug 18, 2020
1 parent 795e789 commit 59676c7
Show file tree
Hide file tree
Showing 18 changed files with 297 additions and 28 deletions.
1 change: 0 additions & 1 deletion Assets/CAF/Combat/Boxes/Hitbox2D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace CAF.Combat
{
public class Hitbox2D : Hitbox
{
public override event Hitbox.HurtAction OnHurt;

protected Collider2D coll;

Expand Down
2 changes: 0 additions & 2 deletions Assets/CAF/Combat/Boxes/Hitbox3D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ namespace CAF.Combat
{
public class Hitbox3D : Hitbox
{
public override event Hitbox.HurtAction OnHurt;

protected Collider coll;

public override void Initialize(GameObject owner, Transform directionOwner, BoxShapes shape,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,55 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-5309879101736589152
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5cf4d5189da6b334e93745642899b7ca, type: 3}
m_Name: Ground_AA
m_EditorClassIdentifier:
graph: {fileID: 11400000}
position: {x: -8, y: -88}
ports:
keys:
- lastNode
- nextNode
values:
- _fieldName: lastNode
_node: {fileID: -5309879101736589152}
_typeQualifiedName: CAF.Combat.MovesetAttackNode, CAF, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
connections:
- fieldName: nextNode 0
node: {fileID: 4997239229425092478}
reroutePoints: []
_direction: 0
_connectionType: 0
_typeConstraint: 0
_dynamic: 0
- _fieldName: nextNode
_node: {fileID: -5309879101736589152}
_typeQualifiedName: System.Collections.Generic.List`1[[CAF.Combat.MovesetAttackNode+nextNodeDefinition,
CAF, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089
connections: []
_direction: 1
_connectionType: 0
_typeConstraint: 0
_dynamic: 0
lastNode: {fileID: 4997239229425092478}
executeInputs:
- inputType: 0
buttonID: 3
stickDirection: {x: 0, y: 0}
directionDeviation: 0
inputSequence: []
attackDefinition: {fileID: 11400000, guid: 2e0abd68fbe37d246b9fe3a7446475be, type: 2}
nextNode: []
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
Expand All @@ -14,6 +64,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
nodes:
- {fileID: 4997239229425092478}
- {fileID: -5309879101736589152}
groundAttackCommandNormals: []
groundAttackStartNodes:
- {fileID: 4997239229425092478}
Expand All @@ -37,6 +88,7 @@ MonoBehaviour:
keys:
- lastNode
- nextNode
- nextNode 0
values:
- _fieldName: lastNode
_node: {fileID: 4997239229425092478}
Expand All @@ -57,6 +109,18 @@ MonoBehaviour:
_connectionType: 0
_typeConstraint: 0
_dynamic: 0
- _fieldName: nextNode 0
_node: {fileID: 4997239229425092478}
_typeQualifiedName: CAF.Combat.MovesetAttackNode+nextNodeDefinition, CAF, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
connections:
- fieldName: lastNode
node: {fileID: -5309879101736589152}
reroutePoints: []
_direction: 1
_connectionType: 0
_typeConstraint: 0
_dynamic: 1
lastNode: {fileID: 0}
executeInputs:
- inputType: 0
Expand All @@ -65,4 +129,6 @@ MonoBehaviour:
directionDeviation: 0
inputSequence: []
attackDefinition: {fileID: 11400000, guid: 6b5af3166b563264a9461e1318fee445, type: 2}
nextNode: []
nextNode:
- cancelWindow: {x: 9, y: 60}
node: {fileID: -5309879101736589152}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ MonoBehaviour:
boxes:
- shape: 0
offset: {x: 1, y: 0, z: 0}
size: {x: 4, y: 4, z: 0}
size: {x: 2, y: 2.2, z: 0}
rotation: {x: 0, y: 0, z: 0}
radius: 0
height: 0
Expand Down Expand Up @@ -77,8 +77,8 @@ MonoBehaviour:
damageOnHit: 0
damageOnBlock: 0
causesTumble: 0
opponentForceMagnitude: 0.2
opponentForceDir: {x: 1, y: 1, z: 0}
opponentForceMagnitude: 0.05
opponentForceDir: {x: 1, y: 0, z: 0}
forceIncludeYForce: 0
opponentMaxMagnitude: 1
opponentMinMagnitude: 1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b727ab7513f07da4ab8ca7d2f6d52cc9, type: 3}
m_Name: Ground_AA
m_EditorClassIdentifier:
attackName: Ground AA
description:
stateOverride: -1
length: 30
heightRestriction: 0
gravityScaleAdded: 0
animationGround: {fileID: 0}
animationAir: {fileID: 0}
wrapMode: 0
jumpCancelWindows: []
enemyStepWindows: []
landCancelWindows: []
commandAttackCancelWindows: []
chargeWindows: []
boxGroups:
- id: 0
events: []
references:
version: 1
00000000:
type: {class: BoxGroup, ns: CAF.Combat, asm: CAF}
data:
ID: 0
activeFramesStart: 5
activeFramesEnd: 8
hitGroupType: 0
boxes:
- shape: 0
offset: {x: 1, y: 0, z: 0}
size: {x: 3, y: 2.2, z: 0}
rotation: {x: 0, y: 0, z: 0}
radius: 0
height: 0
attachToEntity: 1
styleGain: 1
chargeLevelNeeded: -1
chargeLevelMax: 1
hitboxHitInfo:
id: 1
00000001:
type: {class: HitInfo, ns: CAF.Combat, asm: CAF}
data:
airOnly: 0
groundOnly: 0
hitKills: 1
continuousHit: 0
spaceBetweenHits: 0
opponentResetXForce: 1
opponentResetYForce: 1
attackerHitstop: 4
hitstop: 4
hitstun: 30
forceType: 0
forceRelation: 1
breakArmor: 0
unblockable: 0
knockdown: 0
groundBounces: 0
groundBounceForce: 0
wallBounces: 0
wallBounceForce: 0
damageOnHit: 0
damageOnBlock: 0
causesTumble: 0
opponentForceMagnitude: 0.1
opponentForceDir: {x: 1, y: 0, z: 1}
forceIncludeYForce: 0
opponentMaxMagnitude: 1
opponentMinMagnitude: 1
throwConfirm: {fileID: 0}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b727ab7513f07da4ab8ca7d2f6d52cc9, type: 3}
m_Name: Ground_AAA
m_EditorClassIdentifier:
attackName: Ground AAA
description:
stateOverride: -1
length: 30
heightRestriction: 0
gravityScaleAdded: 0
animationGround: {fileID: 0}
animationAir: {fileID: 0}
wrapMode: 0
jumpCancelWindows: []
enemyStepWindows: []
landCancelWindows: []
commandAttackCancelWindows: []
chargeWindows: []
boxGroups:
- id: 0
events: []
references:
version: 1
00000000:
type: {class: BoxGroup, ns: CAF.Combat, asm: CAF}
data:
ID: 0
activeFramesStart: 5
activeFramesEnd: 8
hitGroupType: 0
boxes:
- shape: 0
offset: {x: 1, y: 0, z: 0}
size: {x: 3, y: 2.2, z: 0}
rotation: {x: 0, y: 0, z: 0}
radius: 0
height: 0
attachToEntity: 1
styleGain: 1
chargeLevelNeeded: -1
chargeLevelMax: 1
hitboxHitInfo:
id: 1
00000001:
type: {class: HitInfo, ns: CAF.Combat, asm: CAF}
data:
airOnly: 0
groundOnly: 0
hitKills: 1
continuousHit: 0
spaceBetweenHits: 0
opponentResetXForce: 1
opponentResetYForce: 1
attackerHitstop: 4
hitstop: 4
hitstun: 30
forceType: 0
forceRelation: 1
breakArmor: 0
unblockable: 0
knockdown: 0
groundBounces: 0
groundBounceForce: 0
wallBounces: 0
wallBounceForce: 0
damageOnHit: 0
damageOnBlock: 0
causesTumble: 0
opponentForceMagnitude: 0.25
opponentForceDir: {x: 1, y: 0, z: 1}
forceIncludeYForce: 0
opponentMaxMagnitude: 1
opponentMinMagnitude: 1
throwConfirm: {fileID: 0}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Assets/CAF/Samples/TDAction/Scenes/PlayScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,11 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6667267786158460213, guid: 566a2b9082a19f54d9a11fabf7eb2be8,
type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 566a2b9082a19f54d9a11fabf7eb2be8, type: 3}
--- !u!114 &647645933 stripped
Expand Down
12 changes: 0 additions & 12 deletions Assets/CAF/Samples/TDAction/Scripts/Camera/CameraHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,6 @@ namespace TDAction.Camera
public class CameraHandler : MonoBehaviour
{
[SerializeField] private CinemachineVirtualCamera followCamera;

// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{

}

public void SetFollowTarget(Transform target)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected override Vector3 GetHitboxPosition(BoxDefinition hitboxDefinition)

protected override Quaternion GetHitboxRotation(BoxDefinition hitboxDefinition)
{
return Quaternion.Euler(manager.visual.transform.eulerAngles
return Quaternion.Euler(new Vector3(0, 0, manager.visual.transform.localScale.x < 0 ? 180 : 0)
+ hitboxDefinition.rotation);
}
}
Expand Down
9 changes: 9 additions & 0 deletions Assets/CAF/Samples/TDAction/Scripts/Managers/BootLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

namespace TDAction.Managers
{
/// <summary>
/// Handles initializing the game.
/// This is the first script that runs when the game is started.
/// </summary>
public class BootLoader : MonoBehaviour
{
public delegate void EmptyAction();
Expand All @@ -17,6 +21,7 @@ private void Awake()
{
OnPlaySceneLoaded += StartGame;

// Play scene is already loaded.
if (SceneManager.GetSceneByName(playScene).IsValid())
{
OnPlaySceneLoaded.Invoke();
Expand All @@ -30,6 +35,10 @@ private void StartGame()
gameManager.SetupGame();
}

/// <summary>
/// Loads the play scene and sets it as the active one.
/// </summary>
/// <returns></returns>
IEnumerator LoadPlayScene()
{
var ls = SceneManager.LoadSceneAsync(playScene, LoadSceneMode.Additive);
Expand Down
Loading

0 comments on commit 59676c7

Please sign in to comment.