more abilities and fixes
This commit is contained in:
parent
cb4470f2d6
commit
fc2329a873
31 changed files with 268 additions and 52 deletions
23
Assets/Scripts/Entities/AutoControlledEntity.cs
Normal file
23
Assets/Scripts/Entities/AutoControlledEntity.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class AutoControlledEntity : Entity
|
||||
{
|
||||
[Header("Movement AI")]
|
||||
[SerializeField] protected float maxTargettingRange;
|
||||
[SerializeField] protected float maxHeightDifference;
|
||||
[SerializeField] protected float minTargetJumpDistance;
|
||||
[SerializeField] protected Transform[] wallDetectors;
|
||||
[SerializeField] protected LayerMask wallLayer;
|
||||
|
||||
protected bool DetectWalls()
|
||||
{
|
||||
foreach (Transform wallDetector in wallDetectors)
|
||||
{
|
||||
if (Physics2D.OverlapCircle(wallDetector.position, 0.05f, wallLayer))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue