36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
//适用于编队 列表
|
|
public class teamCharacterView : MonoBehaviour
|
|
{
|
|
public GameObject character;
|
|
public GameObject controlButton;
|
|
public bool isSelected =false;
|
|
public int listIndex;
|
|
// private TeamManager teamManager= TeamManager.Instance;
|
|
|
|
void Start()
|
|
{
|
|
controlButton.SetActive(isSelected);
|
|
Debug.Log("teamCharacterView Start,"+isSelected+","+listIndex);
|
|
}
|
|
/// <summary>
|
|
/// 单机team列表内对象时触发选定
|
|
/// </summary>
|
|
public void SetSelected()
|
|
{
|
|
isSelected = true;
|
|
controlButton.SetActive(true);
|
|
TeamManager.Instance.setCurrentSelectedCharacterInTeam(listIndex);
|
|
}
|
|
public void SetUnSelected()
|
|
{
|
|
isSelected = false;
|
|
controlButton.SetActive(false);
|
|
if(TeamManager.Instance.currentSelectedCharacter==this.listIndex)
|
|
TeamManager.Instance.setCurrentSelectedCharacterInTeam(-1);
|
|
}
|
|
}
|