feat():大改前的提交,这个版本保存了所有冗余的代码

This commit is contained in:
2025-10-17 15:10:19 +08:00
parent 668bfe12eb
commit 3d03c59dc3
68 changed files with 2045 additions and 159 deletions

View File

@@ -1,23 +1,62 @@
using System;
using UnityEngine;
using UnityEngine.UI;
using Interface;
using Core;
using Gameplay.Player;
namespace Gameplay
{
public class CardViewer : MonoBehaviour
public class CardViewer : MonoBehaviour, IInteractable
{
public Card Card;
[SerializeField] private MeshRenderer meshRenderer;
[SerializeField] private MeshRenderer frontMeshRenderer;
[SerializeField] private MeshRenderer backMeshRenderer;
[SerializeField] private Text cardNameText;
[SerializeField] private Text cardDescriptionText;
public void Setup(Card card)
private PlayerController _playerController;
private void Start()
{
ControllerLocator.Instance.TryGet<PlayerController>(out _playerController);
}
public void SetCard(Card card)
{
Card = card;
meshRenderer.material.mainTexture = card.Texture;
if (frontMeshRenderer != null && card.FrontTexture != null)
{
frontMeshRenderer.material.mainTexture = card.FrontTexture;
}
if (backMeshRenderer != null && card.BackTexture != null)
{
backMeshRenderer.material.mainTexture = card.BackTexture;
}
cardNameText.text = card.CardName;
cardDescriptionText.text = card.CardDescription;
}
}
}
public string GetInteractPrompt()
{
return "";
}
public void Interact(GameObject interactor)
{
}
public void OnGazeEnter(GameObject editor)
{
if(_playerController != null) _playerController.playerCardsController.StopRotatingCards();
}
public void OnGazeExit(GameObject editor)
{
if (_playerController != null) _playerController.playerCardsController.StartRotatingCards();
}
}
}