加入测试样例,初步完善队列信息——视图转换
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
//适用于编队 列表
|
||||
public class teamCharacterView : MonoBehaviour
|
||||
{
|
||||
public GameObject character;
|
||||
public GameObject controlButton;
|
||||
public Image levelIcon;
|
||||
public Image charcterImg;
|
||||
public TMP_Text skillName;
|
||||
|
||||
public GameObject isLeader;
|
||||
public GameObject notLeader;
|
||||
|
||||
public bool isSelected =false;
|
||||
public int listIndex;
|
||||
|
||||
void Start()
|
||||
{
|
||||
character = gameObject;
|
||||
levelIcon.sprite=null;
|
||||
charcterImg.sprite=null;
|
||||
controlButton.SetActive(isSelected);
|
||||
}
|
||||
/// <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);
|
||||
}
|
||||
/// <summary>
|
||||
/// 将当前队伍选中角色向下交换位置
|
||||
/// </summary>
|
||||
public void downChangeTeamElementIndex()
|
||||
{
|
||||
if (this.isSelected == false) return;
|
||||
if(this.listIndex == teamSettingPanel.Instance.teamElementsObj.Length-1) return;
|
||||
TeamManager.Instance.swapTeamElements(this.listIndex,this.listIndex+1);
|
||||
}
|
||||
/// <summary>
|
||||
/// 将当前队伍选中角色向上交换位置
|
||||
/// </summary>
|
||||
public void upChangeTeamElementIndex()
|
||||
{
|
||||
if (this.isSelected == false) return;
|
||||
if (this.listIndex == 0) return;
|
||||
TeamManager.Instance.swapTeamElements(this.listIndex, this.listIndex - 1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user