编队列表选中功能完善
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user