调整编队页面UI组件结构,完善更新ui视图方法
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using utils;
|
||||
|
||||
public class teamSettingPanel : MonoBehaviour
|
||||
{
|
||||
@@ -13,6 +14,7 @@ public class teamSettingPanel : MonoBehaviour
|
||||
|
||||
private TeamManager teamManager;
|
||||
|
||||
|
||||
public static teamSettingPanel Instance{get;private set;}
|
||||
|
||||
void Awake()
|
||||
@@ -54,11 +56,21 @@ public class teamSettingPanel : MonoBehaviour
|
||||
public void updateTeamSettingElements()
|
||||
{
|
||||
//todo:向保存编队信息的类获取编队信息,然后重新处理teamElementsObj的信息
|
||||
List<Character> currentTeam = teamManager.getCurrentTeam();
|
||||
// foreach (Character character in currentTeam)
|
||||
// {
|
||||
//
|
||||
// }
|
||||
List<Character> currentTeam = teamManager.getCurrentSelectedTeam();
|
||||
for (int i = 0; i < teamElementsObj.Length && i < currentTeam.Count; i++)
|
||||
{
|
||||
if(teamElementsObj[i]!=null && currentTeam[i]!=null)
|
||||
{
|
||||
teamCharacterView t = teamElementsObj[i].GetComponent<teamCharacterView>();
|
||||
if(t!=null)
|
||||
{
|
||||
t.charcterImg.sprite = FileUtils.getImage("TeamCharacters/TeamCharacterImg/" + currentTeam[i].name);
|
||||
t.levelIcon.sprite = FileUtils.getImage("TeamCharacters/levelIcon/level" + currentTeam[i].boundaryLevel);
|
||||
t.isLeader.SetActive(currentTeam[i].isLeader);
|
||||
t.notLeader.SetActive(!currentTeam[i].isLeader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user