trotFunky
42706712aa
Fixed abstract character not depleting energy when reaching zero Created prefabs for player and enemy bullets Added physics layers for players and enemies
31 lines
742 B
C#
31 lines
742 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class PlayerCharacter : AbstractCharacter
|
|
{
|
|
public override void Move(Vector2 movementDirection)
|
|
{
|
|
// TODO : Implement limits
|
|
_mover.Direction = movementDirection;
|
|
}
|
|
|
|
public override void Shoot()
|
|
{
|
|
_isShooting = true;
|
|
if (!_isDepleted && _shooter.Shoot(CurrentEnergy))
|
|
{
|
|
CurrentEnergy -= _shooter.EnergyCost;
|
|
}
|
|
else if (_isDepleted)
|
|
{
|
|
// Force regen when depleted even if holding the trigger
|
|
_isShooting = false;
|
|
}
|
|
}
|
|
|
|
protected override void Death()
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|