56 lines
1.3 KiB
C#
56 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Gameplay;
|
|
using Interface;
|
|
using UnityEngine;
|
|
using Core;
|
|
|
|
namespace Gameplay.Player
|
|
{
|
|
public class PlayerController : MonoBehaviour
|
|
{
|
|
public int MaxHealth { get; set; } = 100;
|
|
public int CurrentHealth { get; private set; }
|
|
|
|
private int currentCardIndex = 0;
|
|
|
|
public bool IsFlight { get; private set; }
|
|
public bool IsDead { get; private set; }
|
|
|
|
private PlayerMoveController playerMoveController;
|
|
private PlayerCameraController playerCameraController;
|
|
|
|
|
|
private void Awake()
|
|
{
|
|
playerMoveController = GetComponent<PlayerMoveController>();
|
|
playerCameraController = GetComponent<PlayerCameraController>();
|
|
|
|
CurrentHealth = MaxHealth;
|
|
|
|
|
|
ControllerLocator.Instance.Register(this);
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
|
|
|
|
}
|
|
|
|
public void TakeDamage(int damage)
|
|
{
|
|
CurrentHealth -= damage;
|
|
}
|
|
|
|
public void Heal(int heal)
|
|
{
|
|
CurrentHealth += heal;
|
|
if (CurrentHealth > MaxHealth)
|
|
{
|
|
CurrentHealth = MaxHealth;
|
|
}
|
|
}
|
|
}
|
|
} |