chore(): 删除所有冗余的代码和资源
This commit is contained in:
@@ -8,14 +8,11 @@ using Core;
|
||||
|
||||
namespace Gameplay.Player
|
||||
{
|
||||
public class PlayerController : MonoBehaviour, ICharacter
|
||||
public class PlayerController : MonoBehaviour
|
||||
{
|
||||
public int MaxHealth { get; set; } = 100;
|
||||
public int CurrentHealth { get; private set; }
|
||||
|
||||
[SerializeField] private CardBookData cardBookData;
|
||||
public CardBook MyCardBook { get; private set; }
|
||||
public List<Card> Cards { get; private set; }
|
||||
private int currentCardIndex = 0;
|
||||
|
||||
public bool IsFlight { get; private set; }
|
||||
@@ -23,25 +20,22 @@ namespace Gameplay.Player
|
||||
|
||||
private PlayerMoveController playerMoveController;
|
||||
private PlayerCameraController playerCameraController;
|
||||
public PlayerCardsController playerCardsController;
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
playerMoveController = GetComponent<PlayerMoveController>();
|
||||
playerCameraController = GetComponent<PlayerCameraController>();
|
||||
playerCardsController = GetComponent<PlayerCardsController>();
|
||||
|
||||
CurrentHealth = MaxHealth;
|
||||
MyCardBook = new CardBook(cardBookData);
|
||||
Cards = new List<Card>();
|
||||
|
||||
|
||||
ControllerLocator.Instance.Register(this);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Cards.Add(CardLoader.GetCardByID(1));
|
||||
Cards.Add(CardLoader.GetCardByID(2));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -58,43 +52,5 @@ namespace Gameplay.Player
|
||||
CurrentHealth = MaxHealth;
|
||||
}
|
||||
}
|
||||
|
||||
public void StartCombat()
|
||||
{
|
||||
Debug.Log("Player StartCombat");
|
||||
IsFlight = true;
|
||||
playerMoveController.SetSpeed(0.5f);
|
||||
|
||||
playerCardsController.GenerateCards(Cards);
|
||||
}
|
||||
|
||||
public void EndFlight()
|
||||
{
|
||||
Debug.Log("Player EndFlight");
|
||||
IsFlight = false;
|
||||
playerMoveController.ResetSpeed();
|
||||
|
||||
playerCardsController.ClearCards();
|
||||
}
|
||||
|
||||
public bool HasCardsLeft()
|
||||
{
|
||||
return currentCardIndex < Cards.Count;
|
||||
}
|
||||
|
||||
public Card GetNextCard()
|
||||
{
|
||||
if (!HasCardsLeft())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return Cards[currentCardIndex++];
|
||||
}
|
||||
|
||||
public void InitializeDeckCycle()
|
||||
{
|
||||
Cards = MyCardBook.GetCards().ToList();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user