You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
using System.Collections ;
using System.Collections.Generic ;
using UnityEngine ;
using UnityEngine.EventSystems ;
public enum CardState
{
Library , Deck
}
public class ClickCard : MonoBehaviour , IPointerDownHandler
{
private DeckManager deckManager ;
public CardState state ;
// Start is called before the first frame update
void Start ( )
{
deckManager = GameObject . Find ( "DeckManager" ) . GetComponent < DeckManager > ( ) ;
//测试是否获取到deckmanager, 获取成功
//if (deckManager == null)
//{
// Debug.LogError("DeckManager not found!");
//}
//PlayerData = GameObject.Find("DataManager").GetComponent<PlayerData>();
}
// Update is called once per frame
void Update ( )
{
}
public void OnPointerDown ( PointerEventData eventData )
{
int id = this . GetComponent < CardDisplay > ( ) . card . id ;
//测试是否获取到id, 获取成功
//if (id == 0)
//{
// Debug.LogError("id not found!");
//}
deckManager . UpdateCard ( state , id ) ;
}
}