//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Thursday, November 15, 2018
|
//--------------------------------------------------------
|
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace Snxxz.UI
|
{
|
|
public class DemonTreasureDungeonVictoryWin : DungeonVictoryWin
|
{
|
[SerializeField] PropertyBehaviour[] m_Propertys;
|
[SerializeField] Button m_ChallengeNextLevel;
|
|
TreasureModel model
|
{
|
get { return ModelCenter.Instance.GetModel<TreasureModel>(); }
|
}
|
|
protected override void AddListeners()
|
{
|
base.AddListeners();
|
m_ChallengeNextLevel.onClick.AddListener(ChallengeNext);
|
}
|
|
protected override void Display()
|
{
|
m_ContainerPoivt.gameObject.SetActive(true);
|
base.DrawPassTime();
|
base.RequireDungeonExit();
|
DisplayDemonTreasureProperty();
|
}
|
|
private void DisplayDemonTreasureProperty()
|
{
|
var result = dungeonModel.dungeonResult;
|
TreasureDungeon treasureDungeon;
|
Dictionary<int, int> propertyDict = null;
|
m_ChallengeNextLevel.gameObject.SetActive(false);
|
if (model.TryGetTreasureDungeon(41110, result.lineID, out treasureDungeon))
|
{
|
var dungeonInfo = treasureDungeon.Get(result.wheel);
|
if (!dungeonInfo.Equals(default(TreasureDungeonInfo)))
|
{
|
propertyDict = dungeonInfo.propertyDict;
|
}
|
if (result.wheel < treasureDungeon.maxLevel - 1)
|
{
|
m_ChallengeNextLevel.gameObject.SetActive(true);
|
}
|
}
|
var index = 0;
|
if (propertyDict != null)
|
{
|
foreach (var key in propertyDict.Keys)
|
{
|
if (index < m_Propertys.Length)
|
{
|
m_Propertys[index].gameObject.SetActive(true);
|
m_Propertys[index].Display(key, propertyDict[key]);
|
}
|
}
|
}
|
for (int i = index; i < m_Propertys.Length; i++)
|
{
|
m_Propertys[i].gameObject.SetActive(false);
|
}
|
}
|
|
private void ChallengeNext()
|
{
|
TreasureDungeon treasureDungeon;
|
var result = dungeonModel.dungeonResult;
|
if (model.TryGetTreasureDungeon(41110, result.lineID, out treasureDungeon))
|
{
|
if (result.wheel < treasureDungeon.maxLevel - 1)
|
{
|
CA508_tagCMDoFBAction pak = new CA508_tagCMDoFBAction();
|
pak.ActionType = 0;
|
pak.ActionInfo = 0;
|
GameNetSystem.Instance.SendInfo(pak);
|
}
|
}
|
}
|
|
}
|
|
}
|
|
|
|
|