more abilities and fixes
This commit is contained in:
parent
cb4470f2d6
commit
fc2329a873
31 changed files with 268 additions and 52 deletions
|
|
@ -1,31 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Entity : MonoBehaviour
|
||||
{
|
||||
[Header("Stats")]
|
||||
public EntityStats stats;
|
||||
[Header("Cache")]
|
||||
public List<Entity> entitiesInRange = new();
|
||||
public Entity closestEntity;
|
||||
|
||||
public virtual void OnDeath()
|
||||
{
|
||||
|
||||
}
|
||||
protected void FlipSprite(Vector2 lookDirection)
|
||||
{
|
||||
if (lookDirection.x > 0f && stats.isFacingRight)
|
||||
{
|
||||
stats.sprite.flipX = true;
|
||||
stats.isFacingRight = !stats.isFacingRight;
|
||||
}
|
||||
else if (lookDirection.x < 0f && !stats.isFacingRight)
|
||||
{
|
||||
stats.sprite.flipX = false;
|
||||
stats.isFacingRight = !stats.isFacingRight;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue