-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Functionally of EntityHurtboxManager.
- Loading branch information
1 parent
36e3dff
commit 8d7e273
Showing
6 changed files
with
161 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
Assets/CAF/Samples/TDAction/Scripts/Entities/Managers/EntityHurtboxManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using CAF.Combat; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using TDAction.Managers; | ||
using UnityEngine; | ||
|
||
namespace TDAction.Entities | ||
{ | ||
public class EntityHurtboxManager : CAF.Entities.EntityHurtboxManager | ||
{ | ||
protected override void SetHurtboxInfo(int groupID, int hurtboxIndex) | ||
{ | ||
|
||
} | ||
|
||
protected override Hurtbox CreateHurtbox() | ||
{ | ||
Hurtbox hurtbox; | ||
// Hurtbox in the pool. | ||
if(hurtboxPool.Count > 0) | ||
{ | ||
hurtbox = hurtboxPool[0]; | ||
hurtboxPool.RemoveAt(0); | ||
} | ||
else | ||
{ | ||
hurtbox = GameObject.Instantiate(GameManager.instance.hurtboxPrefab, gameObject.transform, false); | ||
} | ||
hurtbox.gameObject.SetActive(false); | ||
return hurtbox; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/CAF/Samples/TDAction/Scripts/Entities/Managers/EntityHurtboxManager.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters