//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Wednesday, September 06, 2017
|
//--------------------------------------------------------
|
|
using vnxbqy.UI;
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
using UnityEngine.Events;
|
using UnityEngine.UI;
|
|
namespace vnxbqy.UI
|
{
|
|
public enum KnapsackFuncTitle
|
{
|
bag,
|
store,
|
depot, //仓库
|
devour, //吞噬
|
//后续IL开发添加预设
|
default1,
|
default2,
|
default3,
|
default4,
|
}
|
|
public class KnapSackWin : OneLevelWin
|
{
|
PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
public static KnapsackFuncTitle titleType = KnapsackFuncTitle.bag;
|
public static bool jumpByRedpoint = false; //打开时受红点影响跳转
|
protected Image m_LeftTop;
|
protected override void AddListeners()
|
{
|
base.AddListeners();
|
|
SetFunctionListener(0, OnClickBagTitle);
|
SetFunctionListener(1, OnClickStoreTitle);
|
SetFunctionListener(2, OnClickDepotTitle);
|
SetFunctionListener(3, OnClickDevourTitle);
|
}
|
|
protected override void OnActived()
|
{
|
this.transform.SetAsLastSibling();
|
if (playerPack.lookLineIndex == -1 && jumpByRedpoint)
|
{
|
if (playerPack.redpointEquipDecom.state == RedPointState.Simple)
|
{
|
functionOrder = 3;
|
}
|
}
|
jumpByRedpoint = false;
|
|
base.OnActived();
|
|
m_LeftTop = this.GetComponent<Image>("Pivot/Container_Decorate/Img_LeftTop");
|
m_LeftTop.SetActive(false);
|
m_Left.SetActive(false);
|
m_Right.SetActive(false);
|
}
|
|
protected override void OnPreClose()
|
{
|
titleType = KnapsackFuncTitle.bag;
|
playerPack.SetLookIndex(null);
|
playerPack.isPlayBetterEquipEffect = false;
|
LocalSave.DeleteKey(PackModel.RecordKnapsackTitle);
|
|
base.OnPreClose();
|
}
|
|
private void OnClickDepotTitle()
|
{
|
CloseSubWindows();
|
titleType = KnapsackFuncTitle.depot;
|
WindowCenter.Instance.Open<DepotWin>();
|
WindowCenter.Instance.Open<BagWin>();
|
playerPack.SetLookIndex(null);
|
playerPack.isPlayBetterEquipEffect = false;
|
functionOrder = 2;
|
}
|
|
private void OnClickStoreTitle()
|
{
|
CloseSubWindows();
|
titleType = KnapsackFuncTitle.store;
|
|
WindowCenter.Instance.Open<BagStoreWin>();
|
playerPack.SetLookIndex(null);
|
playerPack.isPlayBetterEquipEffect = false;
|
functionOrder = 1;
|
}
|
|
private void OnClickBagTitle()
|
{
|
CloseSubWindows();
|
titleType = KnapsackFuncTitle.bag;
|
|
WindowCenter.Instance.Open<RoleEquipWin>();
|
WindowCenter.Instance.Open<BagWin>();
|
WindowCenter.Instance.Open<RealmEquipWin>();
|
WindowCenter.Instance.Open("BagSelectWin");
|
functionOrder = 0;
|
}
|
|
private void OnClickDevourTitle()
|
{
|
if (!ItemLogicUtility.Instance.isPackResetOk) return;
|
|
CloseSubWindows();
|
titleType = KnapsackFuncTitle.devour;
|
|
WindowCenter.Instance.Open<EquipDevourWin>();
|
functionOrder = 3;
|
}
|
|
protected override void CloseSubWindows()
|
{
|
base.CloseSubWindows();
|
WindowCenter.Instance.CloseImmediately("BagWin");
|
WindowCenter.Instance.CloseImmediately("RealmEquipWin");
|
WindowCenter.Instance.CloseImmediately("BagSelectWin");
|
}
|
|
}
|
|
}
|
|
|
|
|