106 lines
3.1 KiB
C#
106 lines
3.1 KiB
C#
using Games.LogicObj;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using System.Collections;
|
|
using GCGame;
|
|
using Module.Log;
|
|
using Games.GlobeDefine;
|
|
using System.Collections.Generic;
|
|
using System;
|
|
using GCGame.Table;
|
|
|
|
public class GuildActivity : MonoBehaviour
|
|
{
|
|
|
|
public UIContainerBase m_Container;
|
|
private bool _InitOver = false;
|
|
void OnEnable()
|
|
{
|
|
if (_InitOver)
|
|
return;
|
|
_InitOver = true;
|
|
var tables = TableManager.GetGuildActivityWelfare().Values;
|
|
List<Tab_GuildActivityWelfare> showList = new List<Tab_GuildActivityWelfare>();
|
|
foreach(var activity in tables)
|
|
{
|
|
if (activity.Type == 1)
|
|
continue;
|
|
showList.Add(activity);
|
|
}
|
|
m_Container.InitContentItem(showList, btnClick);
|
|
}
|
|
|
|
private string param1 = string.Empty;
|
|
private string param2 = string.Empty;
|
|
public void btnClick(object data)
|
|
{
|
|
Tab_GuildActivityWelfare tableInfo = data as Tab_GuildActivityWelfare;
|
|
if (tableInfo == null)
|
|
return;
|
|
param1 = tableInfo.GetParambyIndex(0);
|
|
param1 = param1.Replace("\\", "");
|
|
param1 = param1.Replace("\"", "");
|
|
param2 = tableInfo.GetParambyIndex(1);
|
|
param2 = param2.Replace("\\", "");
|
|
param2 = param2.Replace("\"", "");
|
|
Invoke(tableInfo.Opera, 0);
|
|
}
|
|
|
|
//回帮
|
|
public void BackGuild()
|
|
{
|
|
if (GameManager.gameManager == null || GameManager.gameManager.AutoSearch == null)
|
|
return;
|
|
|
|
if (param1=="-1" && param2=="-1")
|
|
{
|
|
if (SceneData.sceneGuildGuid == GameManager.gameManager.PlayerDataPool.GuildInfo.GuildGuid) //自己帮派不能再传送回自己帮派
|
|
{
|
|
GUIData.AddNotifyData(StrDictionary.GetClientDictionaryString("#{25137}"));
|
|
return;
|
|
}
|
|
GameManager.gameManager.AutoSearch.BackGuild(GameManager.gameManager.PlayerDataPool.GuildInfo.GuildGuid, -1, 0, 0);
|
|
UIManager.CloseUI(UIInfo.GuildMainInfoWnd);
|
|
return;
|
|
}
|
|
|
|
|
|
int roleId = 0;
|
|
int.TryParse(param1, out roleId);
|
|
|
|
string[] poss = param2.Split(',');
|
|
float x = 0;
|
|
float z = 0;
|
|
if (poss.Length > 0)
|
|
float.TryParse(poss[0],out x);
|
|
if (poss.Length > 1)
|
|
float.TryParse(poss[1], out z);
|
|
|
|
GameManager.gameManager.AutoSearch.BackGuild(GameManager.gameManager.PlayerDataPool.GuildInfo.GuildGuid, roleId, x, z);
|
|
UIManager.CloseUI(UIInfo.GuildMainInfoWnd);
|
|
}
|
|
|
|
//打开窗口
|
|
public void openGuildBOSS()
|
|
{
|
|
UIManager.ShowUI(UIInfo.GuildBoss);
|
|
}
|
|
|
|
//打开技能窗口
|
|
public void OpenSkillWnd()
|
|
{
|
|
UIManager.ShowUI(UIInfo.SkillInfo, delegate (bool bSuccess, object param)
|
|
{
|
|
if (SkillRootLogic.Instance() != null)
|
|
{
|
|
SkillRootLogic.Instance().ShowTagPage(2);
|
|
}
|
|
});
|
|
}
|
|
|
|
//打开帮战结果窗口
|
|
public void GuildWarResultInfo()
|
|
{
|
|
UIManager.ShowUI(UIInfo.GuildWarResultInfo);
|
|
}
|
|
} |