79 lines
1.8 KiB
C#
79 lines
1.8 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using System.Collections;
|
|
using Games.GlobeDefine;
|
|
using GCGame.Table;
|
|
|
|
public class TeamTargetItem : UISubMenuItem
|
|
{
|
|
public GameObject _TargetGO;
|
|
|
|
private int _MissionID;
|
|
|
|
public override void InitMenu(object obj)
|
|
{
|
|
_MenuObj = obj;
|
|
|
|
if (_MenuObj is string)
|
|
{
|
|
_MenuText.text = _MenuObj as string;
|
|
if(_HLMenuText != null)
|
|
{
|
|
_HLMenuText.text = _MenuText.text;
|
|
}
|
|
}
|
|
else if (_MenuObj is Tab_TeamTarget)
|
|
{
|
|
_MenuText.text = (_MenuObj as Tab_TeamTarget).Name;
|
|
if (_HLMenuText != null)
|
|
{
|
|
_HLMenuText.text = _MenuText.text;
|
|
}
|
|
}
|
|
_SelectGO.SetActive(false);
|
|
|
|
UpdateTargetGO();
|
|
}
|
|
|
|
public override void OnItemClick()
|
|
{
|
|
base.OnItemClick();
|
|
}
|
|
|
|
public override void Refresh()
|
|
{
|
|
base.Refresh();
|
|
|
|
UpdateTargetGO();
|
|
}
|
|
|
|
private void UpdateTargetGO()
|
|
{
|
|
if (_TargetGO == null)
|
|
return;
|
|
|
|
_TargetGO.SetActive(false);
|
|
Tab_TeamTarget tartTab = TableManager.GetTeamTargetByID(GameManager.gameManager.PlayerDataPool.TeamInfo.AutoTeamTargetDest, 0);
|
|
if (tartTab == null)
|
|
return;
|
|
|
|
//if (GameManager.gameManager.PlayerDataPool.TeamInfo.IsAutoTeam)
|
|
{
|
|
if (_MenuObj is string)
|
|
{
|
|
if (tartTab.ClassName == _MenuObj as string)
|
|
{
|
|
_TargetGO.SetActive(true);
|
|
}
|
|
}
|
|
else if (_MenuObj is Tab_TeamTarget)
|
|
{
|
|
if (tartTab.Id == (_MenuObj as Tab_TeamTarget).Id)
|
|
{
|
|
_TargetGO.SetActive(true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|