编队列表选中功能完善

This commit is contained in:
2025-06-08 23:16:07 +08:00
parent 4cedd7c17b
commit adac8dfe04
8 changed files with 268 additions and 30 deletions
@@ -0,0 +1,35 @@
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);
}
}