208 lines
8.4 KiB
C#
208 lines
8.4 KiB
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
using GCGame.Table;
|
|||
|
using System;
|
|||
|
using Module.Log;
|
|||
|
|
|||
|
// 物品路径菜单控制次级菜单
|
|||
|
public class ItemGetPathSubMenuItem : UISubMenuItem {
|
|||
|
|
|||
|
public Text getDesc;
|
|||
|
|
|||
|
public override void InitMenu(object obj)
|
|||
|
{
|
|||
|
_MenuObj = obj;
|
|||
|
|
|||
|
if (obj is ItemGetPathPopRoot.GetPathData)
|
|||
|
{
|
|||
|
ItemGetPathPopRoot.GetPathData data = (ItemGetPathPopRoot.GetPathData)obj;
|
|||
|
ShowDesc(data);
|
|||
|
|
|||
|
if (_SelectGO != null)
|
|||
|
_SelectGO.SetActive(false);
|
|||
|
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
if (_SelectGO != null)
|
|||
|
_SelectGO.SetActive(false);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
private void ShowDesc(ItemGetPathPopRoot.GetPathData data)
|
|||
|
{
|
|||
|
base.Show();
|
|||
|
|
|||
|
int id = -1;
|
|||
|
if (string.IsNullOrEmpty(data.info) || int.TryParse(data.info,out id) == false)
|
|||
|
{
|
|||
|
id = -1;
|
|||
|
}
|
|||
|
|
|||
|
if (data != null)
|
|||
|
{
|
|||
|
switch (data.pathType)
|
|||
|
{
|
|||
|
case 0:// 元宝商城
|
|||
|
_MenuText.text = StrDictionary.GetClientDictionaryString("#{6714}");
|
|||
|
getDesc.text = StrDictionary.GetClientDictionaryString("#{6724}");
|
|||
|
break;
|
|||
|
case 1:// 系统商城
|
|||
|
{
|
|||
|
Tab_SystemShop tab = TableManager.GetSystemShopByID(id, 0);
|
|||
|
if (tab != null)
|
|||
|
{
|
|||
|
_MenuText.gameObject.SetActive(true);
|
|||
|
_MenuText.text = tab.Name;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
_MenuText.gameObject.SetActive(false);
|
|||
|
}
|
|||
|
getDesc.text = StrDictionary.GetClientDictionaryString("#{6724}");
|
|||
|
}
|
|||
|
break;
|
|||
|
case 2:// NPC商店
|
|||
|
{
|
|||
|
Tab_AutoSearch tab = TableManager.GetAutoSearchByID(id, 0);
|
|||
|
if (tab != null)
|
|||
|
{
|
|||
|
_MenuText.gameObject.SetActive(true);
|
|||
|
_MenuText.text = tab.TargetName;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
_MenuText.gameObject.SetActive(false);
|
|||
|
}
|
|||
|
getDesc.text = StrDictionary.GetClientDictionaryString("#{6724}");
|
|||
|
}
|
|||
|
getDesc.text = StrDictionary.GetClientDictionaryString("#{6724}");
|
|||
|
break;
|
|||
|
case 3:// 怪物掉落
|
|||
|
_MenuText.text = StrDictionary.GetClientDictionaryString("#{6717}");
|
|||
|
getDesc.text = StrDictionary.GetClientDictionaryString("#{6724}");
|
|||
|
break;
|
|||
|
case 4:// 交易市场
|
|||
|
_MenuText.text = StrDictionary.GetClientDictionaryString("#{6718}");
|
|||
|
getDesc.text = StrDictionary.GetClientDictionaryString("#{6724}");
|
|||
|
break;
|
|||
|
case 5:// 玩家商店
|
|||
|
_MenuText.text = StrDictionary.GetClientDictionaryString("#{6719}");
|
|||
|
getDesc.text = StrDictionary.GetClientDictionaryString("#{6724}");
|
|||
|
break;
|
|||
|
case 6:// 活动
|
|||
|
{
|
|||
|
Tab_ActivityBase tab = TableManager.GetActivityBaseByID(id, 0);
|
|||
|
if (tab != null)
|
|||
|
{
|
|||
|
_MenuText.gameObject.SetActive(true);
|
|||
|
_MenuText.text = tab.ActivityName;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
_MenuText.gameObject.SetActive(false);
|
|||
|
}
|
|||
|
//getDesc.text = StrDictionary.GetClientDictionaryString("#{6724}");
|
|||
|
}
|
|||
|
//getDesc.text = StrDictionary.GetClientDictionaryString("#{6724}");
|
|||
|
getDesc.text = "";
|
|||
|
break;
|
|||
|
case 7:// 百晓生
|
|||
|
_MenuText.text = StrDictionary.GetClientDictionaryString("#{6721}");
|
|||
|
getDesc.text = StrDictionary.GetClientDictionaryString("#{6726}");
|
|||
|
break;
|
|||
|
case 8:// 副本
|
|||
|
{
|
|||
|
int fubenID = Convert.ToInt32(data.info);
|
|||
|
switch (fubenID)
|
|||
|
{
|
|||
|
case 10:
|
|||
|
_MenuText.text = StrDictionary.GetClientDictionaryString("#{6772}");
|
|||
|
break;
|
|||
|
case 11:
|
|||
|
_MenuText.text = StrDictionary.GetClientDictionaryString("#{6730}");
|
|||
|
break;
|
|||
|
case 12:
|
|||
|
_MenuText.text = StrDictionary.GetClientDictionaryString("#{6731}");
|
|||
|
break;
|
|||
|
case 13:
|
|||
|
_MenuText.text = StrDictionary.GetClientDictionaryString("#{6732}");
|
|||
|
break;
|
|||
|
case 14:
|
|||
|
_MenuText.text = StrDictionary.GetClientDictionaryString("#{6733}");
|
|||
|
break;
|
|||
|
}
|
|||
|
|
|||
|
getDesc.text = StrDictionary.GetClientDictionaryString("#{6727}");
|
|||
|
}
|
|||
|
|
|||
|
break;
|
|||
|
case 9:// 运营活动
|
|||
|
{
|
|||
|
// 活动特殊处理,必须用‘,’区分入口和ID
|
|||
|
string[] infos = data.info.Split(';');
|
|||
|
if (infos.Length < 2)
|
|||
|
{
|
|||
|
LogModule.ErrorLog("Config error !!!");
|
|||
|
_MenuText.gameObject.SetActive(false);
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
if(infos[0] == "-1")
|
|||
|
{
|
|||
|
_MenuText.gameObject.SetActive(true);
|
|||
|
_MenuText.text = StrDictionary.GetClientDictionaryString("#{6754}");
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
int actID = string.IsNullOrEmpty(infos[1]) ? -1 : Convert.ToInt32(infos[1]);
|
|||
|
Tab_ActInfoClient tab = TableManager.GetActInfoClientByID(actID, 0);
|
|||
|
if (tab != null)
|
|||
|
{
|
|||
|
_MenuText.gameObject.SetActive(true);
|
|||
|
_MenuText.text = tab.ActName;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
_MenuText.gameObject.SetActive(false);
|
|||
|
}
|
|||
|
|
|||
|
getDesc.text = StrDictionary.GetClientDictionaryString("#{6725}");
|
|||
|
}
|
|||
|
}
|
|||
|
break;
|
|||
|
case 10://仅展示
|
|||
|
{
|
|||
|
_MenuText.gameObject.SetActive(true);
|
|||
|
_MenuText.text = data.info;
|
|||
|
}
|
|||
|
break;
|
|||
|
case 11://BOSS
|
|||
|
{
|
|||
|
int BossType = Convert.ToInt32(data.info);
|
|||
|
switch (BossType)
|
|||
|
{
|
|||
|
case 0:
|
|||
|
_MenuText.text = StrDictionary.GetClientDictionaryString("#{49148}");
|
|||
|
break;
|
|||
|
case 1:
|
|||
|
_MenuText.text = StrDictionary.GetClientDictionaryString("#{49145}");
|
|||
|
break;
|
|||
|
case 2:
|
|||
|
_MenuText.text = StrDictionary.GetClientDictionaryString("#{49146}");
|
|||
|
break;
|
|||
|
case 3:
|
|||
|
_MenuText.text = StrDictionary.GetClientDictionaryString("#{49147}");
|
|||
|
break;
|
|||
|
}
|
|||
|
|
|||
|
getDesc.text = StrDictionary.GetClientDictionaryString("#{6725}");
|
|||
|
}
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|