队伍角色添加、快速更换新位置完善
This commit is contained in:
@@ -4176,6 +4176,18 @@ MonoBehaviour:
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
- m_Target: {fileID: 1221530203}
|
||||
m_TargetAssemblyTypeName: teamCharacterView, Assembly-CSharp
|
||||
m_MethodName: ResetTeamCharacter
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!1 &495389257
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -5259,6 +5271,18 @@ MonoBehaviour:
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
- m_Target: {fileID: 826634049}
|
||||
m_TargetAssemblyTypeName: teamCharacterView, Assembly-CSharp
|
||||
m_MethodName: ResetTeamCharacter
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!1 &587893952
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -12637,6 +12661,18 @@ MonoBehaviour:
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
- m_Target: {fileID: 973852809}
|
||||
m_TargetAssemblyTypeName: teamCharacterView, Assembly-CSharp
|
||||
m_MethodName: ResetTeamCharacter
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!1 &1235967462
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -15193,7 +15229,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
teamSettingPanelInstance: {fileID: 16906201}
|
||||
currentSelectedTeam: 0
|
||||
currentSelectedCharacter: -1
|
||||
currentSelectedTeamCharacter: -1
|
||||
--- !u!4 &1593528874
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -17697,6 +17733,18 @@ MonoBehaviour:
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
- m_Target: {fileID: 847674721}
|
||||
m_TargetAssemblyTypeName: teamCharacterView, Assembly-CSharp
|
||||
m_MethodName: ResetTeamCharacter
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!1 &1805718607
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -19538,6 +19586,18 @@ MonoBehaviour:
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
- m_Target: {fileID: 1712599091}
|
||||
m_TargetAssemblyTypeName: teamCharacterView, Assembly-CSharp
|
||||
m_MethodName: ResetTeamCharacter
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!1 &1975772328
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -11,6 +11,7 @@ GameObject:
|
||||
- component: {fileID: 6315701630504864621}
|
||||
- component: {fileID: 757764593157214466}
|
||||
- component: {fileID: 1068789348870044308}
|
||||
- component: {fileID: 6566757192153613853}
|
||||
m_Layer: 5
|
||||
m_Name: characterImage
|
||||
m_TagString: Untagged
|
||||
@@ -58,7 +59,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0.9647059}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
@@ -75,6 +76,62 @@ MonoBehaviour:
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &6566757192153613853
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 38698292104120276}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 0}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 8280925871269614134}
|
||||
m_TargetAssemblyTypeName: CharacterCardView, Assembly-CSharp
|
||||
m_MethodName: beSelected
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!1 &227430959558785920
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -203,6 +260,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
characterID: 0
|
||||
currentBoundaryLevel:
|
||||
charactCard: {fileID: 2949374534111508497}
|
||||
characterImage: {fileID: 1068789348870044308}
|
||||
levelIcon: {fileID: 2921092759260112579}
|
||||
|
||||
@@ -6,15 +6,38 @@ using UnityEngine.UI;
|
||||
public class CharacterCardView : MonoBehaviour
|
||||
{
|
||||
public int characterID;
|
||||
public string currentBoundaryLevel;
|
||||
public GameObject charactCard;
|
||||
public Image characterImage;
|
||||
public Image levelIcon;
|
||||
public Image occupationIcon;
|
||||
public bool isSelected=false;
|
||||
|
||||
void Start()
|
||||
{
|
||||
charactCard=gameObject;
|
||||
}
|
||||
/// <summary>
|
||||
/// 未在队中的卡点击后进入被操纵状态。若在队伍中默认进入已经入队状态
|
||||
/// </summary>
|
||||
public void beSelected()
|
||||
{
|
||||
if (!isSelected)
|
||||
{
|
||||
isSelected = true;
|
||||
TeamManager.Instance.currentSelectedCharacterCard = new CharacterView(characterID, currentBoundaryLevel);
|
||||
characterImage.color = new Color(0.5f, 0.5f, 0.5f,1);
|
||||
}
|
||||
else beUnSelected();
|
||||
}
|
||||
|
||||
public void beUnSelected()
|
||||
{
|
||||
//还需要走TeamManager去掉此角色的队列信息
|
||||
isSelected = false;
|
||||
TeamManager.Instance.removeTeamCharacter(characterID);
|
||||
characterImage.color = new Color(1f, 1f, 1f,1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.Collections;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
public class TeamManager : MonoBehaviour
|
||||
{
|
||||
@@ -24,7 +25,11 @@ public class TeamManager : MonoBehaviour
|
||||
/// <summary>
|
||||
/// 记录被选中的编队中角色的索引,用于处理队列位置交换的逻辑。-1表示无角色被选中
|
||||
/// </summary>
|
||||
public int currentSelectedCharacter = -1;
|
||||
public int currentSelectedTeamCharacter = -1;
|
||||
/// <summary>
|
||||
/// 标记要被放入编队的角色
|
||||
/// </summary>
|
||||
public CharacterView currentSelectedCharacterCard = null;
|
||||
/// <summary>
|
||||
/// 在修改被选中的编队中角色的索引时触发
|
||||
/// </summary>
|
||||
@@ -50,8 +55,6 @@ public class TeamManager : MonoBehaviour
|
||||
{
|
||||
SelectableCharacterList.Add(new CharacterView(1001001,"C"));
|
||||
SelectableCharacterList.Add(new CharacterView(1001002,"S"));
|
||||
SelectableCharacterList.Add(new CharacterView(1001001,"C"));
|
||||
SelectableCharacterList.Add(new CharacterView(1001002,"C"));
|
||||
|
||||
//手动向currentTeamSettings和SelectableCharacterList添加测试数据
|
||||
currentTeamSettings.Add(0,new TeamSetting(new List<CharacterView>(),1001001));
|
||||
@@ -59,7 +62,7 @@ public class TeamManager : MonoBehaviour
|
||||
currentTeamSettings[0].teamIdList.Add(new CharacterView(1001002,"S"));
|
||||
currentTeamSettings[0].teamIdList.Add(new CharacterView(1001001,"C"));
|
||||
currentTeamSettings[0].teamIdList.Add( new CharacterView(1001002,"C"));
|
||||
currentTeamSettings[0].teamIdList.Add(new CharacterView(-1,null));
|
||||
currentTeamSettings[0].teamIdList.Add(new CharacterView(0,null));
|
||||
|
||||
currentTeamSettings.Add(1,new TeamSetting(new List<CharacterView>(),1001002));
|
||||
currentTeamSettings[1].teamIdList.Add(new CharacterView(1001001,"C"));
|
||||
@@ -67,9 +70,20 @@ public class TeamManager : MonoBehaviour
|
||||
currentTeamSettings[1].teamIdList.Add(new CharacterView(1001001,"C"));
|
||||
currentTeamSettings[1].teamIdList.Add( new CharacterView(1001002,"A"));
|
||||
currentTeamSettings[1].teamIdList.Add(new CharacterView(1001002,"A"));
|
||||
|
||||
//在当前版本中,就算是空队伍也要用如下填满,请等待数据结构的重构
|
||||
currentTeamSettings.Add(2,new TeamSetting(new List<CharacterView>(),-1));
|
||||
currentTeamSettings[2].teamIdList.Add(new CharacterView(0,null));
|
||||
currentTeamSettings[2].teamIdList.Add(new CharacterView(0,null));
|
||||
currentTeamSettings[2].teamIdList.Add(new CharacterView(0,null));
|
||||
currentTeamSettings[2].teamIdList.Add( new CharacterView(0,null));
|
||||
currentTeamSettings[2].teamIdList.Add(new CharacterView(0,null));
|
||||
|
||||
currentTeamSettings.Add(3,new TeamSetting(new List<CharacterView>(),-1));
|
||||
currentTeamSettings[3].teamIdList.Add(new CharacterView(0,null));
|
||||
currentTeamSettings[3].teamIdList.Add(new CharacterView(0,null));
|
||||
currentTeamSettings[3].teamIdList.Add(new CharacterView(0,null));
|
||||
currentTeamSettings[3].teamIdList.Add( new CharacterView(0,null));
|
||||
currentTeamSettings[3].teamIdList.Add(new CharacterView(0,null));
|
||||
|
||||
|
||||
Debug.Log("testTeamSetting ready");
|
||||
@@ -94,6 +108,10 @@ public class TeamManager : MonoBehaviour
|
||||
// }
|
||||
testTeamSetting();//接入玩家存档后请注释掉此行
|
||||
}
|
||||
void saveTeamSetting()
|
||||
{
|
||||
//todo:我想,在接存档系统的时候这个会有用。
|
||||
}
|
||||
/// <summary>
|
||||
/// 读取玩家存档信息后可直接在此写入编队信息
|
||||
/// </summary>
|
||||
@@ -117,10 +135,10 @@ public class TeamManager : MonoBehaviour
|
||||
}
|
||||
public void setCurrentSelectedCharacterInTeam(int characterIndex)
|
||||
{
|
||||
if (characterIndex != currentSelectedCharacter)
|
||||
if (characterIndex != currentSelectedTeamCharacter)
|
||||
{
|
||||
Debug.Log($"修改选中对象从{currentSelectedCharacter}到{characterIndex}");
|
||||
currentSelectedCharacter = characterIndex;
|
||||
Debug.Log($"修改选中对象从{currentSelectedTeamCharacter}到{characterIndex}");
|
||||
currentSelectedTeamCharacter = characterIndex;
|
||||
OnSelectedCharacterChanged?.Invoke(); // 触发事件
|
||||
}
|
||||
}
|
||||
@@ -148,13 +166,68 @@ public class TeamManager : MonoBehaviour
|
||||
currentTeamSettings[currentSelectedTeam].teamIdList = newCurrentTeam;
|
||||
teamSettingPanelInstance.updateTeamSettingElements();
|
||||
setCurrentSelectedCharacterInTeam(secondIndex);
|
||||
Debug.Log($"swapTeamElements done,当前选中的为{getCurrentSelectedTeam().teamIdList[currentSelectedCharacter].characterId},开始位置是{firstIndex},目标位置是{secondIndex},现在{currentSelectedCharacter}");
|
||||
|
||||
}
|
||||
|
||||
public void setTeamLeader(int characterIndex)
|
||||
public void setTeamLeader(int characterID)
|
||||
{
|
||||
getCurrentSelectedTeam().LeaderId = SelectableCharacterList[characterIndex].characterId;
|
||||
Debug.Log($"{characterID},{SelectableCharacterList.Count}");
|
||||
currentTeamSettings[currentSelectedTeam].LeaderId=characterID;
|
||||
teamSettingPanelInstance.updateTeamSettingElements();
|
||||
}
|
||||
/// <summary>
|
||||
/// 填入或者覆盖队伍指定位置的信息
|
||||
/// </summary>
|
||||
/// <param name="aimListIndex"></param>
|
||||
public void ResetTeamCharacter (int aimListIndex)
|
||||
{
|
||||
//如果在队伍中已有角色的情况下再次触发此方法,首先要去掉旧信息,再放新信息
|
||||
CharacterView newCharacter = currentSelectedCharacterCard;
|
||||
List<CharacterView> newCurrentTeam = getCurrentSelectedTeam().teamIdList;
|
||||
|
||||
if (aimListIndex > 0 || aimListIndex < newCurrentTeam.Count)
|
||||
{
|
||||
for(int i=0;i<newCurrentTeam.Count;i++)
|
||||
{
|
||||
if (newCurrentTeam[i].characterId == newCharacter.characterId && aimListIndex != i)//满足此条件为更换角色的队伍位置
|
||||
{
|
||||
//说明是在更换角色所在的位置下标,旧角色,位置置空
|
||||
newCurrentTeam[aimListIndex] = newCharacter;
|
||||
CharacterView characterView = new CharacterView(0, null);
|
||||
newCurrentTeam[i] = characterView;
|
||||
currentTeamSettings[currentSelectedTeam].teamIdList = newCurrentTeam;
|
||||
teamSettingPanelInstance.updateTeamSettingElements();
|
||||
return;
|
||||
}
|
||||
else if (newCurrentTeam[i].characterId == newCharacter.characterId && aimListIndex == i)
|
||||
{
|
||||
//原地点击操作,不做任何操作
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
newCurrentTeam[aimListIndex] = newCharacter;
|
||||
currentTeamSettings[currentSelectedTeam].teamIdList = newCurrentTeam;
|
||||
teamSettingPanelInstance.updateTeamSettingElements();
|
||||
}
|
||||
/// <summary>
|
||||
/// 移除队伍中的指定角色
|
||||
/// </summary>
|
||||
/// <param name="characterID"></param>
|
||||
public void removeTeamCharacter(int characterId)
|
||||
{
|
||||
currentSelectedCharacterCard = null;
|
||||
List<CharacterView> newCurrentTeam = getCurrentSelectedTeam().teamIdList;
|
||||
foreach (CharacterView character in newCurrentTeam)
|
||||
{
|
||||
if (character.characterId == characterId)
|
||||
{
|
||||
character.characterId = 0;
|
||||
character.currentBoundaryLevel = null;
|
||||
}
|
||||
}
|
||||
currentTeamSettings[currentSelectedTeam].teamIdList = newCurrentTeam;
|
||||
teamSettingPanelInstance.updateTeamSettingElements();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class teamCharacterView : MonoBehaviour
|
||||
{
|
||||
isSelected = false;
|
||||
controlButton.SetActive(false);
|
||||
if(TeamManager.Instance.currentSelectedCharacter==this.listIndex)
|
||||
if(TeamManager.Instance.currentSelectedTeamCharacter==this.listIndex)
|
||||
TeamManager.Instance.setCurrentSelectedCharacterInTeam(-1);
|
||||
}
|
||||
/// <summary>
|
||||
@@ -67,9 +67,18 @@ public class teamCharacterView : MonoBehaviour
|
||||
}
|
||||
public void setLeader()
|
||||
{
|
||||
TeamManager.Instance.setTeamLeader(this.listIndex);
|
||||
if(characterID==0){return;}
|
||||
TeamManager.Instance.setTeamLeader(this.characterID);
|
||||
isLeader.SetActive(true);
|
||||
notLeader.SetActive(false);
|
||||
}
|
||||
|
||||
public void ResetTeamCharacter()
|
||||
{
|
||||
if (TeamManager.Instance.currentSelectedCharacterCard != null)
|
||||
{
|
||||
TeamManager.Instance.ResetTeamCharacter(this.listIndex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ public class teamSettingPanel : MonoBehaviour
|
||||
|
||||
teamManager.OnSelectedTeamChanged += updateTeamSettingSelectedStatus;
|
||||
teamManager.OnSelectedTeamChanged += updateTeamSettingElements;
|
||||
teamManager.OnSelectedTeamChanged += updateSelectableCharacterViewList;
|
||||
}
|
||||
updateTeamSettingElements();
|
||||
updateSelectableCharacterViewList();
|
||||
@@ -79,6 +80,7 @@ public class teamSettingPanel : MonoBehaviour
|
||||
|
||||
teamManager.OnSelectedTeamChanged -= updateTeamSettingSelectedStatus;
|
||||
teamManager.OnSelectedTeamChanged -= updateTeamSettingElements;
|
||||
teamManager.OnSelectedTeamChanged -= updateSelectableCharacterViewList;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@@ -156,11 +158,6 @@ public class teamSettingPanel : MonoBehaviour
|
||||
{
|
||||
TeamSetting currentSelectedTeam = teamManager.getCurrentSelectedTeam();
|
||||
List<CharacterView> currentTeam = currentSelectedTeam.teamIdList;
|
||||
// if(currentTeam==null||currentTeam.Count==0)
|
||||
// {
|
||||
// clearTeamSettingElements();
|
||||
// return;
|
||||
// }
|
||||
clearTeamSettingElements();
|
||||
for (int i = 0; i < teamElementsObj.Length && i < currentTeam.Count; i++)
|
||||
{
|
||||
@@ -192,7 +189,6 @@ public class teamSettingPanel : MonoBehaviour
|
||||
|
||||
if(currentSelectedTeam.LeaderId==currentTeam[i].characterId)
|
||||
{
|
||||
Debug.Log($"当前队长为{currentTeam[i].characterId} {currentTeam[i].currentBoundaryLevel},存档信息为{currentSelectedTeam.LeaderId}");
|
||||
t.isLeader.SetActive(true);
|
||||
t.notLeader.SetActive(false);
|
||||
}
|
||||
@@ -214,6 +210,9 @@ public class teamSettingPanel : MonoBehaviour
|
||||
{
|
||||
Destroy(child.gameObject);
|
||||
}
|
||||
|
||||
teamManager.currentSelectedCharacterCard = null;
|
||||
List<CharacterView> currentTeam = teamManager.getCurrentSelectedTeam().teamIdList;
|
||||
List<CharacterView> selectAbleCharacters = teamManager.SelectableCharacterList;
|
||||
foreach (CharacterView c in selectAbleCharacters) //id and level
|
||||
{
|
||||
@@ -223,19 +222,34 @@ public class teamSettingPanel : MonoBehaviour
|
||||
if (ccv != null&& tcdi!=null)
|
||||
{
|
||||
ccv.characterID = tcdi.CharacterID;
|
||||
ccv.currentBoundaryLevel= c.currentBoundaryLevel;
|
||||
ccv.characterImage.sprite =tcdi.CharacterCardSprite;
|
||||
ccv.levelIcon.sprite = getLevelSprite(c.currentBoundaryLevel);
|
||||
ccv.occupationIcon.sprite = tcdi.CharacterRoleSprite;
|
||||
}
|
||||
|
||||
if (checkExistenceStatus(currentTeam, ccv.characterID))
|
||||
{
|
||||
ccv.isSelected = true;
|
||||
ccv.characterImage.color = new Color(0.5f, 0.5f, 0.5f,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
private bool checkExistenceStatus(List<CharacterView> currentTeam,int characterID)
|
||||
{
|
||||
foreach (CharacterView c in currentTeam)
|
||||
{
|
||||
if (c.characterId == characterID)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// 用于保证team内对象的选中状态一致
|
||||
/// </summary>
|
||||
public void updateTeamCharacterSelectedStatus()
|
||||
{
|
||||
int currentSelectedCharacter = teamManager.currentSelectedCharacter;
|
||||
Debug.Log($"当前选择为{currentSelectedCharacter}");
|
||||
int currentSelectedCharacter = teamManager.currentSelectedTeamCharacter;
|
||||
for (int i = 0; i < teamElementsObj.Length; i++)
|
||||
{
|
||||
if (i != currentSelectedCharacter)
|
||||
@@ -291,10 +305,7 @@ public class teamSettingPanel : MonoBehaviour
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 若玩家更换了team成员或调整了team成员顺序,则使用此方法更新view
|
||||
/// </summary>
|
||||
public void updateTeamStatus()
|
||||
public void updateCharacter()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user