movement, automated enemies, automated players, basic abilities
This commit is contained in:
parent
23576e137e
commit
f4344c4700
31 changed files with 4343 additions and 70 deletions
23
Assets/Scripts/AutoControlledEntity.cs
Normal file
23
Assets/Scripts/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