89 lines
1.8 KiB
C#
89 lines
1.8 KiB
C#
// ***********************************************************************
|
|
// Assembly : Game
|
|
// Author : Kimch
|
|
// Created : 2021-07-17
|
|
// Description :
|
|
// Last Modified By :
|
|
// Last Modified On :
|
|
// ***********************************************************************
|
|
// <copyright file= "LevelActivityWidget" company="Kunpo"></copyright>
|
|
// <summary></summary>
|
|
// ***********************************************************************
|
|
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace G.UI
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public class LevelActivityWidget : KUIWidget
|
|
{
|
|
#region Field
|
|
|
|
#pragma warning disable CS0649 // 从未对字段赋值,字段将一直保持其默认值 null
|
|
[KUIFlag]
|
|
GameObject _goNormal;
|
|
[KUIFlag]
|
|
Image _imgBg;
|
|
[KUIFlag]
|
|
Image _imgPicture;
|
|
[KUIFlag]
|
|
TextMeshProUGUI _tmpName;
|
|
[KUIFlag]
|
|
TextMeshProUGUI _tmpDescription;
|
|
[KUIFlag]
|
|
Button _btnGet;
|
|
[KUIFlag]
|
|
GameObject _goLock;
|
|
[KUIFlag]
|
|
TextMeshProUGUI _tmpRequired;
|
|
#pragma warning restore CS0649 // 从未对字段赋值,字段将一直保持其默认值 null
|
|
|
|
#endregion
|
|
|
|
#region Method
|
|
|
|
public override void Refresh()
|
|
{
|
|
if (this.data is ActivityInfo activity)
|
|
{
|
|
_tmpName.text = activity.name;
|
|
_tmpDescription.text = activity.description;
|
|
}
|
|
}
|
|
|
|
private void OnGotoBtnClick()
|
|
{
|
|
if (this.data is ActivityInfo activity)
|
|
{
|
|
if (activity.type == 6)
|
|
{
|
|
KUIWindow.OpenWindow<EndlessWindow>();
|
|
}
|
|
else
|
|
{
|
|
KUIWindow.OpenWindow<BonusLevelBox>(activity);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Unity
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
private void Awake()
|
|
{
|
|
SetViewData();
|
|
_btnGet.onClick.AddListener(this.OnGotoBtnClick);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|