44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class CharacterCardView : MonoBehaviour
|
|
{
|
|
public int characterID;
|
|
public string currentBoundaryLevel;
|
|
public GameObject charactCard;
|
|
public Image characterImage;
|
|
public Image levelIcon;
|
|
public Image occupationIcon;
|
|
public bool isSelected=false;
|
|
|
|
void Start()
|
|
{
|
|
charactCard=gameObject;
|
|
}
|
|
/// <summary>
|
|
/// 未在队中的卡点击后进入被操纵状态。若在队伍中默认进入已经入队状态
|
|
/// </summary>
|
|
public void beSelected()
|
|
{
|
|
if (!isSelected)
|
|
{
|
|
isSelected = true;
|
|
TeamManager.Instance.currentSelectedCharacterCard = new CharacterView(characterID, currentBoundaryLevel);
|
|
characterImage.color = new Color(0.5f, 0.5f, 0.5f,1);
|
|
}
|
|
else beUnSelected();
|
|
}
|
|
|
|
public void beUnSelected()
|
|
{
|
|
//还需要走TeamManager去掉此角色的队列信息
|
|
isSelected = false;
|
|
TeamManager.Instance.removeTeamCharacter(characterID);
|
|
characterImage.color = new Color(1f, 1f, 1f,1);
|
|
}
|
|
|
|
|
|
}
|