1059 lines
30 KiB
C#
1059 lines
30 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using GCGame.Table;
|
|
using Games.Item;
|
|
|
|
public class GuideStepUpdate : GuideStepBase
|
|
{
|
|
|
|
#region attrs
|
|
|
|
public enum GUIDE_UI_PATH
|
|
{
|
|
Path,
|
|
Function,
|
|
MissionDialog,
|
|
BackPack,
|
|
EquipToolTip,
|
|
ItemToolTip,
|
|
SkillClass,
|
|
SkillItem,
|
|
EnhanceEquip,
|
|
Activity,
|
|
MarketItem,
|
|
DailyWelfare,
|
|
AutoMedic,
|
|
UIDisapear,
|
|
DialogOption,
|
|
FubenPage,
|
|
Welfare,
|
|
LiveSkill,
|
|
LiveSkillItem,
|
|
WaitTextChange,
|
|
AutoUse,
|
|
TeamTag
|
|
}
|
|
|
|
public GUIDE_UI_PATH UIPath;
|
|
public string[] PathParam;
|
|
public Vector2 ClickArea;
|
|
|
|
protected bool _HoldUI = false;
|
|
protected bool _ShowedGuide = false;
|
|
|
|
protected int[] _IntParam;
|
|
protected int[] IntParam
|
|
{
|
|
get
|
|
{
|
|
if (_IntParam == null)
|
|
{
|
|
_IntParam = new int[PathParam.Length];
|
|
for (int i = 0; i < PathParam.Length; ++i)
|
|
{
|
|
_IntParam[i] = int.Parse(PathParam[i]);
|
|
}
|
|
}
|
|
return _IntParam;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region base
|
|
|
|
public override void StartGuideStep()
|
|
{
|
|
base.StartGuideStep();
|
|
|
|
_HoldUI = false;
|
|
_ShowedGuide = false;
|
|
_GuideUIGO = null;
|
|
_GuideUIImagePath = new System.Collections.Generic.List<string>();
|
|
|
|
if (GuideType == GUIDE_OPT_TYPE.ForceOpt)
|
|
{
|
|
GuideLogic.Instance().SetForceBackActive(true);
|
|
}
|
|
else if (GuideType == GUIDE_OPT_TYPE.ClickClose)
|
|
{
|
|
GuideLogic.Instance().SetClickBack();
|
|
}
|
|
else
|
|
{
|
|
GuideLogic.Instance().SetForceBackActive(false);
|
|
}
|
|
|
|
_UpdateStart = Time.time;
|
|
}
|
|
|
|
public override void FinishGuideStep()
|
|
{
|
|
base.FinishGuideStep();
|
|
}
|
|
|
|
public override void StopGuideStep()
|
|
{
|
|
if (GuideType != GUIDE_OPT_TYPE.ForceOpt)
|
|
{
|
|
GuideLogic.Instance().SetForceBackActive(false);
|
|
}
|
|
else if (GuideType == GUIDE_OPT_TYPE.ClickClose)
|
|
{
|
|
GuideLogic.Instance().SetClickBack();
|
|
}
|
|
else
|
|
{
|
|
GuideLogic.Instance()._Back.GetComponent<Image>().raycastTarget = false;
|
|
}
|
|
GuideLogic.Instance()._GuideInfo.gameObject.SetActive(false);
|
|
if (_CopyGuideGO != null)
|
|
{
|
|
_CopyGuideGO.SetActive(false);
|
|
GameObject.Destroy(_CopyGuideGO, 0.1f);
|
|
GuideLogic.Instance().HideEffect();
|
|
}
|
|
_EquipItem = null;
|
|
_GuideSkillInfo = null;
|
|
base.StopGuideStep();
|
|
}
|
|
|
|
#endregion
|
|
|
|
float _UpdateLast = 5.6f;
|
|
float _UpdateStart = 0;
|
|
|
|
void Update()
|
|
{
|
|
if (_GuideUIGO == null && !_HoldUI)
|
|
{
|
|
TryGetGuideUIGO();
|
|
}
|
|
|
|
if ((_GuideUIGO == null)&& _HoldUI)
|
|
{
|
|
if (UIPath == GUIDE_UI_PATH.UIDisapear)
|
|
{
|
|
FinishGuideStep();
|
|
}
|
|
else
|
|
{
|
|
StopGuideStep();
|
|
BelongGuideItem.ReStart();
|
|
_UpdateStart = 0;
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (_GuideUIGO != null)
|
|
{
|
|
//if (!_GuideUIGO.activeInHierarchy)
|
|
//{
|
|
// StopGuideStep();
|
|
// _UpdateStart = 0;
|
|
// return;
|
|
//}
|
|
|
|
FitCopyPos();
|
|
if (!_ShowedGuide)
|
|
{
|
|
ShowGuide();
|
|
_ShowedGuide = true;
|
|
}
|
|
_UpdateStart = 0;
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
if (Time.time - _UpdateStart > _UpdateLast)
|
|
{
|
|
StopGuideStep();
|
|
BelongGuideItem.FinishGuide();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//特殊的,指引到扩展功能,但是功能缩进了
|
|
if (_GuideUIGO != null)
|
|
{
|
|
bool isInFuncEx = false;
|
|
if (PathParam.Length > 1)
|
|
{
|
|
isInFuncEx = true;
|
|
}
|
|
if (isInFuncEx &&
|
|
!PathParam[0].Equals("OpenDetailButton") &&
|
|
!FunctionExLogic.Instance()._IsBtnShow)
|
|
{
|
|
StopGuideStep();
|
|
BelongGuideItem.FinishGuide();
|
|
}
|
|
}
|
|
}
|
|
|
|
#region getGuideUI
|
|
|
|
private void GetGuideMissionDialog()
|
|
{
|
|
int missionID = int.Parse(PathParam[0]);
|
|
if (MissionDialogAndLeftTabsLogic.Instance())
|
|
{
|
|
MissionDialogAndLeftTabsLogic.Instance()._MissionContainer.ForeachActiveItem<MissionItemLogic>((missionItem) =>
|
|
{
|
|
if (missionItem.MissionID == missionID)
|
|
{
|
|
_GuideUIGO = missionItem.gameObject;
|
|
_HoldUI = true;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
private void GetGuideFunction()
|
|
{
|
|
bool isInFuncEx = false;
|
|
if (PathParam.Length > 1)
|
|
{
|
|
isInFuncEx = true;
|
|
}
|
|
if (!isInFuncEx)
|
|
{
|
|
if (FunctionButtonLogic.Instance())
|
|
{
|
|
var guideGO = FunctionButtonLogic.Instance().transform.Find(PathParam[0]);
|
|
if (guideGO == null)
|
|
return;
|
|
|
|
if (PathParam[0].Contains("ButtonBack"))
|
|
{
|
|
if (BackPackLogic.Instance())
|
|
{
|
|
FinishGuideStep();
|
|
return;
|
|
}
|
|
}
|
|
|
|
GCGame.Utils.ShowMainTopRightUI();
|
|
|
|
if (PathParam[0].Contains("OpenDetailButton"))
|
|
{
|
|
if (!guideGO.gameObject.activeSelf)
|
|
{
|
|
FinishGuideStep();
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (PathParam[0].Contains("BtnSkill"))
|
|
{
|
|
if (SkillRootLogic.Instance())
|
|
{
|
|
FinishGuideStep();
|
|
return;
|
|
}
|
|
}
|
|
|
|
_GuideUIGO = guideGO.gameObject;
|
|
_HoldUI = true;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (FunctionExLogic.Instance())
|
|
{
|
|
GameObject guideGO = null;
|
|
|
|
if (PathParam[0].Equals("OpenDetailButton"))
|
|
{
|
|
guideGO = FunctionExLogic.Instance()._OpenBtn;
|
|
}
|
|
else if(FunctionExLogic.Instance()._IsBtnShow)
|
|
{
|
|
guideGO = FunctionExLogic.Instance().GetBtn(PathParam[0]);
|
|
}
|
|
|
|
if (guideGO == null)
|
|
return;
|
|
|
|
if (PathParam[0].Contains("ButtonBack"))
|
|
{
|
|
if (BackPackLogic.Instance())
|
|
{
|
|
FinishGuideStep();
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (PathParam[0].Contains("OpenDetailButton"))
|
|
{
|
|
if (FunctionExLogic.Instance()._IsBtnShow)
|
|
{
|
|
FinishGuideStep();
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (PathParam[0].Contains("BtnSkill"))
|
|
{
|
|
if (SkillRootLogic.Instance())
|
|
{
|
|
FinishGuideStep();
|
|
return;
|
|
}
|
|
}
|
|
|
|
_GuideUIGO = guideGO.gameObject;
|
|
_HoldUI = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
private GameItem _EquipItem;
|
|
private void GetGuideEquip()
|
|
{
|
|
if (_EquipItem == null)
|
|
{
|
|
var backItems = GameManager.gameManager.PlayerDataPool.BackPack.GetList();
|
|
foreach (var backItem in backItems)
|
|
{
|
|
if (!backItem.IsValid())
|
|
continue;
|
|
|
|
if (!backItem.IsEquipMent())
|
|
continue;
|
|
|
|
for (int i = 0; i < IntParam.Length; ++i)
|
|
{
|
|
if (backItem.DataID == IntParam[i])
|
|
{
|
|
_EquipItem = backItem;
|
|
break;
|
|
}
|
|
if (_EquipItem != null)
|
|
break;
|
|
}
|
|
|
|
}
|
|
if (_EquipItem == null)
|
|
{
|
|
BelongGuideItem.FinishGuide();
|
|
return;
|
|
}
|
|
}
|
|
|
|
if(_EquipItem != null)
|
|
{
|
|
if (BackPackLogic.Instance() && BackPackLogic.Instance()._SellInfoPanel.activeInHierarchy == false)
|
|
{
|
|
BackPackLogic.Instance()._ItemsContainer.ForeachActiveItem<CommonItemBackPackItem>((backPackItem) =>
|
|
{
|
|
if (backPackItem._ItemBackPack.GameItem == null)
|
|
return;
|
|
|
|
//if (backPackItem._ItemSlot._ItemImg.sprite == null)
|
|
// return;
|
|
|
|
if (backPackItem._ItemBackPack.GameItem == _EquipItem)
|
|
{
|
|
_GuideUIGO = backPackItem.gameObject;
|
|
_GuideUIImagePath.Add("CommonItemSlot/Icon");
|
|
_GuideUIImagePath.Add("CommonItemSlot/Quality");
|
|
_HoldUI = true;
|
|
}
|
|
});
|
|
}
|
|
else if (BackPackLogic.Instance() && BackPackLogic.Instance()._SellInfoPanel.activeInHierarchy == true)
|
|
{
|
|
BelongGuideItem.FinishGuide();
|
|
}
|
|
}
|
|
}
|
|
|
|
private void GetGuideItem()
|
|
{
|
|
int itemID = int.Parse(PathParam[0]);
|
|
if (_EquipItem == null)
|
|
{
|
|
var backItems = GameManager.gameManager.PlayerDataPool.BackPack.GetList();
|
|
foreach (var backItem in backItems)
|
|
{
|
|
if (backItem.DataID == itemID)
|
|
{
|
|
_EquipItem = backItem;
|
|
break;
|
|
}
|
|
}
|
|
if (_EquipItem == null)
|
|
{
|
|
BelongGuideItem.FinishGuide();
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (BackPackLogic.Instance() && BackPackLogic.Instance()._SellInfoPanel.activeInHierarchy == false)
|
|
{
|
|
CommonItemBackPackItem selectedItem = null;
|
|
BackPackLogic.Instance()._ItemsContainer.ForeachActiveItem<CommonItemBackPackItem>((backPackItem) =>
|
|
{
|
|
if (backPackItem._ItemBackPack.GameItem == null)
|
|
return;
|
|
|
|
if (backPackItem._ItemSlot._ItemImg.sprite == null)
|
|
return;
|
|
|
|
if (backPackItem._ItemBackPack.GameItem.DataID == itemID)
|
|
{
|
|
_GuideUIGO = backPackItem.gameObject;
|
|
_GuideUIImagePath.Add("CommonItemSlot/Icon");
|
|
_GuideUIImagePath.Add("CommonItemSlot/Quality");
|
|
_HoldUI = true;
|
|
selectedItem = backPackItem;
|
|
}
|
|
});
|
|
|
|
if (selectedItem != null)
|
|
{
|
|
BackPackLogic.Instance()._ItemsContainer.ShowContainerPos(selectedItem);
|
|
}
|
|
}
|
|
else if (BackPackLogic.Instance() && BackPackLogic.Instance()._SellInfoPanel.activeInHierarchy == true)
|
|
{
|
|
BelongGuideItem.FinishGuide();
|
|
}
|
|
}
|
|
|
|
private void AutoUseItem()
|
|
{
|
|
int itemID = int.Parse(PathParam[0]);
|
|
GameItemContainer BackPack = GameManager.gameManager.PlayerDataPool.BackPack;
|
|
var useItem = BackPack.GetItemByDataID(itemID);
|
|
if (useItem != null)
|
|
{
|
|
Singleton<ObjManager>.Instance.MainPlayer.UseItem(useItem);
|
|
FinishGuideStep();
|
|
}
|
|
}
|
|
|
|
private void TeamTag()
|
|
{
|
|
if (MissionDialogAndLeftTabsLogic.Instance())
|
|
{
|
|
if (!MissionDialogAndLeftTabsLogic.Instance().IsShowPanel)
|
|
{
|
|
MissionDialogAndLeftTabsLogic.Instance().ShowPanel();
|
|
}
|
|
}
|
|
|
|
FinishGuideStep();
|
|
}
|
|
|
|
private void GetGuideEquipTool()
|
|
{
|
|
if (EquipTooltipsLogic.Instance())
|
|
{
|
|
int btnIdx = int.Parse(PathParam[0]);
|
|
if (EquipTooltipsLogic.Instance()._PopMenu.SubBtns.Count > btnIdx)
|
|
{
|
|
int menuIdx = 0;
|
|
foreach (var keyValue in EquipTooltipsLogic.Instance()._PopMenu.SubBtns)
|
|
{
|
|
if (menuIdx == btnIdx)
|
|
{
|
|
_HoldUI = true;
|
|
_GuideUIGO = keyValue.Key.gameObject;
|
|
break;
|
|
}
|
|
else
|
|
{
|
|
++menuIdx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private void GetGuideItemTool()
|
|
{
|
|
if (ItemTooltipsLogic.Instance())
|
|
{
|
|
int btnIdx = int.Parse(PathParam[0]);
|
|
if (ItemTooltipsLogic.Instance()._PopMenu.SubBtns.Count > btnIdx)
|
|
{
|
|
int menuIdx = 0;
|
|
foreach (var keyValue in ItemTooltipsLogic.Instance()._PopMenu.SubBtns)
|
|
{
|
|
if (menuIdx == btnIdx)
|
|
{
|
|
_HoldUI = true;
|
|
_GuideUIGO = keyValue.Key.gameObject;
|
|
break;
|
|
}
|
|
else
|
|
{
|
|
++menuIdx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private void GetGuidePath()
|
|
{
|
|
var uiGO = GameObject.Find(PathParam[0]);
|
|
if (uiGO == null)
|
|
return;
|
|
|
|
if (!uiGO.activeSelf)
|
|
return;
|
|
|
|
var image = uiGO.GetComponent<UnityEngine.UI.Image>();
|
|
if (image != null)
|
|
{
|
|
if (image.sprite == null)
|
|
return;
|
|
}
|
|
|
|
_GuideUIGO = uiGO;
|
|
if (PathParam.Length > 1)
|
|
{
|
|
|
|
_GuideUIImagePath.Add(PathParam[1]);
|
|
}
|
|
if (_GuideUIGO != null && _GuideUIGO.activeInHierarchy)
|
|
_HoldUI = true;
|
|
}
|
|
|
|
private SkillRootItem.SkillShowInfo _GuideSkillInfo;
|
|
private int _GuideSkillClass;
|
|
private void GetGuideSkill()
|
|
{
|
|
if (!SkillRootLogic.Instance())
|
|
return;
|
|
|
|
//if (_GuideSkillInfo == null)
|
|
{
|
|
if (SkillRootLogic.Instance().MySkillInfos.Count == 0)
|
|
return;
|
|
|
|
int classIdx = 0;
|
|
foreach (var skillClassPair in SkillRootLogic.Instance().MySkillInfos)
|
|
{
|
|
foreach (var skillShowInfo in skillClassPair.Value)
|
|
{
|
|
for (int i = 0; i < IntParam.Length; ++i)
|
|
{
|
|
if (skillShowInfo.SkillBase.Id == IntParam[i])
|
|
{
|
|
_GuideSkillClass = classIdx;
|
|
_GuideSkillInfo = skillShowInfo;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
++classIdx;
|
|
}
|
|
}
|
|
//else
|
|
{
|
|
if (UIPath == GUIDE_UI_PATH.SkillClass)
|
|
{
|
|
if (SkillRootLogic.Instance()._SkillClasses.SubBtns.Count > _GuideSkillClass)
|
|
{
|
|
int menuIdx = 0;
|
|
foreach (var keyValue in SkillRootLogic.Instance()._SkillClasses.SubBtns)
|
|
{
|
|
if (menuIdx == _GuideSkillClass)
|
|
{
|
|
_HoldUI = true;
|
|
_GuideUIGO = keyValue.Key.gameObject;
|
|
|
|
break;
|
|
}
|
|
else
|
|
{
|
|
++menuIdx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
foreach (var skillItem in SkillRootLogic.Instance()._SkillInfoPage.SkillItems)
|
|
{
|
|
if (skillItem.ShowSkillInfo == _GuideSkillInfo)
|
|
{
|
|
_HoldUI = true;
|
|
_GuideUIGO = skillItem.gameObject;
|
|
_GuideUIImagePath.Add("Icon");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private void GetEnhanceEquip()
|
|
{
|
|
if (EquipEnhanceRoot.Instance())
|
|
{
|
|
List<int> equipDatas = new List<int>();
|
|
int focusIdx = 0;
|
|
for (int i = 0; i < PathParam.Length; ++i)
|
|
{
|
|
equipDatas.Add(int.Parse(PathParam[i]));
|
|
}
|
|
if (equipDatas.Count == 1)
|
|
{
|
|
focusIdx = equipDatas[0];
|
|
}
|
|
|
|
UIItemBase focusEquip = null;
|
|
int idx = 0;
|
|
EquipEnhanceRoot.Instance()._EquipContainer.ForeachActiveItem<EquipEnhanceItem>(
|
|
(equipItem) =>
|
|
{
|
|
if (equipDatas.Count == 0 && _GuideUIGO == null)
|
|
{
|
|
_HoldUI = true;
|
|
_GuideUIGO = equipItem.gameObject;
|
|
focusEquip = equipItem;
|
|
_GuideUIImagePath.Add("EquipSlot/Icon");
|
|
_GuideUIImagePath.Add("EquipSlot/Quality");
|
|
}
|
|
else if (equipDatas.Count == 1 && _GuideUIGO == null && idx == focusIdx)
|
|
{
|
|
_HoldUI = true;
|
|
_GuideUIGO = equipItem.gameObject;
|
|
focusEquip = equipItem;
|
|
_GuideUIImagePath.Add("EquipSlot/Icon");
|
|
_GuideUIImagePath.Add("EquipSlot/Quality");
|
|
}
|
|
|
|
if (_GuideUIGO == null)
|
|
{
|
|
for (int i = 0; i < equipDatas.Count; ++i)
|
|
{
|
|
if (equipItem._EquipItem.DataID == equipDatas[i])
|
|
{
|
|
_HoldUI = true;
|
|
_GuideUIGO = equipItem.gameObject;
|
|
focusEquip = equipItem;
|
|
_GuideUIImagePath.Add("EquipSlot/Icon");
|
|
_GuideUIImagePath.Add("EquipSlot/Quality");
|
|
}
|
|
}
|
|
}
|
|
++idx;
|
|
}
|
|
);
|
|
if (focusEquip != null)
|
|
{
|
|
EquipEnhanceRoot.Instance()._EquipContainer.ShowContainerPos(focusEquip);
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
private void GetActivity()
|
|
{
|
|
if (ActivityController.Instance())
|
|
{
|
|
int btnIdx = int.Parse(PathParam[0]);
|
|
ActivityItem selectedItem = null;
|
|
bool actEnable = true;
|
|
ActivityController.Instance()._ItemsContainer.ForeachActiveItem<ActivityItem>(
|
|
(activityItem) =>
|
|
{
|
|
if (activityItem.m_ItemInfoId == btnIdx)
|
|
{
|
|
_HoldUI = true;
|
|
_GuideUIGO = activityItem.m_JoinButton.gameObject;
|
|
selectedItem = activityItem;
|
|
if (!activityItem.m_JoinButton.gameObject.activeSelf)
|
|
{
|
|
actEnable = false;
|
|
}
|
|
//_GuideUIImagePath = "Icon";
|
|
}
|
|
}
|
|
);
|
|
|
|
if (selectedItem != null)
|
|
{
|
|
ActivityController.Instance()._ItemsContainer.ShowContainerPos(selectedItem);
|
|
}
|
|
|
|
if (!actEnable)
|
|
{
|
|
FinishGuideStep();
|
|
}
|
|
}
|
|
}
|
|
|
|
private void GetMarketSellItem()
|
|
{
|
|
if (MarketPlayerShopSellPage.Instance())
|
|
{
|
|
int btnIdx = int.Parse(PathParam[0]);
|
|
MarketPlayerShopSellPage.Instance()._SellItemsInPacket.ForeachActiveItem<MarketSellItem>(
|
|
(activityItem) =>
|
|
{
|
|
if (_GuideUIGO == null)
|
|
{
|
|
_HoldUI = true;
|
|
_GuideUIGO = activityItem.gameObject;
|
|
_GuideUIImagePath.Add("MissionInfoAwardItem");
|
|
}
|
|
}
|
|
);
|
|
//if (_GuideUIGO == null)
|
|
//{
|
|
// FinishGuideStep();
|
|
//}
|
|
}
|
|
else
|
|
{
|
|
FinishGuideStep();
|
|
}
|
|
}
|
|
|
|
private void GetDailyWalfare()
|
|
{
|
|
//if (EveryDaySingInPanelCtr.Instance)
|
|
//{
|
|
// int btnIdx = int.Parse(PathParam[0]);
|
|
// for (int nodeIndex = 0; nodeIndex < EveryDaySingInPanelCtr.Instance.nodeItemList.Count; nodeIndex++)
|
|
// {
|
|
// if (EveryDaySingInPanelCtr.Instance.nodeItemList[nodeIndex].GetComponent<EveryDaySingInItem>().stateIcon.isActiveAndEnabled)
|
|
// {
|
|
// _HoldUI = true;
|
|
// _GuideUIGO = EveryDaySingInPanelCtr.Instance.nodeItemList[nodeIndex].gameObject;
|
|
// _GuideUIImagePath.Add("BG/ItemIcon");
|
|
// }
|
|
// }
|
|
// //if (_GuideUIGO == null)
|
|
// //{
|
|
// // FinishGuideStep();
|
|
// //}
|
|
//}
|
|
//else
|
|
//{
|
|
// FinishGuideStep();
|
|
//}
|
|
}
|
|
|
|
private void GetAutoMedic()
|
|
{
|
|
if (PopCanSelectItemPanelCtr.Instance)
|
|
{
|
|
int btnIdx = int.Parse(PathParam[0]);
|
|
for (int nodeIndex = 0; nodeIndex < PopCanSelectItemPanelCtr.Instance.AutoMedicItemList.Count; nodeIndex++)
|
|
{
|
|
if (PopCanSelectItemPanelCtr.Instance.AutoMedicItemList[nodeIndex].GetComponent<MyAutoMedicItem>().m_ItemDataId == btnIdx)
|
|
{
|
|
_HoldUI = true;
|
|
_GuideUIGO = PopCanSelectItemPanelCtr.Instance.AutoMedicItemList[nodeIndex].gameObject;
|
|
_GuideUIImagePath.Add("BG/ItemBg/ItemIcon");
|
|
}
|
|
|
|
}
|
|
//if (_GuideUIGO == null)
|
|
//{
|
|
// FinishGuideStep();
|
|
//}
|
|
}
|
|
}
|
|
|
|
private void GetDialogOption()
|
|
{
|
|
if (OptionDialogLogic.Instance())
|
|
{
|
|
int btnIdx = int.Parse(PathParam[0]);
|
|
if (OptionDialogLogic.Instance()._SubMenu.SubBtns.Count > btnIdx)
|
|
{
|
|
int menuIdx = 0;
|
|
foreach (var keyValue in OptionDialogLogic.Instance()._SubMenu.SubBtns)
|
|
{
|
|
if (menuIdx == btnIdx)
|
|
{
|
|
_HoldUI = true;
|
|
_GuideUIGO = keyValue.Key.gameObject;
|
|
_GuideUIImagePath.Add("Image");
|
|
break;
|
|
}
|
|
else
|
|
{
|
|
++menuIdx;
|
|
}
|
|
}
|
|
}
|
|
//if (_GuideUIGO == null)
|
|
//{
|
|
// FinishGuideStep();
|
|
//}
|
|
}
|
|
}
|
|
|
|
private void GetFubenPage()
|
|
{
|
|
|
|
if (CopyScenePanelCtr.Instance)
|
|
{
|
|
int pageIdx = int.Parse(PathParam[0]);
|
|
int itemIdx = int.Parse(PathParam[1]);
|
|
if (pageIdx == 0)
|
|
{
|
|
string itemChild = PathParam[2];
|
|
if (MainMissionCopySceneRootCtr.Instance)
|
|
{
|
|
if (MainMissionCopySceneRootCtr.Instance.itemPrefabList.Count > itemIdx + 1)
|
|
{
|
|
var btnGO = MainMissionCopySceneRootCtr.Instance.itemPrefabList[itemIdx].transform.Find(itemChild);
|
|
_HoldUI = true;
|
|
_GuideUIGO = btnGO.gameObject;
|
|
}
|
|
|
|
}
|
|
}
|
|
if (pageIdx == 1)
|
|
{
|
|
string itemChild = PathParam[2];
|
|
if (AdvanceCopySceneRootCtr.Instance)
|
|
{
|
|
if (AdvanceCopySceneRootCtr.Instance.itemPrefabList.Count > itemIdx + 1)
|
|
{
|
|
var btnGO = AdvanceCopySceneRootCtr.Instance.itemPrefabList[itemIdx].transform.Find(itemChild);
|
|
_HoldUI = true;
|
|
_GuideUIGO = btnGO.gameObject;
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private void GetWelfare()
|
|
{
|
|
//if (WelfareRootCtr.Instance)
|
|
//{
|
|
// int pageIdx = int.Parse(PathParam[0]);
|
|
// var pageItems = WelfareRootCtr.Instance.GetComponentsInChildren<PanelMenuItem>();
|
|
// var selectItem = pageItems.Find((pageItem) =>
|
|
// {
|
|
// if (pageItem.idx == pageIdx)
|
|
// return true;
|
|
// return false;
|
|
// });
|
|
// if (selectItem != null)
|
|
// {
|
|
// _HoldUI = true;
|
|
// _GuideUIGO = selectItem.gameObject;
|
|
// }
|
|
//}
|
|
}
|
|
|
|
private void GetLiveSkill()
|
|
{
|
|
if (LiveSkillLogic.Instance())
|
|
{
|
|
int skillGroup = int.Parse(PathParam[0]);
|
|
GameObject selectItem = null;
|
|
LiveSkillLogic.Instance()._LiveSkills.ForeachActiveItem<LiveSkillInfoItem>((liveskillItem) =>
|
|
{
|
|
if (liveskillItem._SkillInfo.SkillGroupID == skillGroup)
|
|
{
|
|
selectItem = liveskillItem.gameObject;
|
|
}
|
|
});
|
|
|
|
if (selectItem != null)
|
|
{
|
|
_HoldUI = true;
|
|
_GuideUIGO = selectItem.gameObject;
|
|
_GuideUIImagePath.Add("Icon");
|
|
}
|
|
}
|
|
}
|
|
|
|
private void GetLiveSkillItem()
|
|
{
|
|
if (LiveSkillLogic.Instance())
|
|
{
|
|
int itemID = int.Parse(PathParam[0]);
|
|
GameObject selectItem = null;
|
|
LiveSkillLogic.Instance()._ItemList.ForeachActiveItem<LiveSkillClass>((liveItemClass) =>
|
|
{
|
|
liveItemClass._LiveSkillItems.ForeachActiveItem<LiveSkillClassItem>((liveItem)=>
|
|
{
|
|
if (liveItem._TabLiveSkillItem.Id == itemID)
|
|
{
|
|
selectItem = liveItem.gameObject;
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
if (selectItem != null)
|
|
{
|
|
_HoldUI = true;
|
|
_GuideUIGO = selectItem.gameObject;
|
|
_GuideUIImagePath.Add("Image");
|
|
}
|
|
}
|
|
}
|
|
|
|
protected void TryGetGuideUIGO()
|
|
{
|
|
if (UIPath == GUIDE_UI_PATH.MissionDialog)
|
|
{
|
|
GetGuideMissionDialog();
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.Function)
|
|
{
|
|
GetGuideFunction();
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.BackPack)
|
|
{
|
|
if (PathParam.Length > 1)
|
|
{
|
|
GetGuideEquip();
|
|
}
|
|
else
|
|
{
|
|
GetGuideItem();
|
|
}
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.AutoUse)
|
|
{
|
|
|
|
AutoUseItem();
|
|
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.TeamTag)
|
|
{
|
|
|
|
TeamTag();
|
|
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.EquipToolTip)
|
|
{
|
|
GetGuideEquipTool();
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.ItemToolTip)
|
|
{
|
|
GetGuideItemTool();
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.Path)
|
|
{
|
|
GetGuidePath();
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.UIDisapear)
|
|
{
|
|
GetGuidePath();
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.SkillItem || UIPath == GUIDE_UI_PATH.SkillClass)
|
|
{
|
|
GetGuideSkill();
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.EnhanceEquip)
|
|
{
|
|
GetEnhanceEquip();
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.Activity)
|
|
{
|
|
GetActivity();
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.MarketItem)
|
|
{
|
|
GetMarketSellItem();
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.DailyWelfare)
|
|
{
|
|
GetDailyWalfare();
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.AutoMedic)
|
|
{
|
|
GetAutoMedic();
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.DialogOption)
|
|
{
|
|
GetDialogOption();
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.Welfare)
|
|
{
|
|
GetWelfare();
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.LiveSkill)
|
|
{
|
|
GetLiveSkill();
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.FubenPage)
|
|
{
|
|
GetFubenPage();
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.LiveSkillItem)
|
|
{
|
|
GetLiveSkillItem();
|
|
}
|
|
}
|
|
|
|
protected virtual void InitGuideUIGO()
|
|
{
|
|
if (UIPath == GUIDE_UI_PATH.MissionDialog)
|
|
{
|
|
int missionID = int.Parse(PathParam[0]);
|
|
if (MissionDialogAndLeftTabsLogic.Instance())
|
|
{
|
|
MissionDialogAndLeftTabsLogic.Instance()._MissionContainer.ForeachActiveItem<MissionItemLogic>((missionItem) =>
|
|
{
|
|
if (missionItem.MissionID == missionID)
|
|
{
|
|
_GuideUIGO = missionItem.gameObject;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
else if (UIPath == GUIDE_UI_PATH.Function)
|
|
{
|
|
if (FunctionButtonLogic.Instance())
|
|
{
|
|
var guideGO = FunctionButtonLogic.Instance().transform.Find(PathParam[0]);
|
|
if (guideGO == null)
|
|
return;
|
|
|
|
if (PathParam[0].Contains("ButtonBack"))
|
|
{
|
|
if (BackPackLogic.Instance())
|
|
{
|
|
//FinishGuideStep();
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (PathParam[0].Contains("OpenDetailButton"))
|
|
{
|
|
if (!guideGO.gameObject.activeSelf)
|
|
return;
|
|
}
|
|
|
|
if (PathParam[0].Contains("BtnSkill"))
|
|
{
|
|
if (SkillRootLogic.Instance())
|
|
return;
|
|
}
|
|
|
|
_GuideUIGO = guideGO.gameObject;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
}
|